Summary
Symfony's YAML parsing components can be driven into uncontrolled recursion when processing attacker-controlled documents containing deeply nested mappings or sequences.
Under these conditions, a crafted payload can exhaust the PHP call stack and crash the worker process, leading to denial of service against affected applications.
Affected context
This vulnerability manifests in Symfony-based applications that accept or process YAML or YAML-like content derived from user input, external configuration feeds, or integrated services.
It is most relevant where the YAML parser is reachable through public or semi-public interfaces and where worker processes are long-lived or shared across multiple requests, since a single malicious document can bring down the handling worker and temporarily disrupt service.
Exploit preconditions
- Attack surface: Any endpoint or processing path that passes attacker-controlled or untrusted YAML data to Symfony's YAML parser.
- Required access: Ability to submit or influence YAML documents (e.g., API payloads, uploaded configuration files, or data from external integrations).
- Trigger point: Invocation of
Parser::parseBlock()orInline::parseSequence()/Inline::parseMapping()on a deeply nested structure without enforcing a recursion or nesting depth limit. - Why exploitation is possible: The parsing logic recursively descends into nested mappings and sequences without guarding against excessive depth, allowing an attacker to craft input that drives the PHP interpreter into stack exhaustion.
Why this happens
The core issue stems from recursive parsing logic that does not cap nesting depth when processing mappings and sequences.
Both the block-level parser and the inline parser follow the structure of the input document by calling themselves repeatedly for each nested element.
In line with CWE-776: Improper Restriction of Recursive Resource Consumption and CWE-674: Uncontrolled Resource Consumption, this unbounded recursion lets an attacker consume stack resources simply by increasing the document's nesting depth, ultimately leading to a crash.
Potential impact
- A single malformed YAML payload can cause the PHP worker process to crash.
- Attackers may continuously send crafted documents to induce sustained denial of service.
- Shared worker pools or process managers may experience instability or degraded performance.
- Logging, monitoring, or background jobs that rely on the same parser can be disrupted.
General mitigation guidance
Effective mitigation focuses on limiting recursion and constraining how untrusted documents are parsed.
Common defensive patterns include:
- Enforcing a maximum nesting depth for mappings and sequences during parsing, failing fast on overly deep documents.
- Validating and sanitizing input before passing it to the YAML parser, rejecting structures that do not match an expected schema.
- Separating trusted configuration parsing from user-facing input handling, using stricter parsing rules or different components for untrusted data.
- Applying operational controls such as request rate limiting and per-worker resource caps to minimize the impact of attempted exhaustion.
How teams detect issues like this
Detection can rely on both code-level and runtime signals.
At the code level, static analysis or manual review can flag usages of Symfony's YAML parsing APIs where untrusted input is accepted without depth checks, schema validation, or defensive wrappers.
Runtime monitoring can look for repeated worker crashes, elevated error rates, and consistent stack exhaustion traces tied to YAML parsing functions.
Security-focused automated review tools and CI checks can enforce internal policies that require bounded recursion and structured validation for all parsing of external data.

