Skip to main content
Menu
Advisories

Response Disclosure Between Callers via Request Deduplication Key Collisions

GHSA-9H3J-GXJR-39JPPublished Updated GitHub

Description

The Fusion gateway can deduplicate identical query requests that are in flight to a source schema at the same time. AddRequestDeduplication() adds a handler to the gateway's HTTP client, and AnnotateOperationKind marks the requests it may deduplicate. The first request is sent, and identical requests that arrive while it is in flight receive a copy of its response.

In affected versions, the handler identifies a request by a 64-bit XxHash64 of its method, URL, body, and the values of the headers listed in HashHeaders, by default Authorization and Cookie, and never compares the requests themselves. XxHash64 is not designed to resist collisions, and the hash is computed without a secret seed, so a request with the same hash as a given request can be computed. A caller who can predict another caller's request to a source schema can put a string variable in their own query that makes the gateway's request to that source schema collide with it.

A gateway is affected when it enables request deduplication, which is off by default. Other HTTP clients configured with AddRequestDeduplication() from HotChocolate.Transport.Http are affected when their request bodies carry values from an untrusted party.

Fixed Versions

  • 16.7.4

Applications on 16.6 or earlier 16.x releases should upgrade to 16.7.4.

Impact

The attacker needs a query that the gateway forwards to the same source schema with a string variable they control, and has to predict the other caller's request: the source schema URL, the request body the gateway sends for that caller's query, and the values of the HashHeaders on it. A web application typically sends the same query document for every user.

  • When HashHeaders holds a per-caller value that the attacker can learn, such as a user ID or tenant ID that the gateway derives from the caller's claims, the attacker's request joins the other caller's request in flight and the attacker receives that caller's response, including fields that resolve per caller.
  • When HashHeaders holds no per-caller value, as for anonymous traffic, the attacker keeps a colliding request in flight, and other callers who send the targeted query receive the response to the attacker's operation instead of their own.
  • Callers whose request carries a forwarded bearer token or session cookie listed in HashHeaders are not affected, because the attacker cannot compute the hash of their request.

The attack succeeds only while the targeted request is in flight.

This issue is classified as CWE-328: Use of Weak Hash.

Recommendation

Upgrade to 16.7.4. Requests then count as identical only when their method, URL, body, and the values of each header in HashHeaders are equal.

If an immediate upgrade is not possible, remove request deduplication. Listing a forwarded bearer token or session cookie in HashHeaders protects the callers that send one, but not anonymous traffic.

Affected versions

References

GitHub · ChilliCream/graphql-platform