# GHSA-5VF6-GCHV-CMCR: Unclosed Comments Make the Lexer of ExpressionLanguage Quadratic, Letting Untrusted Expressions Hold a Process

- Database: GitHub
- Severity: CVSS 8.7 (High)
- Published: 2026-11-25
- Modified: 2026-11-25

## Tracked as

- [CVE-2026-134791](https://cve.now/CVE-2026-134791.md): Symfony Expression Language denial of service in the expression lexer

## Affected versions

- symfony/expression-language (Packagist): from 7.2.0, fixed in 7.4.24
- symfony/expression-language (Packagist): from 8.0.0, fixed in 8.1.12
- symfony/symfony (Packagist): from 7.2.0, fixed in 7.4.24
- symfony/symfony (Packagist): from 8.0.0, fixed in 8.1.12

## Description

### 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.

### Resolution

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.

The patch for this issue is available [here](https://github.com/symfony/symfony/commit/e098ffa5936c7c238b9c1a9d5cb82def4573de4f) for branch 7.4 (and forward-ported to 8.1 and 8.2).

### Credits

We would like to thank Nicolas Grekas for reporting the issue and providing the fix.

## References

- https://github.com/symfony/symfony/security/advisories/GHSA-5vf6-gchv-cmcr

Page: https://cve.now/GHSA-5VF6-GCHV-CMCR

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
