Symfony hardened the parser when handling untrusted input
Published 27 May 2026 · Updated 10 Sept 2026
Is your project on an affected symfony/yaml?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- <5.4.52
- Fixed in
- 5.4.52
composer require symfony/yaml:^5.4.52- Affected
- <5.4.52
- Fixed in
- 5.4.52
composer require symfony/symfony:^5.4.52- Affected
- >=6.0.0 <6.4.40
- Fixed in
- 6.4.40
composer require symfony/symfony:^6.4.40- Affected
- >=7.0.0 <7.4.12
- Fixed in
- 7.4.12
composer require symfony/symfony:^7.4.12- Affected
- >=8.0.0 <8.0.12
- Fixed in
- 8.0.12
composer require symfony/symfony:^8.0.12- Affected
- >=6.0.0 <6.4.40
- Fixed in
- 6.4.40
composer require symfony/yaml:^6.4.40- Affected
- >=7.0.0 <7.4.12
- Fixed in
- 7.4.12
composer require symfony/yaml:^7.4.12- Affected
- >=8.0.0 <8.0.12
- Fixed in
- 8.0.12
composer require symfony/yaml:^8.0.12Details
Description
Symfony\Component\Yaml\Parser is the entry point for parsing YAML strings into PHP values via Yaml::parse(). When the parser is exposed to attacker-controlled input, deeply nested mappings or sequences cause both the block-level (Parser::parseBlock()) and inline (Inline::parseSequence() / Inline::parseMapping()) parsers to recurse without a depth limit. A crafted document exhausts the PHP stack and crashes the worker.
Resolution
The Parser now tracks recursion depth in a shared ParserState object across both block-level and inline parsing, with a default limit of 128. The limit is configurable via a new $maxNestingLevel argument on Parser::__construct(), Yaml::parse() and Yaml::parseFile().
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.
Is GHSA-c2p3-7m5p-cv8x in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected symfony/yaml, and gives you the command that fixes it.
More advisories for symfony/yaml
- HighCVE-2026-109413Symfony: Unbounded Recursion in the YAML Inline Lexer Lets a Single Document Crash the Process · 27 Oct 2026
- LowCVE-2026-45305Symfony's YAML Parser has a ReDoS via Catastrophic Backtracking in Parser::cleanup() Regex · 27 May 2026
- LowCVE-2026-45304Symfony's YAML Parser Vulnerable to Exponential Memory Allocation via Recursive Collection-Alias Expansion ("Billion Laughs") · 27 May 2026
- HighCVE-2013-1348Symphony Vulnerable to PHP Code Injection via YAML Parsing · 17 May 2022
- HighCVE-2013-1397Symfony Arbitrary PHP code Execution · 17 May 2022
References
- Linkgithub.com/symfony/symfony/security/advisories/GHSA-c2p3-7m5p-cv8x
- Linkgithub.com/symfony/symfony/commit/914f427ed9630ddb3904dafba763e53d9f133fe3
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45133.yaml
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/yaml/CVE-2026-45133.yaml
- Packagegithub.com/symfony/symfony
- Linksymfony.com/cve-2026-45133
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.