{"id":"CVE-2026-45304","aliases":["GHSA-4qpc-3hr4-r2p4"],"url":"https://o3.security/vulnerability/CVE-2026-45304","summary":"Symfony: YAML Parser Exponential Memory Allocation via Recursive Collection-Alias Expansion (\"Billion Laughs\")","details":"### Description\n\n`Symfony\\Component\\Yaml\\Parser` resolves YAML aliases (`*anchor`) during parsing. Aliases that reference *collections* (arrays, `stdClass`, `TaggedValue`-wrapped collections) can themselves point to other collections containing aliases, creating exponential expansion at resolution time. A small input can blow up into a multi-gigabyte structure and exhaust memory: the classic \"Billion Laughs\" denial-of-service against any parser exposed to untrusted YAML.\n\n### Resolution\n\nThe `Parser` now counts collection alias resolutions in a shared `ParserState` object, with a default limit of **128**, following the [SnakeYAML model](https://github.com/snakeyaml/snakeyaml/blob/master/src/main/java/org/yaml/snakeyaml/LoaderOptions.java). Scalar aliases remain unrestricted since they cannot drive exponential growth. The limit is configurable via a new `$maxAliasesForCollections` argument on `Parser::__construct()`, `Yaml::parse()` and `Yaml::parseFile()`. A new `Yaml::PARSE_EXCEPTION_ON_ALIAS` flag also rejects all aliases outright when parsing fully untrusted input.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/e77391b2e4f18821198f010d573674c8ed4a970a) for branch 5.4.\n\n### Credits\n\nSymfony would like to thank Pietro Tirenna (Shielder) for reporting the issue and Nicolas Grekas for fixing it.","published":"2026-07-14T18:48:49.329Z","modified":"2026-08-12T03:51:15.741472499Z","cvss":null,"epss":{"score":0.00804,"percentile":0.54012,"asOf":"2026-08-21"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/yaml","fixedVersion":"5.4.52"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"5.4.52"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.0.12"},{"ecosystem":"Packagist","name":"symfony/yaml","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/yaml","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/yaml","fixedVersion":"8.0.12"}],"fix":{"url":"https://github.com/symfony/symfony/commit/e77391b2e4f18821198f010d573674c8ed4a970a","label":"symfony/symfony@e77391b"},"references":[{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v5.4.52"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.40"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.12"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.0.12"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45304.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-4qpc-3hr4-r2p4"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45304"},{"type":"FIX","url":"https://github.com/symfony/symfony/commit/e77391b2e4f18821198f010d573674c8ed4a970a"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45304.yaml"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/yaml/CVE-2026-45304.yaml"},{"type":"PACKAGE","url":"https://github.com/symfony/symfony"},{"type":"WEB","url":"https://symfony.com/cve-2026-45304"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:15.741472499Z"}}