Symfony: UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL Injection
symfony
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| symfony/routing Packagist |
|
|
symfony
| Product | Affected | Fixed in |
|---|---|---|
| symfony/routing Packagist |
|
|
| symfony/symfony Packagist |
|
|
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.
From the CVE record · GitHub_M
Symfony UrlGenerator can incorrectly validate route parameters when a requirement contains ungrouped alternations. A crafted value such as //evil.com can then pass validation and produce a protocol-relative off-site URL. The input does not specify whether authentication or user interaction is required.
Teams using affected versions of the Packagist packages symfony/routing or symfony/symfony should check their installations: versions below 5.4.52, 6.0.0–6.4.39, 7.0.0–7.4.11, or 8.0.0–8.0.11.