NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Composer (PHP)

CVE-2026-45305: Symfony's YAML Parser has a ReDoS via Catastrophic Backtracking in Parser::cleanup() Regex

lowCVSS 4.0 2.7GHSA-9frc-8383-795m

Description Symfony\Component\Yaml\Parser::cleanup() strips the optional %YAML directive header, leading comments, and document start/end markers before parsing. The original regexes contained overlapping quantifiers, most notably '#^%YAML[: ][\d.]+.\n#u', whose [\d.]+ and . overlap on the dot, that exhibit catastrophic backtracking on crafted input.

Published May 27, 2026

Affected packages

symfony/yaml

Ecosystem
Composer (PHP)
Affected
< 5.4.52
Fixed in
5.4.52
Check
composer show symfony/yaml

symfony/symfony

Ecosystem
Composer (PHP)
Affected
< 5.4.52
Fixed in
5.4.52
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 6.0.0, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 7.0.0, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/symfony

symfony/symfony

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/symfony

symfony/yaml

Ecosystem
Composer (PHP)
Affected
>= 6.0.0, < 6.4.40
Fixed in
6.4.40
Check
composer show symfony/yaml

symfony/yaml

Ecosystem
Composer (PHP)
Affected
>= 7.0.0, < 7.4.12
Fixed in
7.4.12
Check
composer show symfony/yaml

symfony/yaml

Ecosystem
Composer (PHP)
Affected
>= 8.0.0, < 8.0.12
Fixed in
8.0.12
Check
composer show symfony/yaml

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Description

Symfony\Component\Yaml\Parser::cleanup() strips the optional %YAML directive header, leading comments, and document start/end markers before parsing. The original regexes contained overlapping quantifiers, most notably '#^%YAML[: ][\d.]+.*\n#u', whose [\d.]+ and .* overlap on the dot, that exhibit catastrophic backtracking on crafted input. A single oversized %YAML directive header (or comment / document-marker line) makes the parser hang for an arbitrarily long time, denying service.

Resolution

The four regexes in Parser::cleanup() (YAML directive header, leading comments, document-start marker, document-end marker) have been rewritten with possessive quantifiers and unambiguous character classes so backtracking cannot occur.

The patch for this issue is available here for branch 5.4.

Credits

Symfony would like to thank Pietro Tirenna (Shielder) for reporting the issue and Nicolas Grekas for fixing it.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More Composer (PHP) vulnerabilities

All Composer (PHP) entries