---
id: "CVE-2026-121971"
kind: "vulnerability"
aliases: ["CVE-2026-121971"]
title: "Symfony HttpClient: relative URLs can leak bearer and basic credentials to other hosts"
severity: "high"
cvss: 8.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["http-client", "package", "php", "scoped-clients", "symfony"]
not_affected_if: ["fixed-urls-only", "no-scoped-credentials", "patched-version"]
published_at: "2026-11-04T18:17:43+00:00"
first_seen_at: "2026-11-04T18:28:34+00:00"
updated_at: "2026-11-04T18:29:37+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-121971", "first_seen_at": "2026-11-04T18:28:34+00:00"}]
---

# Symfony HttpClient: relative URLs can leak bearer and basic credentials to other hosts

Symfony HttpClient's ScopingHttpClient merges a default scope's auth options into a request before resolving a relative URL against base_uri, so a network-path reference such as "//evil.example/steal" is sent to another origin with the credentials attached. An attacker who controls the start of a URL passed to such a client can capture the auth_bearer or auth_basic credentials.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the Symfony version in `composer.lock` or with `composer show symfony/http-client`.
- Search the code for `HttpClient::createForBaseUri(` and for `scoped_clients` under `framework.http_client` in config.
- Look for places where a URL that comes from user input or external data is passed to a scoped client that has `auth_bearer` or `auth_basic` set.

## Fix

- Symfony 5.x: `5.4.56` or later
- Symfony 6.x: `6.4.50` or later
- Symfony 7.x: `7.4.23` or later
- Symfony 8.x: `8.1.11` or later

## Timeline

- 2026-11-04T18:28:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-121971

## Documents

- [advisory] Vendor advisory: github.com https://github.com/symfony/symfony/security/advisories/GHSA-gq53-v8w2-gjhj
- [fix] Patch: github.com https://github.com/symfony/symfony/commit/64c34e85bd03b3f8a735d8e1af393659dda91d7c

## From the sources

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.



The 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.









This 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.

To 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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
