{"id":"CVE-2026-45300","aliases":["CVE-2026-45300","GHSA-fmxf-pm6p-7xgm"],"related":[],"kind":"vulnerability","state":"published","title":"async-http-client: Cookie header not stripped on cross-origin redirect","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nasync-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.\n\n## Details\n\nThe vulnerability is in `client/src/main/java/org/asynchttpclient/netty/handler/intercept/Redirect30xInterceptor.java`.\n\nThe caller computes `stripAuth` on each redirect:\n\n```java\nboolean sameBase    = request.getUri().isSameBase(newUri);\nboolean stripAuth   = !sameBase || schemeDowngrade || stripAuthorizationOnRedirect;\n// ...\nrequestBuilder.setHeaders(propagatedHeaders(request, realm, keepBody, stripAuth));\n```\n\n`stripAuth` is `true` whenever the redirect crosses an origin, downgrades the scheme, or the caller opted in via `AsyncHttpClientConfig#isStripAuthorizationOnRedirect()`.\n\nIn the vulnerable version, `propagatedHeaders()` only removes `Authorization` and `Proxy-Authorization` in that branch — `Cookie` is left untouched:\n\n```java\nprivate static HttpHeaders propagatedHeaders(Request request, Realm realm, boolean keepBody, boolean stripAuthorization) {\n    HttpHeaders headers = request.getHeaders()\n            .remove(HOST)\n            .remove(CONTENT_LENGTH);\n\n    if (!keepBody) {\n        headers.remove(CONTENT_TYPE);\n    }\n\n    if (stripAuthorization || (realm != null && (realm.getScheme() == AuthScheme.NTLM\n            || realm.getScheme() == AuthScheme.SCRAM_SHA_256))) {\n        headers.remove(AUTHORIZATION)\n                .remove(PROXY_AUTHORIZATION);\n        // BUG: COOKIE is not removed here, so cookies leak across the security boundary.\n    }\n    return headers;\n}\n```\n\nThe 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.\n\n## Proof of concept\n\n```java\nimport org.asynchttpclient.*;\n\nAsyncHttpClient client = asyncHttpClient();\n\n// trusted-api.com responds 302 -> https://evil.com\nRequest request = new RequestBuilder(\"GET\")\n        .setUrl(\"https://trusted-api.com/endpoint\")\n        .setHeader(\"Cookie\", \"session=abc123; csrf=xyz789; api_key=secret\")\n        .setHeader(\"Authorization\", \"Bearer token123\")\n        .build();\n\nclient.executeRequest(request).get();\n\n// Request seen by evil.com after the redirect:\n//   Authorization: <stripped>\n//   Cookie:        session=abc123; csrf=xyz789; api_key=secret   <-- leaked\n```\n\n## Impact\n\n- **Session hijacking** — leaked session cookies allow impersonation.\n- **CSRF token theft** — CSRF tokens carried in cookies are disclosed.\n- **API key theft** — API keys stored in cookies are disclosed.\n- **Privacy** — tracking identifiers leak to third-party origins.\n\nRealistic attack paths:\n\n- Open-redirect in a trusted API endpoint.\n- Compromised CDN or API gateway injecting redirects.\n- MITM on a plaintext hop in the redirect chain.\n\n## Fix\n\nAdd `COOKIE` to the headers removed alongside `AUTHORIZATION` / `PROXY_AUTHORIZATION` on the security-boundary branch:\n\n```java\nif (stripAuthorization) {\n    headers.remove(AUTHORIZATION)\n            .remove(PROXY_AUTHORIZATION)\n            .remove(COOKIE);\n} else if (realm != null && (realm.getScheme() == AuthScheme.NTLM\n        || realm.getScheme() == AuthScheme.SCRAM_SHA_256)) {\n    headers.remove(AUTHORIZATION)\n            .remove(PROXY_AUTHORIZATION);\n}\n```\n\nNote 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.\n\nFixed in **3.0.10** and **2.15.0** by commit [`3b0e3e9e`](https://github.com/AsyncHttpClient/async-http-client/commit/3b0e3e9e).","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-18T16:42:20.000Z","modified":"2026-09-10T03:50:46.791Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N","score":7.4,"rating":"HIGH"}],"cwes":["CWE-200"],"affected":[{"ranges":[{"version":">= 3.0.0.Beta1, < 3.0.10","status":"affected"},{"version":">= 2.0.0, < 2.15.0","status":"affected"}],"vendor":"AsyncHttpClient","product":"async-http-client","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0.Beta1","status":"affected","fixed":"3.0.10"}],"ecosystem":"Maven","package":"org.asynchttpclient:async-http-client","purl":"pkg:maven/org.asynchttpclient/async-http-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.15.0"}],"ecosystem":"Maven","package":"org.asynchttpclient:async-http-client","purl":"pkg:maven/org.asynchttpclient/async-http-client","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.0.0","fixed":"2.15.0"},{"status":"affected","introduced":"3.0.0","fixed":"3.0.10"}],"vendor":"asynchttpclient_project","product":"async-http-client","cpe":"cpe:2.3:a:asynchttpclient_project:async-http-client:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/AsyncHttpClient/async-http-client/security/advisories/GHSA-fmxf-pm6p-7xgm","tags":["exploit","mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/AsyncHttpClient/async-http-client/commit/3b0e3e9e","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/AsyncHttpClient/async-http-client/releases/tag/async-http-client-project-3.0.10","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45300","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/AsyncHttpClient/async-http-client","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-06-08T14:33:01.603Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45300","url":"https://www.cve.org/CVERecord?id=CVE-2026-45300","licence":"CVE Terms of Use","modified":"2026-06-08T16:34:10.203Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fmxf-pm6p-7xgm","url":"https://github.com/advisories/GHSA-fmxf-pm6p-7xgm","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.791Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45300","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45300","licence":"Public domain","modified":"2026-07-23T07:10:00.113Z"}],"updatedAt":"2026-11-25T22:59:23.906Z","epss":{"score":0.0035,"percentile":0.30601,"date":"2026-12-01T12:00:22.000Z"}}