{"items":[{"id":"NVI-00015166","kind":"vulnerability","title":"sqlparse: Quadratic O(n²) DoS in group_comments","revision":1,"unknowns":["Customer inventory, deployment, reachability and exploitation have not been inspected."],"lifecycle":"active","identifiers":["GHSA-f2ff-p2ww-7p4p","CVE-2026-71491"],"plain_summary":"GitHub lists this reviewed advisory for sqlparse. Published version ranges and source prerequisites are shown below; this is not an inspection of a visitor’s application.","review_status":"source_listed","control_topics":[],"public_actions":[{"summary":"Identify the exact component and deployed version, examine the linked publisher’s conditions, and retain evidence of any mitigation.","source_ids":["sr-343ac34079912382de10d96d159d6c5c"],"action_type":"investigate","limitations":"Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system.","current_supported_target":null}],"schema_version":"1.1.0","source_metrics":[],"why_it_matters":"Published affected context helps an owner decide what evidence to gather. This report has not examined your application.","related_sources":[{"id":"sr-343ac34079912382de10d96d159d6c5c","url":"https://github.com/advisories/GHSA-f2ff-p2ww-7p4p","basis":"vendor_advisory","notes":"GitHub Advisory Database; CC-BY-4.0. Each advisory links its original attribution. Null normalizes fields.","title":"GHSA-f2ff-p2ww-7p4p","publisher":"GitHub Advisory Database","observed_at":"2026-11-02T20:15:44.568Z"}],"affected_context":[{"certainty":"source_listed","source_ids":["sr-343ac34079912382de10d96d159d6c5c"],"technology":"sqlparse","known_exclusions":[],"conditions_summary":"### Summary\nA comment-only statement (`-- c\\n`*n) may cause a Denial of Service (DoS).\n\n### Details\nLocation: sqlparse/engine/grouping.py:331-341 (`group_comments`), invoked first in `group()` at `grouping.py:439`. Reachable via `sqlparse.parse()` and `sqlparse.format(sql, strip_comments=True)`.\n\nA statement made of many single-line comments (`'-- c\\n'` repeated) lexes in O(n) but `group_comments` is O(n²):\n\n```python\ndef group_comments(tlist):\n    tidx, token = tlist.token_next_by(t=T.Comment)\n    while token:\n        eidx, end = tlist.token_not_matching(\n            lambda tk: imt(tk, t=T.Comment) or tk.is_newline, idx=tidx)\n        ...\n        tidx, token = tlist.token_next_by(t=T.Comment, idx=tidx)\n```\n\nThe `while` loop runs n times and each `token_next_by` / `token_not_matching` rescans the O(n) remaining tokens. When all tokens are comments/newlines nothing ever groups, yet the full scan is repeated per token.\n\nTwo following factors increase the severity:\n\n1. `group_comments` runs first in `group()` (`grouping.py:439`), before the `_group_matching` token-","public_affected_ranges":["<= 0.5.5"]}],"null_published_at":"2026-11-03T10:03:26.556Z","source_updated_at":"2026-08-17T17:21:02.000Z","source_disclosed_at":"2026-08-17T17:21:00.000Z","is_synthetic_fixture":false,"null_last_reviewed_at":null,"public_change_summary":"First indexed by Null; source disclosure date is shown separately.","null_first_observed_at":"2026-11-02T20:15:44.568Z"}],"next_cursor":null,"snapshot_revision":"42594"}