CVE-2026-118516

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

Published Nov 4, 2026 CVSS 4.0 · 6.3 Medium EPSS < 1% KEV · Not listed
Description
The Symfony Routing components CompiledUrlMatcher and UrlMatcher interpret the host and path information differently, allowing path-based authorization rules to be bypassed in Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11.




For routes that define a host, CompiledUrlMatcher matches the string $host.'.'.$pathinfo against the host regular expression followed by the path regular expression, while UrlMatcher matches the host and the path separately. A host placeholder can therefore  match /, and consume the beginning of the path, so the request is routed to a controller, while UrlMatcher  would find no route. Rules that look at the path, such as access_control entries and firewall patterns, are evaluated against the actual request path, so they do not apply while the controller of the route runs, potentially allowing an unauthenticated request to reach a protected controller. For example, with the route /admin/report/{id}, the host app.{domain} and the rule access_control: [{ path: ^/admin, roles: ROLE_ADMIN }], an anonymous request for /admin/report/1 is sent to the login page. A request with the Host header app and path /x./admin/report/1 instead reaches the controller, with domain="/x". With the required domain: .+, the real hostname works: app.example.com and /x./admin/report/1 match with domain="example.com./x".




Applications are affected if they have routes with host placeholders protected by path-based rules. With the default requirement, the Host header 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. If the requirement accepts /, such as .+, a real hostname works, and trusted_hosts does not help.

Analysis

AI-generated

Technical impact

Classes within Symfony's Routing component, namely CompiledUrlMatcher and UrlMatcher, handle host and path differently. The CompiledUrlMatcher concatenates the host and path before applying regular expressions, whereas UrlMatcher separates them. A host placeholder that can match a forward slash causes parts of the path to be consumed during host matching. As a result, requests that should be blocked by path‑based authorization rules are routed directly to the controller, allowing unauthenticated or unauthorized users to invoke protected actions. This is an intentional access control flaw, catalogued as improper authorization handling and improper access control.

Affected Systems

The flaw exists in Symfony versions prior to 5.4.56, 6.4.50, 7.4.23 and 8.1.11 when routes declare host placeholders that are protected by path‑based firewall or access_control rules. Applications built with the sensiolabs Symfony framework that use such routes are susceptible. The default restriction that the Host header matches the host without its leaf label may mitigate the issue if configured, but it is unsafe when the requirement accepts a simple slash or when the web server forwards an absolute URI.

Risk and Exploitability

The CVSS score of 6.3 indicates a moderate risk. The EPSS score is < 1%, indicating a very low probability of exploitation. Attackers who can send crafted HTTP requests can exploit the vulnerability. By sending a request with a Host header that contains a slash in the placeholder part and a path that matches a protected route, an attacker bypasses access_control entries and reaches the controller directly. The vulnerability is not listed in the CISA KEV catalog, but the potential for unauthorized access makes monitoring or patching advisable.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Symfony to version 5.4.56 or later, 6.4.50 or later, 7.4.23 or later, or 8.1.11 or later.
  • Adjust routes so that host placeholders do not match a forward slash and are not protected by path‑based rules, or remove host placeholders altogether.
  • Configure framework.trusted_hosts to reject host headers that contain a slash or do not match the route host, and ensure the web server does not forward absolute URIs that bypass Symfony's host filtering.

Generated by OpenCVE AI on November 6, 2026 at 01:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-551
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Description The Symfony Routing components CompiledUrlMatcher and UrlMatcher interpret the host and path information differently, allowing path-based authorization rules to be bypassed in Symfony versions prior to 5.4.56, 6.x prior to 6.4.50, 7.x prior to 7.4.23, and 8.x prior to 8.1.11. For routes that define a host, CompiledUrlMatcher matches the string $host.'.'.$pathinfo against the host regular expression followed by the path regular expression, while UrlMatcher matches the host and the path separately. A host placeholder can therefore  match /, and consume the beginning of the path, so the request is routed to a controller, while UrlMatcher  would find no route. Rules that look at the path, such as access_control entries and firewall patterns, are evaluated against the actual request path, so they do not apply while the controller of the route runs, potentially allowing an unauthenticated request to reach a protected controller. For example, with the route /admin/report/{id}, the host app.{domain} and the rule access_control: [{ path: ^/admin, roles: ROLE_ADMIN }], an anonymous request for /admin/report/1 is sent to the login page. A request with the Host header app and path /x./admin/report/1 instead reaches the controller, with domain="/x". With the required domain: .+, the real hostname works: app.example.com and /x./admin/report/1 match with domain="example.com./x". Applications are affected if they have routes with host placeholders protected by path-based rules. With the default requirement, the Host header 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. If the requirement accepts /, such as .+, a real hostname works, and trusted_hosts does not help.
Title Symfony: Host Placeholders Can Match the Start of the Path in Compiled URL Matchers, Bypassing Path-Based Access Control
First Time appeared Sensiolabs
Sensiolabs symfony
Weaknesses CWE-436
CWE-863
CPEs cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*
Vendors & Products Sensiolabs
Sensiolabs symfony
References
Metrics cvssV4_0

{'score': 6.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-436

    Interpretation Conflict

  • CWE-551

    Incorrect Behavior Order: Authorization Before Parsing and Canonicalization

  • CWE-863

    Incorrect Authorization

Sources

Status
PUBLISHED
Assigner
Checkmarx
Published
Updated
Nov 9, 2026, 9:13 PM
Reserved
Oct 28, 2026, 2:33 PM
Status
Awaiting Analysis
Published
Nov 4, 2026, 1:17 PM
Modified
Nov 9, 2026, 10:18 PM
Severity
Moderate
Public date
Nov 4, 2026, 12:33 PM