GHSA-mfj5-cf8g-g2fv

Suggest an improvement
Source
https://github.com/advisories/GHSA-mfj5-cf8g-g2fv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-mfj5-cf8g-g2fv/GHSA-mfj5-cf8g-g2fv.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-mfj5-cf8g-g2fv
Aliases
  • CVE-2024-53990
Published
2024-12-02T20:04:43Z
Modified
2024-12-18T16:09:28.658594Z
Severity
  • 9.2 (Critical) CVSS_V4 - 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 CVSS Calculator
Summary
AsyncHttpClient (AHC) library's `CookieStore` replaces explicitly defined `Cookie`s
Details

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
 ;
Database specific
{
    "nvd_published_at": "2024-12-02T18:15:11Z",
    "cwe_ids": [
        "CWE-287"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-02T20:04:43Z"
}
References

Affected packages

Maven / org.asynchttpclient:async-http-client

Package

Name
org.asynchttpclient:async-http-client
View open source insights on deps.dev
Purl
pkg:maven/org.asynchttpclient/async-http-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.1.0
Fixed
2.12.4

Affected versions

2.*

2.1.0
2.1.1
2.1.2
2.2.0
2.2.1
2.3.0
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.4.7
2.4.8
2.4.9
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.6.0
2.7.0
2.8.0
2.8.1
2.9.0
2.10.0
2.10.1
2.10.2
2.10.3
2.10.4
2.10.5
2.11.0
2.12.0
2.12.1
2.12.2
2.12.3

Maven / org.asynchttpclient:async-http-client

Package

Name
org.asynchttpclient:async-http-client
View open source insights on deps.dev
Purl
pkg:maven/org.asynchttpclient/async-http-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.0.0.Beta1
Fixed
3.0.1

Affected versions

3.*

3.0.0.Beta1
3.0.0.Beta2
3.0.0.Beta3
3.0.0