CVE-2026-59893: Sqlparse Dollar Quote Backref Redos

Matching dollar-quoted strings or dynamic delimiters using a lazy dot-all regex with a backreference (e.g. `\$...[\s\S]*?\1`) leads to quadratic time complexity (ReDoS) when applied over unmatched delimiters. Use a linear, single-pass delimiter-resolution algorithm instead.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-59893-sqlparse-dollar-quote-backref-redos --engine opengrep

Description

Matching dollar-quoted strings or dynamic delimiters using a lazy dot-all regex with a backreference (e.g. `\$...[\s\S]*?\1`) leads to quadratic time complexity (ReDoS) when applied over unmatched delimiters. Use a linear, single-pass delimiter-resolution algorithm instead.