CVE-2026-45304: Symfony/yaml Symfony's YAML Parser Vulnerable To Vulnerability
LOWCVE-2026-45304 is a LOW symfony's yaml parser vulnerable to vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Symfony/yaml libraries in the Packagist ecosystem. The issue involves symfony's yaml parser vulnerable to exponential memory allocation via recursive collection-alias expansion ("billion laughs"). Remediation is available by upgrading affected packages to version 5.4.52, 6.4.40, 7.4.12, 8.0.12.
CVE-2026-45304 at a Glance
How to Fix CVE-2026-45304
To remediate this vulnerability, upgrade all affected Symfony/yaml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade symfony/yaml to 5.4.52
Upgrade symfony/symfony to 5.4.52
Upgrade symfony/symfony to 6.4.40
Upgrade symfony/symfony to 7.4.12
Upgrade symfony/symfony to 8.0.12
Upgrade symfony/yaml to 6.4.40
Upgrade symfony/yaml to 7.4.12
Upgrade symfony/yaml to 8.0.12
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for symfony/yaml
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-45304, inspect your project dependencies for Symfony/yaml:
inspect dependencies for symfony/yaml
Analyze the terminal output to locate any version of Symfony/yaml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.52), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. In Symfony/yaml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-45304 Affected Symfony/yaml Versions
8 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
symfony/yaml
|
Packagist |
< 5.4.52
|
5.4.52
|
|
symfony/symfony
|
Packagist |
< 5.4.52
|
5.4.52
|
|
symfony/symfony
|
Packagist |
≥ 6.0.0
< 6.4.40
|
6.4.40
|
|
symfony/symfony
|
Packagist |
≥ 7.0.0
< 7.4.12
|
7.4.12
|
|
symfony/symfony
|
Packagist |
≥ 8.0.0
< 8.0.12
|
8.0.12
|
|
symfony/yaml
|
Packagist |
≥ 6.0.0
< 6.4.40
|
6.4.40
|
|
symfony/yaml
|
Packagist |
≥ 7.0.0
< 7.4.12
|
7.4.12
|
|
symfony/yaml
|
Packagist |
≥ 8.0.0
< 8.0.12
|
8.0.12
|
References
Frequently Asked Questions
What is CVE-2026-45304?
Which Symfony/yaml versions are affected?
What version fixes CVE-2026-45304?
Is symfony/yaml affected?
Is symfony/symfony affected?
What CWE is associated with CVE-2026-45304?
How can I check Packagist dependencies for CVE-2026-45304?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4qpc-3hr4-r2p4",
"modified" : "2026-05-27T21:33:50Z",
"published" : "2026-05-27T21:33:50Z",
"aliases" : [ "CVE-2026-45304" ],
"summary" : "Symfony's YAML Parser Vulnerable to 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.4.52"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.4.52"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.4.40"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.4.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/symfony"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "6.4.40"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.4.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "symfony/yaml"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.12"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/symfony/symfony/security/advisories/GHSA-4qpc-3hr4-r2p4"
}, {
"type" : "WEB",
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-776" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-27T21:33:50Z",
"nvd_published_at" : null
}
}