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

Published May 27, 2026
·
Updated

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|...|zhCN' (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 for branch 5.4.

Credits

Symfony would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.

Other sources

Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to 5.4.52, 6.4.40, 7.4.12, and 8.0.12, UrlGenerator validates route parameters against a pattern built as ^ plus the raw requirement plus $; with ungrouped alternations, middle alternatives match as unanchored substrings, allowing a value such as //evil.com to satisfy a common locale requirement and generate a protocol-relative off-site URL. This issue is fixed in versions 5.4.52, 6.4.40, 7.4.12, and 8.0.12.

MITRE

Affected Software

12 affected componentsFixes available
composer/symfony/symfony>=8.0.0<8.0.12
8.0.12
composer/symfony/symfony>=7.0.0<7.4.12
7.4.12
composer/symfony/symfony>=6.0.0<6.4.40
6.4.40
composer/symfony/symfony<5.4.52
5.4.52
composer/symfony/routing>=8.0.0<8.0.12
8.0.12
composer/symfony/routing>=7.0.0<7.4.12
7.4.12
composer/symfony/routing>=6.0.0<6.4.40
6.4.40
composer/symfony/routing<5.4.52
5.4.52
SensioLabs Symfony<5.4.52
SensioLabs Symfony>=6.0.0<6.4.40
SensioLabs Symfony>=7.0.0<7.4.12
SensioLabs Symfony>=8.0.0<8.0.12

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 8.0.12
  2. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 7.4.12
  3. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 6.4.40
  4. Upgrade

    Upgrade composer/symfony/symfony to a version that resolves this vulnerability.

    Fixed in 5.4.52
  5. Upgrade

    Upgrade composer/symfony/routing to a version that resolves this vulnerability.

    Fixed in 8.0.12
  6. Upgrade

    Upgrade composer/symfony/routing to a version that resolves this vulnerability.

    Fixed in 7.4.12
  7. Upgrade

    Upgrade composer/symfony/routing to a version that resolves this vulnerability.

    Fixed in 6.4.40
  8. Upgrade

    Upgrade composer/symfony/routing to a version that resolves this vulnerability.

    Fixed in 5.4.52
  9. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 5.4.52Patch bcf487c22f3240ba994124e0e0fe8616f3cfc47a
  10. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 6.4.40
  11. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 7.4.12
  12. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.0.12
  13. Compensating control

    Review any Symfony route parameters that use a regex requirement with ungrouped alternation (e.g., a very common _locale pattern like 'ar|bg|...|vi|...|zh_CN') and ensure the requirement is structured so anchors apply to the whole alternation.

Event History

May 27, 2026
Advisory Published
via GitHub·04:55 PM
Data Sourced
via GitHub·04:55 PM
DescriptionWeaknessAffected Software
Jul 14, 2026
CVE Published
via MITRE·05:43 PM
Data Sourced
via MITRE·05:43 PM
DescriptionWeakness
Data Sourced
via NVD·06:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-45065?

The severity level of CVE-2026-45065 is rated at 35.

2

How do I fix CVE-2026-45065?

To fix CVE-2026-45065, ensure your Symfony installation is updated to the latest version that addresses this vulnerability.

3

What impact does CVE-2026-45065 have on Symfony applications?

CVE-2026-45065 can allow attackers to bypass route parameter validation, potentially leading to unauthorized access or exposure of sensitive information.

4

In which Symfony components is CVE-2026-45065 present?

CVE-2026-45065 affects the Symfony routing component, particularly the path parameter validation through the Twig path() and url() helpers.

5

When was CVE-2026-45065 published?

CVE-2026-45065 was published on May 27, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203