Symfony: Inline Fragments Let Untrusted Forwarded Headers Set the Host, Scheme and Port of the URLs Generated for the Main Request
- CVE-2026-123339
- GHSA-wg5q-m2ww-f3c9
- EUVD-2026-118273
Description
Show the whole descriptionHide the whole description
Improper trust of forwarded headers in RouterListener::onKernelFinishRequest() in Symfony HttpKernel 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 allows a remote attacker to control the host, scheme, and port of absolute URLs generated for the rest of the request, poisoning links in pages stored by a shared cache and in e-mails sent after the page was rendered.When a page renders an inline fragment (render() in Twig, or an ESI tag rendered inline), SubRequestHandler temporarily adds 127.0.0.1 to the trusted proxies, and RouterListener rebuilds the router context from the main request while that trust is still active, so the X-Forwarded-* and Forwarded headers of a request whose client address is 127.0.0.1 are trusted even though that address is not a configured 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, including URLs produced by url() in Twig and by UrlGeneratorInterface::ABSOLUTE_URL. Applications are affected when they are reached over HTTP from 127.0.0.1, for example behind a TLS terminator, reverse proxy, local HTTP cache, or sidecar proxy on the same host, and that proxy passes the client’s forwarded headers along. With the default configuration (framework.trusted_proxies unset), all forwarded headers, including X-Forwarded-Host, are trusted during that window. Applications served through php-fpm, mod_php, or a proxy on another host are not affected. When framework.trusted_hosts is configured, a forwarded host outside the list is rejected, but the scheme and port can still be changed.
Text from the CVE.org record.
Recommendation
symfony
- If you run a version from 8.0.0 to before 8.1.11update to 8.1.11 or laterMinor version change: check the release notes
- If you run a version from 7.0.0 to before 7.4.23update to 7.4.23 or laterMinor version change: check the release notes
- If you run a version from 6.0.0 to before 6.4.50update to 6.4.50 or laterMinor version change: check the release notes
- If you run a version before 5.4.56update to 5.4.56 or later
symfony/http-kernel
- If you run a version from 8.0.0 to before 8.1.11update to 8.1.11 or laterMinor version change: check the release notessymfony/http-kernel 8.1.11 on its registry (opens in a new tab)
- If you run a version from 7.0.0 to before 7.4.23update to 7.4.23 or laterMinor version change: check the release notessymfony/http-kernel 7.4.23 on its registry (opens in a new tab)
- If you run a version from 6.0.0 to before 6.4.50update to 6.4.50 or laterMinor version change: check the release notessymfony/http-kernel 6.4.50 on its registry (opens in a new tab)
- If you run a version before 5.4.56update to 5.4.56 or latersymfony/http-kernel 5.4.56 on its registry (opens in a new tab)
symfony/symfony
- If you run a version from 8.0.0 to before 8.1.11update to 8.1.11 or laterMinor version change: check the release notessymfony/symfony 8.1.11 on its registry (opens in a new tab)
- If you run a version from 7.0.0 to before 7.4.23update to 7.4.23 or laterMinor version change: check the release notessymfony/symfony 7.4.23 on its registry (opens in a new tab)
- If you run a version from 6.0.0 to before 6.4.50update to 6.4.50 or laterMinor version change: check the release notessymfony/symfony 6.4.50 on its registry (opens in a new tab)
- If you run a version before 5.4.56update to 5.4.56 or latersymfony/symfony 5.4.56 on its registry (opens in a new tab)
Taken from the version ranges the sources state. Check the vendor advisory: nothing is said about versions the ranges do not list. Breaking-change risk is read from the version numbers only.
Affected
symfony
Affected versions Fixed in from 8.0.0 to before 8.1.11 8.1.11 from 7.0.0 to before 7.4.23 7.4.23 from 6.0.0 to before 6.4.50 6.4.50 before 5.4.56 5.4.56 symfony/http-kernelPackagist
Affected versions Fixed in from 8.0.0 to before 8.1.11 8.1.11 from 7.0.0 to before 7.4.23 7.4.23 from 6.0.0 to before 6.4.50 6.4.50 before 5.4.56 5.4.56 symfony/symfonyPackagist
Affected versions Fixed in from 8.0.0 to before 8.1.11 8.1.11 from 7.0.0 to before 7.4.23 7.4.23 from 6.0.0 to before 6.4.50 6.4.50 before 5.4.56 5.4.56
Product versions from the ENISA EUVD record.
Timeline
- Published
Related news
No article from the followed outlets names this vulnerability.