CVE-2024-53990: Async http client AsyncHttpClient (AHC) Library's `CookieStore` Replaces Vulnerability
CRITICALCVE-2024-53990 is a CRITICAL asynchttpclient (ahc) library's `cookiestore` replaces vulnerability (CWE-287: Improper Authentication) affecting Async http client libraries in the Maven ecosystem. The issue involves asynchttpclient (ahc) library's `cookiestore` replaces explicitly defined `cookie`s. Remediation is available by upgrading affected packages to version 2.12.4, 3.0.1.
CVE-2024-53990 at a Glance
How to Fix CVE-2024-53990
To remediate this vulnerability, upgrade all affected Async http client dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>2.12.4</version>
</dependency>
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>3.0.1</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.asynchttpclient
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-53990, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.asynchttpclient
Analyze the terminal output to locate any version of Async http client in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.12.4), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.asynchttpclient command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Async http client, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-53990 Affected Async http client Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.asynchttpclient:async-http-client
|
Maven |
≥ 2.1.0
< 2.12.4
|
2.12.4
|
|
org.asynchttpclient:async-http-client
|
Maven |
≥ 3.0.0.Beta1
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is CVE-2024-53990?
Which Async http client versions are affected?
What version fixes CVE-2024-53990?
Is async-http-client affected?
What CWE is associated with CVE-2024-53990?
How can I check Maven dependencies for CVE-2024-53990?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mfj5-cf8g-g2fv",
"modified" : "2024-12-18T15:56:40Z",
"published" : "2024-12-02T20:04:43Z",
"aliases" : [ "CVE-2024-53990" ],
"summary" : "AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s",
"details" : "### Summary\n\nWhen making any HTTP request, the automatically enabled and self-managed `CookieStore` (aka cookie jar) will silently replace explicitly defined `Cookie`s 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.\n\n### Details\n\nThis issue is described without security warnings here:\n\nhttps://github.com/AsyncHttpClient/async-http-client/issues/1964\n\nA PR to fix this issue has been made:\n\nhttps://github.com/AsyncHttpClient/async-http-client/pull/2033\n\n### PoC\n\n1. Add an auth `Cookie` to the `CookieStore`\n - This is identical to receiving an HTTP response that uses `Set-Cookie`, as shown in issue #1964 above.\n2. 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.\n3. Observe that the user's cookie in step 2 is passed as the Cookie in step 1.\n\n### Impact\n\nThis 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).\n\nIf your service sets cookies based on the response that happens here, it's possible to lead to even greater levels of exposure.\n\n### Workaroud\n\nYou can avoid this issue by disabling the `CookieStore` during client creation:\n\n```java\nDefaultAsyncHttpClientConfig.Builder clientBuilder = Dsl.config()\n .setCookieStore(null)\n // other configuration\n ;\n```",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.asynchttpclient:async-http-client"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.1.0"
}, {
"fixed" : "2.12.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.asynchttpclient:async-http-client"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0.Beta1"
}, {
"fixed" : "3.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/AsyncHttpClient/async-http-client/security/advisories/GHSA-mfj5-cf8g-g2fv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53990"
}, {
"type" : "WEB",
"url" : "https://github.com/AsyncHttpClient/async-http-client/issues/1964"
}, {
"type" : "WEB",
"url" : "https://github.com/AsyncHttpClient/async-http-client/pull/2033"
}, {
"type" : "WEB",
"url" : "https://github.com/AsyncHttpClient/async-http-client/commit/d5a83362f7aed81b93ebca559746ac9be0f95425"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/AsyncHttpClient/async-http-client"
}, {
"type" : "WEB",
"url" : "https://github.com/AsyncHttpClient/async-http-client/blob/main/CHANGES.md#from-20-to-21"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-287" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-02T20:04:43Z",
"nvd_published_at" : "2024-12-02T18:15:11Z"
}
}