MediumGHSA-xqw3-x93m-887xCVE-2026-118516

Symfony: Host Placeholders Can Match the Start of the Path in Compiled URL Matchers, Bypassing Path-Based Access Control

Published 1 Dec 2026 · Updated 1 Dec 2026

Affected packages

Affected
<5.4.56
Fixed in
5.4.56
Update to the fixed version for your release line, for example:composer require symfony/routing:^5.4.56
Affected
>=6.0.0 <6.4.50
Fixed in
6.4.50
Update to the fixed version for your release line, for example:composer require symfony/routing:^6.4.50
Affected
>=7.0.0 <7.4.23
Fixed in
7.4.23
Update to the fixed version for your release line, for example:composer require symfony/routing:^7.4.23
Affected
>=8.0.0 <8.1.11
Fixed in
8.1.11
Update to the fixed version for your release line, for example:composer require symfony/routing:^8.1.11
Affected
<5.4.56
Fixed in
5.4.56
Update to the fixed version for your release line, for example:composer require symfony/symfony:^5.4.56
Affected
>=6.0.0 <6.4.50
Fixed in
6.4.50
Update to the fixed version for your release line, for example:composer require symfony/symfony:^6.4.50
Affected
>=7.0.0 <7.4.23
Fixed in
7.4.23
Update to the fixed version for your release line, for example:composer require symfony/symfony:^7.4.23
Affected
>=8.0.0 <8.1.11
Fixed in
8.1.11
Update to the fixed version for your release line, for example:composer require symfony/symfony:^8.1.11

We confirm your address first. See our privacy policy.

Which symfony/routing does your project really install?

Drop your composer.lock hereWe find the exact symfony/routing version you install, even when another package pulls it in, and tell you if it’s affected and what to run. Free, no sign-up.

Works for private projects: the file is read in memory to run the scan and then dropped. Also reads composer.json.

Public repo?

Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Details

Description

For 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.

With 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".

Applications 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.

Resolution

The 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.

The fix is in the dumper, so an application keeps its vulnerable compiled routes until its cache is cleared. Clear the cache after upgrading.

The patches for this issue are available here for branch 5.4 (and forward-ported to 6.4, 7.4, 8.1 and 8.2).

Credits

Symfony would like to thank Vincent Cassiau (CyberVanguard) for reporting the issue and Nicolas Grekas for providing the fix.

Symfony would also like to thank Bruno Dias and Ana Lisboa from Checkmarx for their help getting a CVE assigned.

Is GHSA-xqw3-x93m-887x in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected symfony/routing, and gives you the command that fixes it.

More advisories for symfony/routing

  • MediumCVE-2026-48784Symfony: UrlGenerator Dot-Segment Encoding Skips Every Other Chained `../` or `./` → Generated URL Collapses Off-Route Under RFC 3986 Normalization · 15 Jun 2026
  • MediumCVE-2026-45065Symfony has a UrlGenerator Route-Requirement Bypass via Unanchored Regex Alternation → Off-Site //host URL Injection · 27 May 2026
  • HighGHSA-rjpm-qmq7-q85wSymfony XXE security vulnerability · 30 May 2024
  • MediumCVE-2012-6431Symfony Allows URI Restrictions Bypass Via Double-Encoded String · 17 May 2022
symfony/routing security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.