MODERATE 6.8

CVE-2026-40490

AsyncHttpClient leaks authorization credentials to untrusted domains on cross-origin redirects

Description

Impact

When redirect following is enabled (followRedirect(true)), AsyncHttpClient forwards Authorization and Proxy-Authorization headers along with Realm credentials to arbitrary redirect targets regardless of domain, scheme, or port changes. This leaks credentials on cross-domain redirects and HTTPS-to-HTTP downgrades.

Additionally, even when stripAuthorizationOnRedirect is set to true, the Realm object containing plaintext credentials is still propagated to the redirect request, causing credential re-generation for Basic and Digest authentication schemes via NettyRequestFactory.

An attacker who controls a redirect target (via open redirect, DNS rebinding, or MITM on HTTP) can capture Bearer tokens, Basic auth credentials, or any other Authorization header value.

Patches

Fixed in version 3.0.9 or 2.14.5. Users should upgrade immediately.

The fix automatically strips Authorization and Proxy-Authorization headers and clears Realm credentials whenever a redirect crosses origin boundaries (different scheme, host, or port) or downgrades from HTTPS to HTTP.

Workarounds

For users unable to upgrade, set (stripAuthorizationOnRedirect(true)) in the client config and avoid using Realm-based authentication with redirect following enabled. Note that (stripAuthorizationOnRedirect(true)) alone is insufficient on versions prior to 3.0.9 or 2.14.5 because the Realm bypass still re-generates credentials.

Alternatively, disable redirect following (followRedirect(false)) and handle redirects manually with origin validation.

References

  • Fix commit: https://github.com/AsyncHttpClient/async-http-client/commit/6b2fbb7f8

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.asynchttpclient » async-http-client
>= 2.0.0, < 2.14.5>= 3.0.0.Beta1, < 3.0.9
2.14.5, 3.0.9

Blast radius

1affected artifacts
125affected versions
3,460dependent artifacts (est.)
219,402dependent versions

64% of the dependent artifacts (2,216) still pull an affected version in their latest release.

DepthDependent versions
Direct
23,244
2 hops
83,004
3 hops
44,550
4 hops
36,124
5 hops
24,129
6 hops
8,351

Most used dependents

Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.