CVE-2026-135802 in http-foundation
Summary
by MITRE • 11/24/2026
When Request::getBaseUrl() does not find the script name at the start of the request URI, it looks for it further into the path. This supports web servers that rewrite every URL to a front controller in a subdirectory. The base URL then kept everything before the script name, and the client chooses that part. A request URI starting with // or /\ made the base URL start with a host.
With SCRIPT_NAME=/public/index.php, a request for //evil.example/public/index.php/login is routed to /login, with the base URL //evil.example/public/index.php and the base path //evil.example/public. The URLs generated for that page then point to evil.example: - links built with path() and the actions of forms, so a login form sends the credentials of the user to evil.example; - redirects to generated URLs, such as the ones of redirectToRoute(); - assets referenced with a relative path through asset(), so the page can load scripts from evil.example.
The attacker has to make a user follow a crafted link, such as https://app.example//evil.example/public/index.php/login. framework.trusted_hosts does not help, since the host of the request is the real one.
Applications are affected when their front controller is in a subdirectory and the web server sends it URIs that do not start with that directory. A .htaccess file at the root of the project that rewrites every URL to public/ does that, for instance.
Applications are also affected when the web server sets SCRIPT_NAME to the path of the request. Some nginx configurations do that when they send every request to the front controller without fastcgi_split_path_info. php -S does it too, with a router script outside the document root. A request for /\evil.example/index.php then gets the base URL /\evil.example/index.php, which browsers read as a link to evil.example.
The configurations recommended in the Symfony documentation are not affected.
Request::getBaseUrl() now returns an empty base URL when the request URI starts with // or /\.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/24/2026
This vulnerability represents a critical host header injection and open redirect flaw within web application frameworks that rely on dynamic base URL generation for routing, asset loading, and form submission. The core technical defect lies in how the Request object parses the script name from the request URI when it is not located at the very beginning of the path. In environments where web servers rewrite all URLs to a front controller situated in a subdirectory, such as /public/index.php, the framework attempts to determine the base URL by extracting everything preceding the script name. This logic fails catastrophically when the incoming request URI begins with double slashes (//) or a backslash followed by a slash (/). In these specific cases, the parsing algorithm incorrectly interprets the subsequent domain-like string as part of the path rather than recognizing it as an absolute URL component, causing the base URL to be constructed starting with //evil.example.
The operational impact of this flaw is severe because modern web applications rely heavily on dynamically generated URLs for security-critical operations. When the base URL is corrupted to point to a malicious domain such as evil.example, all relative links and assets embedded in the response are resolved against that attacker-controlled host. This includes hyperlinks constructed via path helpers, form action attributes which dictate where user credentials are submitted during login or data entry processes, and asset references for JavaScript and CSS files loaded through helper functions like asset(). Consequently, a victim user who follows a crafted link to the vulnerable application will have their browser load malicious scripts from evil.example. Furthermore, any redirects issued by the framework using generated routes will direct the user away from the legitimate site to the attacker's domain, facilitating phishing attacks or drive-by downloads.
The attack vector requires social engineering, as the victim must click a specially crafted URL that exploits the server-side rewriting configuration. For instance, an attacker might distribute a link such as https://app.example//evil.example/public/index.php/login. The web server processes this request and passes it to the front controller in /public/. Because the URI starts with //, the framework's logic identifies evil.example as part of the base path rather than ignoring it or treating it as an absolute URL scheme. This results in a base URL that effectively hijacks the domain context for all subsequent relative resource resolutions within that session. Standard security controls like trusted host configurations are ineffective against this specific vector because the HTTP Host header remains legitimate, pointing to app.example, while the internal path parsing logic is what introduces the vulnerability.
Several server and framework configurations exacerbate or trigger this issue. Applications using Apache with .htaccess rules that rewrite all traffic to a public subdirectory are susceptible if they do not properly normalize incoming URIs. Similarly, Nginx configurations that forward requests to PHP-FPM without utilizing fastcgi_split_path_info may set SCRIPT_NAME incorrectly, leading the framework to misinterpret the URI structure. Additionally, using PHP's built-in development server with a router script located outside the document root can also trigger this behavior when handling specific malformed URIs like /\evil.example/index.php. In these scenarios, browsers interpret the resulting base URL as an absolute link to evil.example due to standard HTML parsing rules regarding double slashes and backslashes in URLs.
To mitigate this vulnerability, framework maintainers have implemented a fix where Request::getBaseUrl() returns an empty string when the request URI starts with // or /. This prevents the injection of malicious hostnames into the base URL context. For application developers using affected versions, immediate updates to the patched framework version are required. In the interim, administrators should ensure that web server configurations strictly normalize URIs before passing them to the application layer. Implementing strict input validation on incoming request paths and ensuring that front controllers do not accept arbitrary path prefixes can also help reduce exposure. It is crucial to verify that trusted host lists alone are insufficient for defense against this specific class of parsing errors, as the vulnerability operates at the URL construction level rather than the connection verification level.