Summary
Tornado's SimpleAsyncHTTPClient previously reused authentication credentials when following redirects across different schemes, hosts, or ports.
Under certain redirect conditions, this behavior could expose sensitive Authorization headers or credentials to unintended servers, creating a risk of credential leakage and account compromise.
Affected context
This vulnerability affects applications using Tornado's SimpleAsyncHTTPClient to perform HTTP requests that may follow redirects.
It becomes relevant when:
- Redirects change the scheme (e.g., HTTP→HTTPS or HTTPS→HTTP), host, or port, and
- The original request includes Authorization headers or client-side authentication parameters.
In such scenarios, authentication data intended for the original origin can be forwarded to a different origin, depending on how redirects are handled by the application and the remote server.
Exploit preconditions
- Attack surface: Outbound HTTP requests issued via SimpleAsyncHTTPClient that can be influenced to follow redirects.
- Required access: Ability for an attacker to control or influence redirect responses (e.g., operating a redirecting endpoint, compromised origin, or man-in-the-middle in some deployments).
- Trigger point: A redirect response that changes scheme, host, or port, while the original request contained Authorization or auth_* parameters.
- Why exploitation is possible: The client shallow-copied the request on redirect and removed only the Host header, leaving Authorization and other authentication-related fields intact, allowing them to be sent to the new origin.
Why this happens
The root cause lies in how SimpleAsyncHTTPClient handled HTTP redirects: it reused most of the original request's headers and authentication settings when constructing the redirected request.
Only the Host header was explicitly stripped, while Authorization, auth_username, auth_password, and auth_mode were preserved even when the redirect target differed in scheme, host, or port.
This behavior violates origin-based trust boundaries and maps to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, because sensitive authentication data could be sent to a party that was not originally intended to receive it.
Potential impact
- Credentials (e.g., bearer tokens, basic auth credentials) may be disclosed to unintended servers.
- Attackers controlling redirect targets could collect reusable authentication tokens.
- Unauthorized access to user accounts or backend services could occur if leaked credentials are accepted elsewhere.
- Increased risk of session hijacking and lateral movement within integrated systems using shared credentials.
General mitigation guidance
Effective mitigation focuses on tightening how authentication data is propagated across redirects and origins:
- Ensure HTTP clients and wrappers do not automatically forward Authorization or other sensitive headers when the origin (scheme, host, or port) changes.
- Centralize redirect handling logic so that authentication is explicitly re-evaluated for each new origin, rather than blindly reused.
- Apply strict origin checks before attaching credentials, treating authentication as origin-scoped by default.
- Where possible, minimize long-lived or broadly scoped tokens and prefer audience-bound, least-privilege credentials to reduce impact if exposure occurs.
How teams detect issues like this
Detection typically involves reviewing how outbound HTTP requests are constructed and redirected:
- Use static analysis or code search to find SimpleAsyncHTTPClient usage combined with auto-following redirects and Authorization headers.
- During code review, flag patterns where authentication headers or auth_* parameters are set on generic HTTP clients without clear origin scoping.
- Instrument logging (with redaction) around redirect handling to track when requests change scheme, host, or port, and verify that sensitive headers are suppressed.
- Incorporate security-focused HTTP testing in CI, including redirect scenarios, to ensure that credentials are not forwarded to untrusted origins.

