/

CVE-2026-45304

Severity:

HIGH RISK

(7.5)

YAML Alias Expansion (CWE-776) in Symfony Parser

CVE-2026-45304

Analyzed

Vulnerability type

Category:

Resource Exhaustion via XML/YAML Entity Expansion

CWE:

CWE-776

Impact:

Denial of Service via Memory Exhaustion

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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\Parser on 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.

Sources

SourceLink
github.comgithub.com/symfony/symfony/commit/e77391b2e4f18821198f010d573674c8ed4a970a
github.comgithub.com/symfony/symfony/releases/tag/v5.4.52
github.comgithub.com/symfony/symfony/releases/tag/v6.4.40
github.comgithub.com/symfony/symfony/releases/tag/v7.4.12
github.comgithub.com/symfony/symfony/releases/tag/v8.0.12
github.comgithub.com/symfony/symfony/security/advisories/GHSA-4qpc-3hr4-r2p4

Frequently asked

questions

Exploitability depends on whether the application parses YAML that an attacker can influence. If YAML parsing is limited to trusted, operator-managed configuration, risk is low; if exposed via uploads, APIs, or multi-tenant inputs, the attack surface is wider.

An attacker needs the ability to provide or modify YAML content that the application will parse—such as sending crafted payloads to an endpoint, altering configuration in a misconfigured environment, or leveraging import features that consume YAML.

The safest pattern is to restrict or disable advanced YAML features (like aliases) on untrusted inputs and enforce rigorous bounds on input size and complexity before parsing. Additionally, segregating YAML parsing for untrusted data into constrained processes reduces impact if parsing goes wrong.

To prevent similar issues, treat all complex serialization formats as potential attack surfaces: apply conservative parsing options, validate inputs against schemas, enforce resource limits, and subject parsing logic to security review and automated checks in the development pipeline.

Find out what's already
exploitable in your codebase.