{"id":"CVE-2026-45065","aliases":["GHSA-72xp-p242-47p9"],"url":"https://o3.security/vulnerability/CVE-2026-45065","summary":"Symfony: 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.","published":"2026-07-14T17:43:45.644Z","modified":"2026-08-12T03:51:21.037888274Z","cvss":null,"epss":{"score":0.00348,"percentile":0.28336,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"5.4.52"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"8.0.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"5.4.52"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.40"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.12"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.0.12"}],"fix":{"url":"https://github.com/symfony/symfony/commit/bcf487c22f3240ba994124e0e0fe8616f3cfc47a","label":"symfony/symfony@bcf487c"},"references":[{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v5.4.52"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.40"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.12"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.0.12"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/45xxx/CVE-2026-45065.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-72xp-p242-47p9"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45065"},{"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"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:21.037888274Z"}}