Unclosed Comments Make the Lexer of ExpressionLanguage Quadratic, Letting Untrusted Expressions Hold a Process
- State
- Published
- Severity
- 8.7 High
- Published
- Nov 25, 2026
- Updated
- Nov 25, 2026
- Reserved
- Nov 22, 2026
Description
Since Symfony 7.2, expressions can contain comments. The lexer used a regular expression to find the end of a comment. When a /* was never closed, this regular expression scanned the rest of the expression, and the lexer then went on with the next character. So each /* scanned the rest of the expression again. Linting 192 KB of /* took 9 to 11 seconds, and 96 KB took 34 seconds without PCRE JIT.
The lexer runs before the parser and its nesting limit. Any code that lints or parses untrusted expressions is affected, including the ExpressionSyntax validation constraint. A Length constraint on the same value doesn't help, since the validator runs both constraints.
The lexer now uses strpos() to find the end of a comment, and a comment that is never closed throws a SyntaxError. Such expressions were already invalid. Lexing takes linear time again.
| Product | Versions |
|---|---|
| symfony/expression-language Symfony | 7.2.0 to before 7.4.24 Affected8.0.0 to before 8.1.12 Affected |
| symfony/symfony Symfony | 7.2.0 to before 7.4.24 Affected8.0.0 to before 8.1.12 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 8.7 High | Symfony |
Weaknesses
- CWE-407 Inefficient Algorithmic Complexity
References
- CVE-2026-134791Vendor Advisory
- GHSA-5vf6-gchv-cmcrVendor Advisory
- https://github.com/symfony/symfony/commit/e098ffa5936c7c238b9c1a9d5cb82def4573de4fPatch
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.