CVE-2026-45065: Symfony/routing Symfony Has A UrlGenerator Route-Requirement Vulnerability

MODERATE
Advisory Identifier: GHSA-72xp-p242-47p9
CWE-601 CWE-185
Published
Advisory Summary

CVE-2026-45065 is a MODERATE symfony has a urlgenerator route-requirement vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Symfony/routing libraries in the Packagist ecosystem. The issue involves symfony has a urlgenerator route-requirement bypass via unanchored regex alternation → off-site //host url injection. Remediation is available by upgrading affected packages to version 5.4.52, 6.4.40, 7.4.12, 8.0.12.

CVE-2026-45065 at a Glance

CVE Identifier CVE-2026-45065
GHSA Identifier GHSA-72xp-p242-47p9
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Symfony/routing
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-45065

To remediate this vulnerability, upgrade all affected Symfony/routing 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/routing fixed: 5.4.52
Upgrade symfony/routing to 5.4.52
symfony/routing fixed: 6.4.40
Upgrade symfony/routing to 6.4.40
symfony/routing fixed: 7.4.12
Upgrade symfony/routing to 7.4.12
symfony/routing fixed: 8.0.12
Upgrade symfony/routing to 8.0.12
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
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/routing

How to Check if You Are Affected

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

inspect dependencies for symfony/routing

Analyze the terminal output to locate any version of Symfony/routing 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Symfony/routing, 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 routes can declare a requirements regex per path parameter, e.g. a route `/{_locale}/blog` with `requirements: { _locale: 'en|fr|de' }`. The Twig `path()` / `url()` helpers (backed by `UrlGenerator`) validate supplied parameter values against that regex before building the URL. UrlGenerator constructs the validation pattern as `'#^'.$req.'$#'`, where `$req` is the raw requirement string. For a requirement expressed as an alternation, e.g. `_locale: 'ar|bg|...|vi|...|zh_CN'` (very common), `^` and `$` anchor only the first and last alternatives, so any middle alternative matches as an unanchored substring. A value like `/evil.com` satisfies the requirement (because it contains `vi`), and the generated path becomes `//evil.com/...`: a protocol-relative URL the browser navigates off-site. ### Resolution The `UrlGenerator` class now wraps the requirement in a non-capturing group so the `^` and `$` anchors apply to the whole alternation. The patch for this issue is available [here](https://github.com/symfony/symfony/commit/bcf487c22f3240ba994124e0e0fe8616f3cfc47a) for branch 5.4. ### Credits Symfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.

CVE-2026-45065 Affected Symfony/routing Versions

8 component(s)
Fixed Versions:
5.4.526.4.407.4.128.0.12
Product / Package Ecosystem Affected Versions Fixed Version
symfony/routing
Packagist
< 5.4.52
5.4.52
symfony/routing
Packagist
≥ 6.0.0
< 6.4.40
6.4.40
symfony/routing
Packagist
≥ 7.0.0
< 7.4.12
7.4.12
symfony/routing
Packagist
≥ 8.0.0
< 8.0.12
8.0.12
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

References

Frequently Asked Questions

What is CVE-2026-45065?
CVE-2026-45065 is a security vulnerability in Symfony/routing involving Symfony has a UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL Injection under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Symfony/routing 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/routing, symfony/symfony.
What version fixes CVE-2026-45065?
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/routing affected?
Yes, symfony/routing 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-45065?
CVE-2026-45065 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Packagist dependencies for CVE-2026-45065?
Run the dependency tree command: 'inspect dependencies for symfony/routing'. 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-72xp-p242-47p9",
  "modified" : "2026-05-27T16:55:16Z",
  "published" : "2026-05-27T16:55:16Z",
  "aliases" : [ "CVE-2026-45065" ],
  "summary" : "Symfony has a UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL Injection",
  "details" : "### Description\n\nSymfony routes can declare a requirements regex per path parameter, e.g. a route `/{_locale}/blog` with `requirements: { _locale: 'en|fr|de' }`. The Twig `path()` / `url()` helpers (backed by `UrlGenerator`) validate supplied parameter values against that regex before building the URL.\n\nUrlGenerator constructs the validation pattern as `'#^'.$req.'$#'`, where `$req` is the raw requirement string. For a requirement expressed as an alternation, e.g. `_locale: 'ar|bg|...|vi|...|zh_CN'` (very common), `^` and `$` anchor only the first and last alternatives, so any middle alternative matches as an unanchored substring. A value like `/evil.com` satisfies the requirement (because it contains `vi`), and the generated path becomes `//evil.com/...`: a protocol-relative URL the browser navigates off-site.\n\n### Resolution\n\nThe `UrlGenerator` class now wraps the requirement in a non-capturing group so the `^` and `$` anchors apply to the whole alternation.\n\nThe patch for this issue is available [here](https://github.com/symfony/symfony/commit/bcf487c22f3240ba994124e0e0fe8616f3cfc47a) for branch 5.4.\n\n### Credits\n\nSymfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/routing"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.52"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/routing"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.40"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/routing"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.12"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/routing"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.12"
      } ]
    } ]
  }, {
    "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"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-72xp-p242-47p9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/bcf487c22f3240ba994124e0e0fe8616f3cfc47a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/routing/CVE-2026-45065.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45065.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://symfony.com/cve-2026-45065"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-185", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-27T16:55:16Z",
    "nvd_published_at" : null
  }
}