AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s
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
- Add an auth
Cookieto theCookieStore- This is identical to receiving an HTTP response that uses
Set-Cookie, as shown in issue #1964 above.
- This is identical to receiving an HTTP response that uses
- Handle a different user's request where the same
Cookieis provided as a passthrough, like a JWT, and attempt to use it by explicitly providing it. - 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
;
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.asynchttpclient:async-http-client | >= 2.1.0, < 2.12.4, >= 3.0.0.Beta1, < 3.0.1 | 2.12.4, 3.0.1 |
Verweise
- https://github.com/AsyncHttpClient/async-http-client/security/advisories/GHSA-mfj5-cf8g-g2fv
- https://nvd.nist.gov/vuln/detail/CVE-2024-53990
- https://github.com/AsyncHttpClient/async-http-client/issues/1964
- https://github.com/AsyncHttpClient/async-http-client/pull/2033
- https://github.com/AsyncHttpClient/async-http-client/commit/d5a83362f7aed81b93ebca559746ac9be0f95425
- https://github.com/AsyncHttpClient/async-http-client
- https://github.com/AsyncHttpClient/async-http-client/blob/main/CHANGES.md#from-20-to-21
- CVSS-Vektor
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N- Schwäche (CWE)
CWE-287- Plattform
- Java / Kotlin (Maven)
- Paket
org.asynchttpclient:async-http-client- Veröffentlicht
- 02.12.2024
- Aktualisiert
- 11.10.2026 13:20
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-mfj5-cf8g-g2fv - CC BY 4.0
Schwachstellenhistorie: org.asynchttpclient:async-http-client
Alle veröffentlichten Schwachstellen dieses Pakets (Java / Kotlin (Maven)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 18
- Erste → letzte
- 10.2018 10.2026
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Kritisch 2
- Hoch 6
- Mittel 8
- Niedrig 2
Veröffentlichungen pro Jahr
- 2018: 1
- 2019: 0
- 2020: 0
- 2021: 0
- 2022: 0
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 16
-
AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.