CVE-2026-45304
JSON

8.7high

Symfony: YAML Parser Exponential Memory Allocation via Recursive Collection-Alias Expansion ("Billion Laughs")

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.68% (higher than 48% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4qpc-3hr4-r2p4

Description

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to 5.4.52, 6.4.40, 7.4.12, and 8.0.12, Symfony\Component\Yaml\Parser resolved YAML collection aliases recursively, allowing a small untrusted YAML input to expand into a multi-gigabyte structure and exhaust memory. This issue is fixed in versions 5.4.52, 6.4.40, 7.4.12, and 8.0.12.

Affected

Product or packageVersionsReported by
symfony symfony< 5.4.52, >= 6.0.0-BETA1, < 6.4.40, >= 7.0.0-BETA1, < 7.4.12, >= 8.0.0-BETA1, < 8.0.12CVE List
symfony yaml< 5.4.52, >= 6.0.0-BETA1, < 6.4.40, >= 7.0.0-BETA1, < 7.4.12, >= 8.0.0-BETA1, < 8.0.12CVE List
symfony/yaml (Packagist)before 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12GitHub Advisory Database
symfony/symfony (Packagist)before 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12GitHub Advisory Database
sensiolabs symfonybefore 5.4.52, from 6.0.0 before 6.4.40, from 7.0.0 before 7.4.12, from 8.0.0 before 8.0.12NVD

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
GitHublow CVSS:4.0CVSS: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
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-776

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to 5.4.52, 6.4.40, 7.4.12, and 8.0.12, Symfony\Component\Yaml\Parser resolved YAML collection aliases recursively, allowing a small untrusted YAML input to expand into a multi-gigabyte structure and exhaust memory. This issue is fixed in versions 5.4.52, 6.4.40, 7.4.12, and 8.0.12.

GitHub Advisory Database
Description

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.

Resolution

The Parser now counts collection alias resolutions in a shared ParserState object, with a default limit of 128, following the SnakeYAML model. 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.

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

Sources

SourceRecordLicence
CVE ListCVE-2026-45304 changed 2026-07-14CVE Terms of Use
GitHub Advisory DatabaseGHSA-4qpc-3hr4-r2p4 changed 2026-09-10CC-BY-4.0
NVDCVE-2026-45304 changed 2026-07-15Public domain