Skip to main content
Menu
Advisories

Denial of Service via Field Merging Argument Comparison

GHSA-HW2P-XJ6W-VWMVPublished Updated GitHub

Description

Hot Chocolate compares the arguments of two fields that select the same response name as part of checking that they can be merged. For large arguments this comparison grows with the square of the request size, so a single request can keep a CPU core busy for tens of seconds to minutes. The work is not interrupted by the execution timeout or by the client disconnecting.

An application is affected when both of the following hold:

  • It runs a Hot Chocolate server (AddGraphQLServer(), AddGraphQL(), or AddGraphQLFunction() with Azure Functions) or a Fusion gateway (AddGraphQLGatewayServer() or AddGraphQLGateway(), or AddFusionGatewayServer() in 13.x to 15.x).
  • It accepts operation documents from clients. This is the default. Applications that only execute persisted operations are not affected.

No other server option is needed, and the behavior does not depend on the schema. The default configuration is affected. Versions before 13.0.0 are also affected and receive no fix on this advisory; those users should move to 13.9.20 or later.

Fixed Versions

  • 16.7.4
  • 15.1.21
  • 14.3.5
  • 13.9.20

Impact

Any client that can send a query to the endpoint can make the server spend a large amount of CPU on a single request, before cost analysis or the concurrency limit apply. The request is not interrupted by the execution timeout or by the client closing the connection. A few such requests take all CPU of the host and keep it from serving other clients. No data is read or changed and the process stays running. Both a standalone server and a Fusion gateway are affected.

This issue is classified as CWE-407: Inefficient Algorithmic Complexity.

Recommendation

Upgrade to one of the fixed releases. Comparing the arguments of two fields then costs time proportional to the size of the arguments rather than its square.

Affected versions

References

GitHub · ChilliCream/graphql-platform