Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. symfony/routing
  4. ›
  5. CVE-2026-45065

CVE-2026-45065: Symfony has a UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL Injection

May 27, 2026

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.

References

  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/routing/CVE-2026-45065.yaml
  • github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-45065.yaml
  • github.com/advisories/GHSA-72xp-p242-47p9
  • github.com/symfony/symfony/commit/bcf487c22f3240ba994124e0e0fe8616f3cfc47a
  • github.com/symfony/symfony/security/advisories/GHSA-72xp-p242-47p9
  • nvd.nist.gov/vuln/detail/CVE-2026-45065
  • symfony.com/cve-2026-45065

Code Behaviors & Features

Detect and mitigate CVE-2026-45065 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.4.52, all versions starting from 6.0.0 before 6.4.40, all versions starting from 7.0.0 before 7.4.12, all versions starting from 8.0.0 before 8.0.12

Fixed versions

  • 5.4.52
  • 6.4.40
  • 7.4.12
  • 8.0.12

Solution

Upgrade to versions 5.4.52, 6.4.40, 7.4.12, 8.0.12 or above.

Weakness

  • CWE-185: Incorrect Regular Expression
  • CWE-601: URL Redirection to Untrusted Site ('Open Redirect')

Source file

packagist/symfony/routing/CVE-2026-45065.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 23 Jun 2026 12:24:24 +0000.