An Unclosed Symfony Comment Could Hold an Expression Worker
CVE-2026-134791 affects Symfony ExpressionLanguage 7.2 and later before 7.4.24, plus 8.0 before 8.1.12. The lexer used a regular expression to find the end of a comment. When the expression contained /* without a closing marker, the pattern scanned the remaining text, and then the lexer advanced and scanned again for the next comment start.
That behavior is quadratic. The Symfony advisory gives measured examples: linting 192 KB of repeated comment openers took 9 to 11 seconds, while 96 KB took 34 seconds without PCRE JIT. The lexer runs before the parser and its nesting limit, so a parser limit does not prevent the work. Any application that validates or parses untrusted expressions can consume worker time.
A Length constraint on the same input is not a reliable mitigation because the validator may run both checks. An expression that is within the length limit can still contain many comment openers and force repeated scans. The fixed lexer uses strpos() and treats an unclosed comment as a SyntaxError. The advisory rates the issue high with CVSS v4 8.7 and an availability impact.
Applications should upgrade to the patched branch and then review where expressions are accepted. This includes user-supplied rules, template conditions, query filters, and validation constraints in admin interfaces. If the application only evaluates constants controlled by developers, the exposure is smaller, but dependency scanners will still flag the package.
Add tests that submit a large number of /* sequences and assert that parsing fails quickly. Set CPU and wall-clock limits around any worker that accepts expressions from a lower-trust source. A syntax error is the desired result; a long stall followed by a timeout is not.
Monitoring should separate invalid-expression rates from process restarts. A sudden rise in syntax failures from one account, source address, or API key is useful context even if the content is blocked. Keep the raw expression only long enough for investigation and redact sensitive data.
Top comments (0)