CVE-2024-53990
JSON

9.2critical

AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s

Severity
9.2critical CVSS:4.0 by GitHub_M
Exploit likelihood
0.73% (higher than 55% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mfj5-cf8g-g2fv

Description

The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and asynchronously process HTTP responses. When making any HTTP request, the automatically enabled and self-managed CookieStore (aka cookie jar) will silently replace explicitly defined Cookies with any that have the same name from the cookie jar. For services that operate with multiple users, this can result in one user's Cookie being used for another user's requests.

Affected

Product or packageVersionsReported by
AsyncHttpClient async-http-client< 3.0.1CVE List
asynchttpclient_project async-http-clientbefore 3.0.1CVE List
org.asynchttpclient:async-http-client (Maven)from 2.1.0 before 2.12.4, from 3.0.0.Beta1 before 3.0.1GitHub Advisory Database

All scores

GitHub_M9.2critical CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Classification

CWE-287

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. When making any HTTP request, the automatically enabled and self-managed CookieStore (aka cookie jar) will silently replace explicitly defined Cookies with any that have the same name from the cookie jar. For services that operate with multiple users, this can result in one user's Cookie being used for another user's requests.

GitHub Advisory Database
Summary

When making any HTTP request, the automatically enabled and self-managed CookieStore (aka cookie jar) will silently replace explicitly defined Cookies with any that have the same name from the cookie jar. For services that operate with multiple users, this can result in one user's Cookie being used for another user's requests.

Details

This issue is described without security warnings here:

https://github.com/AsyncHttpClient/async-http-client/issues/1964

A PR to fix this issue has been made:

https://github.com/AsyncHttpClient/async-http-client/pull/2033

PoC
  1. Add an auth Cookie to the CookieStore
    • This is identical to receiving an HTTP response that uses Set-Cookie, as shown in issue #1964 above.
  2. Handle a different user's request where the same Cookie is provided as a passthrough, like a JWT, and attempt to use it by explicitly providing it.
  3. Observe that the user's cookie in step 2 is passed as the Cookie in step 1.
Impact

This is generally going to be a problem for developers of backend services that implement third party auth features and use other features like token refresh. The moment a third party service responds by setting a cookie in the response, the CookieStore will effectively break almost every follow-up request (hopefully by being rejected, but possibly by revealing a different user's information).

If your service sets cookies based on the response that happens here, it's possible to lead to even greater levels of exposure.

Workaroud

You can avoid this issue by disabling the CookieStore during client creation:

DefaultAsyncHttpClientConfig.Builder clientBuilder = Dsl.config()
 .setCookieStore(null)
 // other configuration
 ;
NVD (es)

La librería AsyncHttpClient (AHC) permite que las aplicaciones Java ejecuten fácilmente solicitudes HTTP y procesen de forma asincrónica las respuestas HTTP. Al realizar una solicitud HTTP, el CookieStore (también conocido como contenedor de cookies) habilitado automáticamente y autoadministrado reemplazará silenciosamente las Cookies definidas explícitamente por cualquier cookie que tenga el mismo nombre del contenedor de cookies. En el caso de los servicios que funcionan con varios usuarios, esto puede provocar que la Cookie de un usuario se utilice para las solicitudes de otro usuario.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-53990 changed 2024-12-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-mfj5-cf8g-g2fv changed 2026-09-10CC-BY-4.0
NVDCVE-2024-53990 changed 2026-06-17Public domain