CVE-2026-123339

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

Published Nov 6, 2026 CVSS 4.0 · 2.3 Low EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability arises from improper trust of X‑Forwarded‑* and Forwarded headers within RouterListener::onKernelFinishRequest. When an inline fragment or ESI tag triggers a sub‑request, Symfony temporarily trusts the client IP 127.0.0.1, allowing an attacker to supply forged forwarded headers that set the host, scheme and port used to build absolute URLs. These manipulated URLs are inserted into rendered pages and cached responses, and they can also appear in e‑mail notifications, leading to link poisoning and potential phishing attacks.

Affected Systems

Affected vendors: Sensiolabs Symfony. Versions subject to this flaw include any releases before 5.4.56, 6.4.50, 7.4.23 or 8.1.11. A typical vulnerable deployment is one where the application is reached over HTTP from localhost, such as behind a TLS terminator, reverse proxy, local HTTP cache or sidecar, and that proxy forwards client‑supplied forwarded headers. Configurations that leave framework.trusted_proxies unset trust all forwarded headers by default during the sub‑request window. Use of framework.trusted_hosts mitigates host spoofing but does not prevent scheme or port changes.

Risk and Exploitability

Threat rating is low with a CVSS base score of 2.3, and no EPSS information is available. The vulnerability is not listed in CISA KEV, indicating no publicly known exploit at the time of assessment. Exploitation requires a specific configuration where Symfony trusts requests from 127.0.0.1 and receives forged forwarded headers. While the window is narrow, an attacker who controls a proxy on the same host can manipulate generated links, possibly deceiving users who retrieve cached or emailed content. The overall risk is low to moderate, but patching remains prudent.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Symfony to version 5.4.56 or later, 6.4.50 or later, 7.4.23 or later, or 8.1.11 or later.
  • Configure framework.trusted_proxies to include only the actual proxy IPs and avoid 127.0.0.1 or any untrusted IPs.
  • Add expected host patterns to framework.trusted_hosts to reject spoofed host headers while allowing legitimate forwarded headers.
  • If a patch cannot be applied immediately, avoid serving the application over HTTP from localhost and ensure that any reverse proxy sanitizes forwarded headers before passing requests to Symfony.

Generated by OpenCVE AI on November 6, 2026 at 15:32 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
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.
Title Symfony: Inline Fragments Let Untrusted Forwarded Headers Set the Host, Scheme and Port of the URLs Generated for the Main Request
First Time appeared Sensiolabs
Sensiolabs symfony
Weaknesses CWE-348
CPEs cpe:2.3:a:sensiolabs:symfony:*:*:*:*:*:*:*:*
Vendors & Products Sensiolabs
Sensiolabs symfony
References
Metrics cvssV4_0

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

Weaknesses
  • CWE-348

    Use of Less Trusted Source

Sources

Status
PUBLISHED
Assigner
Checkmarx
Published
Updated
Nov 6, 2026, 3:21 PM
Reserved
Nov 5, 2026, 6:43 PM
Status
Awaiting Analysis
Published
Nov 6, 2026, 3:17 PM
Modified
Nov 6, 2026, 9:40 PM