LowGHSA-wg5q-m2ww-f3c9CVE-2026-123339

Symfony: Inline Fragments Let Untrusted Forwarded Headers Set the Host, Scheme and Port of the URLs Generated for the Main Request

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/http-kernel:^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/http-kernel:^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/http-kernel:^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/http-kernel:^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/http-kernel does your project really install?

Drop your composer.lock hereWe find the exact symfony/http-kernel 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

When a page renders an inline fragment, with render() in Twig or with an ESI tag rendered inline because no gateway cache is used, SubRequestHandler adds 127.0.0.1 to the trusted proxies while the sub-request runs, with the trusted header set of the application, so that the internal sub-request is trusted. RouterListener::onKernelFinishRequest() runs inside that window: when the sub-request finishes, it rebuilds the router's RequestContext from the main request with RequestContext::fromRequest(). If the main request itself came from 127.0.0.1, its X-Forwarded-* and Forwarded headers are then trusted, although the application never declared 127.0.0.1 a trusted proxy.

From that point on, every absolute URL the router generates for the rest of the main request takes its host, scheme and port from headers sent by the client: url() in Twig, UrlGeneratorInterface::ABSOLUTE_URL, links in a page that a shared cache stores, or in an e-mail sent after the page was rendered.

This affects applications reached over HTTP from 127.0.0.1 without that address being a trusted proxy, for instance behind a TLS terminator or a reverse proxy running on the same host in front of an application server, behind a local HTTP cache, or behind a sidecar proxy. When framework.trusted_proxies is not configured, which is the default, every forwarded header is trusted during that window, X-Forwarded-Host included, and a web server or proxy that only accepts known hosts does not help, since the host comes from that header. Applications served through php-fpm, mod_php, or a proxy running on another host are not affected, since REMOTE_ADDR is not 127.0.0.1 there. When framework.trusted_hosts is configured, a forwarded host outside of the list is rejected, but the scheme and the port can still be changed.

Resolution

RouterListener now saves the router context of the parent request when a sub-request starts, and restores it when the sub-request finishes, instead of computing it again from the parent request while the trusted proxies of the sub-request still apply to it. URLs generated after an inline fragment are built from the same context as before it.

Code that reads the main request while the sub-request itself runs, such as Request::getClientIp() in a listener of that sub-request, still sees 127.0.0.1 trusted. Applications running behind a proxy on 127.0.0.1 should have that proxy set the forwarded headers itself instead of passing the client's along, and configure framework.trusted_hosts.

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 Nicolas Grekas for reporting the issue and providing the fix.

Is GHSA-wg5q-m2ww-f3c9 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/http-kernel, and gives you the command that fixes it.

More advisories for symfony/http-kernel

  • HighCVE-2026-45075Symfony's HEAD Request Bypasses methods: ['GET'] Filter in #[IsGranted] / #[IsSignatureValid] / #[IsCsrfTokenValid] · 27 May 2026
  • HighCVE-2014-5245Symfony allows direct access of ESI URLs behind a trusted proxy · 30 May 2024
  • MediumCVE-2022-24894Symfony storing cookie headers in HttpCache · 1 Feb 2023
  • MediumCVE-2015-2308Symfony Vulnerable to PHP Eval Injection · 17 May 2022
  • MediumCVE-2015-4050Symfony Incorrect Access Control · 17 May 2022
  • HighCVE-2019-18887Symfony Http-Kernel has non-constant time comparison in UriSigner · 26 Mar 2022
All 9 advisories for symfony/http-kernel

References

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