CVE-2026-45133: Symfony/yaml Symfony Hardened The Parser When Vulnerability

LOW
Advisory Identifier: GHSA-c2p3-7m5p-cv8x
CWE-776 CWE-1333 CWE-674
Published
Advisory Summary

CVE-2026-45133 is a LOW symfony hardened the parser when vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Symfony/yaml libraries in the Packagist ecosystem. The issue involves symfony hardened the parser when handling untrusted input. Remediation is available by upgrading affected packages to version 5.4.52, 6.4.40, 7.4.12, 8.0.12.

CVE-2026-45133 at a Glance

CVE Identifier CVE-2026-45133
GHSA Identifier GHSA-c2p3-7m5p-cv8x
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Affected Product Symfony/yaml
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-45133

To remediate this vulnerability, upgrade all affected Symfony/yaml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/yaml fixed: 5.4.52
Upgrade symfony/yaml to 5.4.52
symfony/symfony fixed: 5.4.52
Upgrade symfony/symfony to 5.4.52
symfony/symfony fixed: 6.4.40
Upgrade symfony/symfony to 6.4.40
symfony/symfony fixed: 7.4.12
Upgrade symfony/symfony to 7.4.12
symfony/symfony fixed: 8.0.12
Upgrade symfony/symfony to 8.0.12
symfony/yaml fixed: 6.4.40
Upgrade symfony/yaml to 6.4.40
symfony/yaml fixed: 7.4.12
Upgrade symfony/yaml to 7.4.12
symfony/yaml fixed: 8.0.12
Upgrade symfony/yaml to 8.0.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/yaml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-45133, inspect your project dependencies for Symfony/yaml:

inspect dependencies for symfony/yaml

Analyze the terminal output to locate any version of Symfony/yaml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.52), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. In Symfony/yaml, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/symfony/symfony/commit/914f427ed9630ddb3904dafba763e53d9f133fe3) for branch 5.4. ### Credits Symfony would like to thank Pietro Tirenna (Shielder) for reporting the issue and Nicolas Grekas for fixing it.

CVE-2026-45133 Affected Symfony/yaml Versions

8 component(s)
Fixed Versions:
5.4.526.4.407.4.128.0.12
Product / Package Ecosystem Affected Versions Fixed Version
symfony/yaml
Packagist
< 5.4.52
5.4.52
symfony/symfony
Packagist
< 5.4.52
5.4.52
symfony/symfony
Packagist
≥ 6.0.0
< 6.4.40
6.4.40
symfony/symfony
Packagist
≥ 7.0.0
< 7.4.12
7.4.12
symfony/symfony
Packagist
≥ 8.0.0
< 8.0.12
8.0.12
symfony/yaml
Packagist
≥ 6.0.0
< 6.4.40
6.4.40
symfony/yaml
Packagist
≥ 7.0.0
< 7.4.12
7.4.12
symfony/yaml
Packagist
≥ 8.0.0
< 8.0.12
8.0.12

References

Frequently Asked Questions

What is CVE-2026-45133?
CVE-2026-45133 is a security vulnerability in Symfony/yaml involving Symfony hardened the parser when handling untrusted input under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').
Which Symfony/yaml versions are affected?
Affected versions include releases prior to 5.4.52, 6.4.40, 7.4.12, 8.0.12 across affected packages: symfony/yaml, symfony/symfony.
What version fixes CVE-2026-45133?
Upgrading to 5.4.52, 6.4.40, 7.4.12, 8.0.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/yaml affected?
Yes, symfony/yaml is affected in releases prior to 5.4.52, 6.4.40, 7.4.12, 8.0.12. Upgrade your dependency to 5.4.52, 6.4.40, 7.4.12, 8.0.12 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 5.4.52, 6.4.40, 7.4.12, 8.0.12. Upgrade your dependency to 5.4.52, 6.4.40, 7.4.12, 8.0.12 or later.
What CWE is associated with CVE-2026-45133?
CVE-2026-45133 is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') (The product uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.).
How can I check Packagist dependencies for CVE-2026-45133?
Run the dependency tree command: 'inspect dependencies for symfony/yaml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c2p3-7m5p-cv8x",
  "modified" : "2026-05-27T21:33:07Z",
  "published" : "2026-05-27T21:33:07Z",
  "aliases" : [ "CVE-2026-45133" ],
  "summary" : "Symfony hardened the parser when handling untrusted input",
  "details" : "### Description\n\n`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.\n\n### Resolution\n\nThe `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()`.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/914f427ed9630ddb3904dafba763e53d9f133fe3) for branch 5.4.\n\n### Credits\n\nSymfony would like to thank Pietro Tirenna (Shielder) for reporting the issue and Nicolas Grekas for fixing it.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.52"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.52"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.40"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.40"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/yaml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-c2p3-7m5p-cv8x"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/914f427ed9630ddb3904dafba763e53d9f133fe3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45133.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/yaml/CVE-2026-45133.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-45133"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-674", "CWE-776" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-27T21:33:07Z",
    "nvd_published_at" : null
  }
}