DEV Community

facilishz
facilishz

Posted on

Symfony ScopingHttpClient Sends Default Credentials to the Wrong Origin

Symfony ScopingHttpClient Sends Default Credentials to the Wrong Origin

Symfony HttpClient's ScopingHttpClient can send a default scope's authentication credentials to another origin when a relative URL resolves outside the base URI. The issue is CVE-2026-121971. It affects symfony/http-client before 5.4.56, 6.4.50, 7.4.23 and 8.1.11, with matching Symfony framework releases.

The component merges default scope options into a request before resolving the relative URL against base_uri. A network-path reference such as //attacker.example/collect changes the authority. The default auth_basic or auth_bearer value can follow the request to the new host.

The merge order creates the leak

If credentials are added only after the final origin matches the configured scope, a relative reference cannot redirect them to a different authority. The affected order adds the default options too early. The patch compares the resolved URL's scheme and authority with the base URI and resets default scope options when they differ.

The advisory also covers authority manipulation through an alternate port and user-info. A URL parser can treat those forms as a different origin even when the path appears relative.

Inventory the package, not the page title

Update every affected symfony/http-client and symfony/symfony dependency to the fixed release for its branch. Check composer.lock, container images, vendor directories and long-lived build caches. A framework branch may inherit the fixed HTTP client indirectly, so confirm the installed package version rather than only the top-level Symfony version.

Search application logs and egress records for requests whose destination differs from the base URI after a relative path was supplied. Preserve authorization headers only through secure evidence handling. Rotate a credential if the destination or upstream logs show that it was sent to an unexpected origin.

Application checks

Create a test client with a base URI, a default authentication scope and an untrusted relative URL. Verify that a same-origin request receives the credential and that //host, alternate-port and user-info variants do not. Test redirects separately.

The patch fixes the known merge behavior. The durable rule is that request credentials belong to the final scheme, host and port, not to a URL string inherited from an earlier stage.

References

Top comments (0)