CVE-2026-123339: Symfony Inline Fragments Let Untrusted Forwarded Vulnerability

LOW
Advisory Identifier: GHSA-wg5q-m2ww-f3c9
CWE-348
Published
Advisory Summary

CVE-2026-123339 is a LOW inline fragments let untrusted forwarded vulnerability (CWE-348: Use of Less Trusted Source) affecting Symfony libraries in the Packagist ecosystem. The issue involves inline fragments let untrusted forwarded headers set the host, scheme and port of the urls generated for the main request. Remediation is available by upgrading affected packages to version 5.4.56, 6.4.50, 7.4.23, 8.1.11.

CVE-2026-123339 at a Glance

CVE Identifier CVE-2026-123339
GHSA Identifier GHSA-wg5q-m2ww-f3c9
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-348: Use of Less Trusted Source
Affected Product Symfony
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-123339

To remediate this vulnerability, upgrade all affected Symfony dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

symfony/http-kernel fixed: 5.4.56
Upgrade symfony/http-kernel to 5.4.56
symfony/http-kernel fixed: 6.4.50
Upgrade symfony/http-kernel to 6.4.50
symfony/http-kernel fixed: 7.4.23
Upgrade symfony/http-kernel to 7.4.23
symfony/http-kernel fixed: 8.1.11
Upgrade symfony/http-kernel to 8.1.11
symfony/symfony fixed: 5.4.56
Upgrade symfony/symfony to 5.4.56
symfony/symfony fixed: 6.4.50
Upgrade symfony/symfony to 6.4.50
symfony/symfony fixed: 7.4.23
Upgrade symfony/symfony to 7.4.23
symfony/symfony fixed: 8.1.11
Upgrade symfony/symfony to 8.1.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for symfony/http-kernel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-123339, inspect your project dependencies for Symfony:

inspect dependencies for symfony/http-kernel

Analyze the terminal output to locate any version of Symfony in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.56), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-348: Use of Less Trusted Source, where the product has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack. In Symfony, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://github.com/symfony/symfony/commit/4b4e683b2c280083c6758bb776af952076add612) 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.

CVE-2026-123339 Affected Symfony Versions

8 component(s)
Fixed Versions:
5.4.566.4.507.4.238.1.11
Product / Package Ecosystem Affected Versions Fixed Version
symfony/http-kernel
Packagist
< 5.4.56
5.4.56
symfony/http-kernel
Packagist
≥ 6.0.0
< 6.4.50
6.4.50
symfony/http-kernel
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/http-kernel
Packagist
≥ 8.0.0
< 8.1.11
8.1.11
symfony/symfony
Packagist
< 5.4.56
5.4.56
symfony/symfony
Packagist
≥ 6.0.0
< 6.4.50
6.4.50
symfony/symfony
Packagist
≥ 7.0.0
< 7.4.23
7.4.23
symfony/symfony
Packagist
≥ 8.0.0
< 8.1.11
8.1.11

References

Frequently Asked Questions

What is CVE-2026-123339?
CVE-2026-123339 is a security vulnerability in Symfony involving Inline Fragments Let Untrusted Forwarded Headers Set the Host, Scheme and Port of the URLs Generated for the Main Request under CWE-348: Use of Less Trusted Source.
Which Symfony versions are affected?
Affected versions include releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11 across affected packages: symfony/http-kernel, symfony/symfony.
What version fixes CVE-2026-123339?
Upgrading to 5.4.56, 6.4.50, 7.4.23, 8.1.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is symfony/http-kernel affected?
Yes, symfony/http-kernel is affected in releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 5.4.56, 6.4.50, 7.4.23, 8.1.11 or later.
Is symfony/symfony affected?
Yes, symfony/symfony is affected in releases prior to 5.4.56, 6.4.50, 7.4.23, 8.1.11. Upgrade your dependency to 5.4.56, 6.4.50, 7.4.23, 8.1.11 or later.
What CWE is associated with CVE-2026-123339?
CVE-2026-123339 is classified under CWE-348: Use of Less Trusted Source (The product has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.).
How can I check Packagist dependencies for CVE-2026-123339?
Run the dependency tree command: 'inspect dependencies for symfony/http-kernel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wg5q-m2ww-f3c9",
  "modified" : "2026-12-01T21:22:19Z",
  "published" : "2026-12-01T21:22:18Z",
  "aliases" : [ "CVE-2026-123339" ],
  "summary" : "Symfony: Inline Fragments Let Untrusted Forwarded Headers Set the Host, Scheme and Port of the URLs Generated for the Main Request",
  "details" : "### Description\n\nWhen 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.\n\nFrom 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.\n\nThis 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.\n\n### Resolution\n\n`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.\n\nCode 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`.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/4b4e683b2c280083c6758bb776af952076add612) for branch 5.4 (and forward-ported to 6.4, 7.4, 8.1 and 8.2).\n\n### Credits\n\nSymfony would like to thank Nicolas Grekas for reporting the issue and providing the fix.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.56"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/http-kernel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.4.56"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.4.50"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.23"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "symfony/symfony"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.1.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/security/advisories/GHSA-wg5q-m2ww-f3c9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-123339"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/commit/4b4e683b2c280083c6758bb776af952076add612"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-kernel/CVE-2026-123339.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-123339.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/symfony/symfony"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v5.4.56"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v6.4.50"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v7.4.23"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/symfony/symfony/releases/tag/v8.1.11"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-348" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T21:22:18Z",
    "nvd_published_at" : "2026-11-06T15:17:17Z"
  }
}