- Packages
- symfony/symfony, symfony/yaml
- Fixed in
- 5.4.54, 6.4.45, 7.4.18, 8.1.6
- Published
- Tue 27 Oct 2026, 19:01 Lisbon
- Installs on Packagist
- 88M
In plain words
An attacker who can supply YAML for your application to parse can crash the PHP process or end the request with a fatal error by sending deeply nested inline collections. The outcome depends on the PHP version and stack settings. This also affects #[MapRequestPayload] endpoints when the Yaml component is installed and acceptFormat is not restricted, allowing a single unauthenticated YAML request to trigger the flaw.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| symfony/symfony | >= 2.0.0, < 5.4.54 | 5.4.54 |
| symfony/symfony | >= 6.0.0, < 6.4.45 | 6.4.45 |
| symfony/symfony | >= 7.0.0, < 7.4.18 | 7.4.18 |
| symfony/symfony | >= 8.0.0, < 8.1.6 | 8.1.6 |
| symfony/yaml | >= 2.0.0, < 5.4.54 | 5.4.54 |
| symfony/yaml | >= 6.0.0, < 6.4.45 | 6.4.45 |
| symfony/yaml | >= 7.0.0, < 7.4.18 | 7.4.18 |
| symfony/yaml | >= 8.0.0, < 8.1.6 | 8.1.6 |
Am I affected?
Check composer.lock for symfony/symfony or symfony/yaml in these affected ranges: >= 2.0.0, < 5.4.54, >= 6.0.0, < 6.4.45, >= 7.0.0, < 7.4.18 or >= 8.0.0, < 8.1.6. If present, check whether your application parses untrusted YAML. In particular, look for #[MapRequestPayload] endpoints with the Yaml component installed that do not restrict acceptFormat.
What to do
Check which version you have, then update to a fixed release for your branch (5.4.54, 6.4.45, 7.4.18, 8.1.6):
composer show symfony/symfony | grep versions
composer update symfony/symfony
If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.
The advisory's description
Description
Yaml\Parser::lexInlineStructure() recursed through lexInlineMapping() and lexInlineSequence() for every { and [ of an inline collection, without entering the nesting level that the rest of the parser bounds with maxNestingLevel. A document made of deeply nested inline collections, such as [[[[...]]]], exhausted the stack while it was being lexed: depending on the PHP version and its stack settings, the process crashed or the request ended with a fatal error.
Any code parsing untrusted YAML is affected. That includes #[MapRequestPayload] when the Yaml component is installed and the endpoint does not restrict acceptFormat: a single unauthenticated request with a YAML content type is enough.
Resolution
The inline lexer now enters and leaves the same nesting level as the rest of the parser, so nested inline collections are bounded by maxNestingLevel, and the parser raises a ParseException beyond it.
The patches for this issue are available here for branch 5.4 (and forward-ported to 6.4, 7.4, 8.1 and 8.2).
Credits
We would like to thank Nicolas Grekas for reporting the issue and providing the fix.
References
- Fix: #65688
Weakness: CWE-674 Uncontrolled Recursion. Reported by nicolas-grekas.