Summary
AsyncHttpClient can attach authenticated SOCKS proxy credentials to requests without verifying that the connection is using an HTTP proxy. A malicious or unintended origin may therefore receive credentials, including reversible Basic credentials or negotiated NTLM, Kerberos, and SPNEGO authentication material.
Affected context
The issue affects AsyncHttpClient applications using authenticated SOCKS proxies within the affected release ranges. Risk arises when proxy authentication is handled by the Netty request factory or sender without confirming the proxy protocol, allowing proxy authorization data to travel through a request path where the origin can observe it.
Exploit preconditions
- Attack surface: Outbound HTTP requests made through an authenticated SOCKS proxy
- Required access: The attacker generally controls, impersonates, or can cause traffic to reach a hostile origin
- Trigger point: Preemptive proxy authentication or processing of an origin-generated HTTP 407 response
- Why exploitation is possible: Proxy credentials are attached or forwarded without reliably establishing that the destination is an HTTP proxy rather than an origin reached through a SOCKS tunnel
Why this happens
The underlying bug is a failure to bind proxy-authentication behavior to the correct proxy protocol and trust boundary. Code paths attach Proxy-Authorization or forward negotiated credentials based on authentication state without confirming that the recipient is an HTTP proxy. This maps primarily to CWE-319: Cleartext Transmission of Sensitive Information, because credentials can be sent over a plaintext request to an unintended recipient, and is also related to CWE-522: Insufficiently Protected Credentials.
Potential impact
- An origin may capture proxy usernames and passwords
- Basic authentication values may be readily reversible if intercepted
- NTLM, Kerberos, or SPNEGO credentials may be disclosed to an unauthorized endpoint
- Stolen proxy credentials could enable unauthorized network access or traffic interception
- Applications may experience broader credential compromise through reuse of exposed secrets
General mitigation guidance
Mitigation generally focuses on ensuring that proxy credentials are sent only to an explicitly verified HTTP proxy endpoint.
Common defensive patterns include:
- Binding authentication handlers to the negotiated proxy protocol and connection context
- Disabling preemptive proxy authentication unless the destination and transport are explicitly trusted
- Preventing origin responses from triggering proxy-credential forwarding through a SOCKS tunnel
- Limiting proxy credentials to dedicated, least-privileged accounts with narrow network scope
- Avoiding reusable Basic credentials where stronger, scoped authentication mechanisms are available
- Protecting outbound traffic with encrypted, authenticated channels and minimizing credential reuse
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static analysis for unconditional
Proxy-Authorizationattachment - Code review of proxy authentication interceptors and protocol-selection logic
- Tests that use hostile origins to verify that 407 responses cannot cause credential leakage through SOCKS
- Network monitoring for proxy credentials appearing in requests addressed to origin hosts
- Policy enforcement requiring explicit proxy-protocol validation before sensitive headers are emitted
Automated security review tools may help identify credential propagation across proxy and origin request paths.

