CVE-2026-45305: Symfony/yaml :cleanup() Regex Vulnerability

LOW
Advisory Identifier: GHSA-9frc-8383-795m
CWE-1333
Published
Advisory Summary

CVE-2026-45305 is a LOW :cleanup() regex vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Symfony/yaml libraries in the Packagist ecosystem. The issue involves :cleanup() regex. Remediation is available by upgrading affected packages to version 5.4.52, 6.4.40, 7.4.12, 8.0.12.

CVE-2026-45305 at a Glance

CVE Identifier CVE-2026-45305
GHSA Identifier GHSA-9frc-8383-795m
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Symfony/yaml
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-45305

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-45305, 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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. 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::cleanup()` strips the optional `%YAML` directive header, leading comments, and document start/end markers before parsing. The original regexes contained overlapping quantifiers, most notably `'#^%YAML[: ][\d.]+.*\n#u'`, whose `[\d.]+` and `.*` overlap on the dot, that exhibit catastrophic backtracking on crafted input. A single oversized `%YAML` directive header (or comment / document-marker line) makes the parser hang for an arbitrarily long time, denying service. ### Resolution The four regexes in `Parser::cleanup()` (YAML directive header, leading comments, document-start marker, document-end marker) have been rewritten with possessive quantifiers and unambiguous character classes so backtracking cannot occur. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/9749cd43c5e09b3735093623670b21b9d8a056cb) 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-45305 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-45305?
CVE-2026-45305 is a security vulnerability in Symfony/yaml involving :cleanup() Regex under CWE-1333: Inefficient Regular Expression Complexity.
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-45305?
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-45305?
CVE-2026-45305 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check Packagist dependencies for CVE-2026-45305?
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-9frc-8383-795m",
  "modified" : "2026-05-27T21:34:36Z",
  "published" : "2026-05-27T21:34:35Z",
  "aliases" : [ "CVE-2026-45305" ],
  "summary" : "Symfony's YAML Parser has a ReDoS via Catastrophic Backtracking in Parser::cleanup() Regex",
  "details" : "### Description\n\n`Symfony\\Component\\Yaml\\Parser::cleanup()` strips the optional `%YAML` directive header, leading comments, and document start/end markers before parsing. The original regexes contained overlapping quantifiers, most notably `'#^%YAML[: ][\\d.]+.*\\n#u'`, whose `[\\d.]+` and `.*` overlap on the dot, that exhibit catastrophic backtracking on crafted input. A single oversized `%YAML` directive header (or comment / document-marker line) makes the parser hang for an arbitrarily long time, denying service.\n\n### Resolution\n\nThe four regexes in `Parser::cleanup()` (YAML directive header, leading comments, document-start marker, document-end marker) have been rewritten with possessive quantifiers and unambiguous character classes so backtracking cannot occur.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/9749cd43c5e09b3735093623670b21b9d8a056cb) 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-9frc-8383-795m"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/9749cd43c5e09b3735093623670b21b9d8a056cb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45305.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/yaml/CVE-2026-45305.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-45305"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-27T21:34:35Z",
    "nvd_published_at" : null
  }
}