Original 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.
Affected products and versions
CVSS vector, explained
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None (no login)
- User interaction
- Not required
- Confidentiality
- None
- Integrity
- None
- Availability
- High impact
Weakness type (CWE)
- CWE-407 Inefficient Algorithmic Complexity
References
- symfony.com/cve-2026-134791 vendor advisory
- github.com/symfony/symfony/security/advisories/GHSA-5vf6-gchv-cmcr vendor advisory
- github.com/symfony/symfony/commit/e098ffa5936c7c238b9c1a9d5cb82def4573de4f patch
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Summaries are AI-written under strict rules; always check the vendor's official advisory.