GHSA-mfj5-cf8g-g2fv CVE-2024-53990
AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s
- Severity
- 0.0 / 10
- Critical · CVSS 4.0
- Exploit chance (EPSS)
- 0.72%
- Chance of exploitation in the next 30 days. Higher than 53.99% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-287 Improper Authentication
- Fix
2.12.4- Upgrade org.asynchttpclient:async-http-client to this version or later
Description
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
;
Affected versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.asynchttpclient:async-http-client | >= 2.1.0, < 2.12.4 |
2.12.4 |
| org.asynchttpclient:async-http-client | >= 3.0.0.Beta1, < 3.0.1 |
3.0.1 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.asynchttpclient:async-http-client Maven → 2.12.4
- maven
<dependency><groupId>org.asynchttpclient</groupId><artifactId>async-http-client</artifactId><version>2.12.4</version></dependency>- gradle
implementation("org.asynchttpclient:async-http-client:2.12.4")
Severity breakdown
CVSS 4.0 0.0
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
- Attack vector
- Network
- Attack complexity
- High
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
Weakness
CWE-287: Improper Authentication
When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.
How to prevent it
- Architecture and Design: Use an authentication framework or library such as the OWASP ESAPI Authentication feature.
References
Advisories
Packages
Other links
- github.com/AsyncHttpClient/async-http-client/security/advisories/GHSA-mfj5-cf8g…
- github.com/AsyncHttpClient/async-http-client/issues/1964
- github.com/AsyncHttpClient/async-http-client/pull/2033
- github.com/AsyncHttpClient/async-http-client/commit/d5a83362f7aed81b93ebca55974…
- github.com/AsyncHttpClient/async-http-client/blob/main/CHANGES.md
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-p2jm-6hj6-9rjg AsyncHttpClient: Cookies received over plaintext HTTP can plant, overwrite or delete Secure cookies set over HTTPS | Medium | Also affects org.asynchttpclient:async-http-client |
| GHSA-3wp9-xfwm-rjjf AsyncHttpClient: WebSocket proxy credentials sent to the origin server over a CONNECT tunnel | Medium | Also affects org.asynchttpclient:async-http-client |
| GHSA-mfj3-87qq-382v AsyncHttpClient: Digest authentication cnonce generated with a non-cryptographic random source | Low | Also affects org.asynchttpclient:async-http-client |
| GHSA-jmqq-x5g9-9p2w AsyncHttpClient: Replay to a different host sends the original host request and credentials to the new host | Critical | Also affects org.asynchttpclient:async-http-client |
| GHSA-f9m8-cv68-674w AsyncHttpClient: Cookie Domain attribute is not checked against the public suffix list, so a cookie can be set for co.uk | Medium | Also affects org.asynchttpclient:async-http-client |
| GHSA-rqf5-2wxv-rjf4 AsyncHttpClient: Digest challenge without a usable nonce downgrades to Basic and sends the password in cleartext | High | Also affects org.asynchttpclient:async-http-client |
| GHSA-v2j5-22fr-j62r AsyncHttpClient: Pooled connections can still be shared across NTLM, Negotiate and proxy logins | High | Also affects org.asynchttpclient:async-http-client |
| GHSA-2jwh-9rmr-j4xf AsyncHttpClient CookieStore Silently Overrides Caller's Explicit Cookie Header via setHeader (Bypass of CVE-2024-53990 Fix) | Medium | Also affects org.asynchttpclient:async-http-client |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor