CVE-2026-140868: Proxy-Authorization header not stripped on cross-origin redirects leaks proxy credentials
When following a redirect to a different origin, httpx2 removes the Authorization and Cookie headers but keeps Proxy-Authorization. A client that sets Proxy-Authorization in its client or request headers sends that credential to the redirect target, where an attacker who controls the redirecting response, or an on-path attacker on plain HTTP, can capture it.
Applications are affected when all of the following hold: followredirects=True is set (the default is False), Proxy-Authorization is passed in headers rather than through the proxy parameter, and the redirect target is not reached through the same forward proxy that consumed the header on the first request. Proxy credentials given in the proxy URL are not affected. Affected versions are httpx2 before 2.18.0.
The issue is fixed in 2.18.0, which removes Proxy-Authorization whenever a redirect changes origin. Until then, give proxy credentials in the proxy URL instead of a header, or leave followredirects off.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.18.0 - Configuration
Pass proxy credentials in the proxy URL instead of in client or request headers.
httpx2 proxy credentials = proxy URL - Configuration
Leave follow_redirects off.
httpx2 follow_redirects = false
Event History
Frequently Asked Questions
Are applications using the default redirect behavior affected?
No. The default for follow_redirects is False. Exposure requires explicitly enabling follow_redirects=True.
Which proxy authentication configurations are exposed?
Only applications that supply Proxy-Authorization as a client or request header are affected. Credentials embedded in the proxy URL are not affected.
What conditions must occur for credentials to leak?
A cross-origin redirect must be followed, and the redirect target must not be reached through the same forward proxy that consumed the header on the initial request. An attacker can capture the credential by controlling the redirect response or by being on path for plain HTTP.
What can be done before upgrading?
Provide proxy credentials in the proxy URL rather than in a Proxy-Authorization header, or disable redirect following. Upgrade to httpx2 2.18.0 or later when possible.