{"id":"CVE-2026-118516","aliases":["GHSA-xqw3-x93m-887x"],"url":"https://o3.security/vulnerability/CVE-2026-118516","summary":"Symfony: Host Placeholders Can Match the Start of the Path in Compiled URL Matchers, Bypassing Path-Based Access Control","details":"### Description\n\nFor routes that have a host, `CompiledUrlMatcher` matches the string `$host.'.'.$pathinfo` against the host regexp followed by the path regexp. A host placeholder could match `/`, so it could eat the start of the path, while `UrlMatcher` matches the host and the path separately and finds no route. Rules that look at the path, such as `access_control` entries and the `pattern` of firewalls, judge the real path, so they do not apply, while the controller of the route runs.\n\nWith the route `/admin/report/{id}`, the host `app.{domain}` and `access_control: [{ path: ^/admin, roles: ROLE_ADMIN }]`, an anonymous request for `/admin/report/1` is sent to the login page, while one with the host `app` and the path `/x./admin/report/1` reaches the controller, with `domain=\"/x\"`. With the requirement `domain: .+`, the real host name works: `app.example.com` and `/x./admin/report/1` match with `domain=\"example.com./x\"`.\n\nApplications are affected when they have routes with host placeholders protected by path-based rules. With the default requirement, the `Host` must be the host of the route without its last labels, such as `app`: `framework.trusted_hosts` blocks that, while a web server that only serves known names may not, for instance nginx passing the raw `Host` header to FastCGI for a request line that carries an absolute URI. With a requirement that accepts `/`, such as `.+`, the real host name works and `trusted_hosts` does not help.\n\n### Resolution\n\nThe compiled regexp now captures the path ahead of each host alternative that has placeholders, and checks after the host regexp that the rest of the subject is that path. Since a host cannot contain `/`, the path starts at the first `/`, and host placeholders can no longer match any part of it, whatever their requirements. Valid requests keep the same route and the same parameters, as verified against `UrlMatcher` over eleven million generated cases.\n\nThe fix is in the dumper, so an application keeps its vulnerable compiled routes until its cache is cleared. Clear the cache after upgrading.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/067cde51e29f6d605de4de53322a02c6e23b5416) for branch 5.4 (and forward-ported to 6.4, 7.4, 8.1 and 8.2).\n\n### Credits\n\nSymfony would like to thank Vincent Cassiau (CyberVanguard) for reporting the issue and Nicolas Grekas for providing the fix.\n\nSymfony would also like to thank [Bruno Dias](https://github.com/cx-bruno-dias) and [Ana Lisboa](https://github.com/cx-ana-lisboa) from Checkmarx for their help getting a CVE assigned.","published":"2026-11-04T12:33:08.482Z","modified":"2026-11-11T02:30:44.152068275Z","cvss":null,"epss":{"score":0.00472,"percentile":0.42427,"asOf":"2026-12-01"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"5.4.56"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"6.4.50"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"7.4.23"},{"ecosystem":"Packagist","name":"symfony/routing","fixedVersion":"8.1.11"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"5.4.56"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"6.4.50"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"7.4.23"},{"ecosystem":"Packagist","name":"symfony/symfony","fixedVersion":"8.1.11"}],"fix":{"url":"https://github.com/symfony/symfony/commit/067cde51e29f6d605de4de53322a02c6e23b5416","label":"symfony/symfony@067cde5"},"references":[{"type":"WEB","url":"https://packagist.org/packages/symfony/routing"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/118xxx/CVE-2026-118516.json"},{"type":"ADVISORY","url":"https://github.com/symfony/symfony/security/advisories/GHSA-xqw3-x93m-887x"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118516"},{"type":"FIX","url":"https://github.com/symfony/symfony/commit/067cde51e29f6d605de4de53322a02c6e23b5416"},{"type":"PACKAGE","url":"https://github.com/symfony/routing"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/routing/CVE-2026-118516.yaml"},{"type":"WEB","url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-118516.yaml"},{"type":"PACKAGE","url":"https://github.com/symfony/symfony"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v5.4.56"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v6.4.50"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v7.4.23"},{"type":"WEB","url":"https://github.com/symfony/symfony/releases/tag/v8.1.11"},{"type":"WEB","url":"https://symfony.com/cve-2026-118516"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-11T02:30:44.152068275Z"}}