Summary
Symfony's YAML parser previously resolved collection aliases recursively, enabling small untrusted YAML inputs to expand into huge in-memory structures.
When applications parse attacker-controlled YAML, this behavior can exhaust memory, potentially causing denial of service or application downtime.
Affected context
This vulnerability affects PHP applications that rely on Symfony's Yaml\Parser to process YAML documents, particularly where YAML content can be influenced by external or partially untrusted sources.
It is most relevant in contexts such as configuration loading, API payload processing, or import features that parse YAML without strict size or complexity limits.
The issue is triggered when YAML inputs use deeply nested or recursive collection aliases, causing disproportionate memory usage compared to the original input size.
Exploit preconditions
- Attack surface: Any endpoint, CLI command, or background job that parses YAML using
Symfony\Component\Yaml\Parser. - Required access: Ability to supply or modify YAML input (e.g., configuration files, uploaded documents, API request bodies, or integration payloads).
- Trigger point: The moment the vulnerable parser processes YAML documents containing recursively defined aliases or self-referential collections.
- Why exploitation is possible: The parser resolves collection aliases recursively without enforcing limits on expansion depth or aggregate structure size, allowing a small input to inflate into a multi-gigabyte in-memory representation.
Why this happens
The underlying issue is uncontrolled resource consumption caused by recursive alias resolution in the YAML parser.
Alias constructs in YAML are meant to reference existing nodes, but the vulnerable implementation allowed nested or cyclic alias patterns to be expanded repeatedly, creating exponentially larger data structures.
This aligns with CWE-776: Improper Restriction of Recursive Entity Expansion, where input features such as entities or aliases are processed without adequate safeguards on complexity, leading to memory exhaustion and denial-of-service conditions.
Potential impact
- Applications parsing malicious YAML may consume excessive memory and become unresponsive.
- Server processes can crash due to out-of-memory conditions, triggering restarts and service disruption.
- Co-located workloads on shared hosts or containers could experience degraded performance due to resource contention.
- Availability-focused SLAs can be violated through repeated exploitation, enabling sustained denial of service.
General mitigation guidance
Mitigation centers on constraining parser behavior and reducing trust in inbound configuration-like data.
Common defensive patterns include:
- Imposing strict limits on input size, nesting depth, and structural complexity before parsing YAML.
- Avoiding dynamic parsing of user-supplied or multi-tenant YAML wherever possible, favoring static configuration under operational control.
- Using parsing modes or wrappers that disable or restrict advanced features such as aliases when not strictly required.
- Isolating heavy parsing operations in processes or containers with capped memory and clear failure modes to prevent impact on the main application.
- Applying least-privilege principles to services that consume untrusted YAML so their failure does not cascade across the environment.
How teams detect issues like this
Effective detection blends code-centric and operational monitoring approaches:
- Static analysis and code review can flag uses of
Symfony\Component\Yaml\Parseron data paths fed by user input or external integrations, especially without validation or size checks. - Architectural reviews should look for YAML-based configuration or import mechanisms that accept arbitrary content from tenants, partners, or end users.
- Runtime monitoring can track memory usage spikes correlated with YAML parsing actions, using alerts on sudden growth or frequent out-of-memory terminations.
- Security policies in CI/CD may require explicit bounds checking or pre-parse validation for any feature that ingests structured text formats such as YAML.

