Skip to main content

Symfony Routing CVE-2026-45065

MEDIUM
Incorrect Regular Expression (CWE-185)
2026-05-27 https://github.com/symfony/symfony GHSA-72xp-p242-47p9
Share

Lifecycle Timeline

2
Source Code Evidence Fetched
May 27, 2026 - 21:23 vuln.today
Analysis Generated
May 27, 2026 - 21:23 vuln.today

DescriptionNVD

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

Credits

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

AnalysisAI

Protocol-relative URL injection in Symfony's UrlGenerator allows open redirect via regex alternation bypass in route parameter validation. When route requirements use alternation patterns (e.g., _locale: 'en|fr|vi|de'), the validation regex #^REQUIREMENT$# fails to anchor middle alternatives due to regex operator precedence, enabling substring matching against attacker-supplied values. …

Sign in for full analysis, threat intelligence, and remediation guidance.

Share

CVE-2026-45065 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy