Descrizione
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.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 8.7, EPSS 0.6% (percentile 45).
Versioni da aggiornare
- Symfony symfony/expression-language: vulnerabili le versioni dalla
7.2.0precedenti alla7.4.24→ aggiornare alla7.4.24o successiva. - Symfony symfony/expression-language: vulnerabili le versioni dalla
8.0.0precedenti alla8.1.12→ aggiornare alla8.1.12o successiva. - Symfony symfony/symfony: vulnerabili le versioni dalla
7.2.0precedenti alla7.4.24→ aggiornare alla7.4.24o successiva. - Symfony symfony/symfony: vulnerabili le versioni dalla
8.0.0precedenti alla8.1.12→ aggiornare alla8.1.12o successiva.
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Ridurre l'esposizione del componente vulnerabile (segmentazione, accesso solo da reti fidate) finché la patch non è applicata.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| Symfony | symfony/expression-language | ≥ 7.2.0 < 7.4.24 | 7.4.24 |
| Symfony | symfony/expression-language | ≥ 8.0.0 < 8.1.12 | 8.1.12 |
| Symfony | symfony/symfony | ≥ 7.2.0 < 7.4.24 | 7.4.24 |
| Symfony | symfony/symfony | ≥ 8.0.0 < 8.1.12 | 8.1.12 |