Skip to main content
Menu
Advisories

Denial of Service via Incomplete Validation of Interface and Union Types

GHSA-G485-R83W-3CXJPublished Updated GitHub

Description

Hot Chocolate 16 document validation does not reject some invalid selections on interface and union types. Such a document passes validation, and the step that inlines fragments before execution then recurses without bound and ends the process with a StackOverflowException. No resolver runs before the crash.

An application is affected when all of the following hold:

  • It runs a Hot Chocolate server (AddGraphQLServer(), AddGraphQL(), or AddGraphQLFunction() with Azure Functions) on 16.0.0 or later.
  • It accepts operation documents from clients. This is the default. Applications that only execute persisted operations are not affected.
  • Its schema has an object type that clients can select and that implements an interface or is a member of a union. For example, any type that implements the Relay Node interface added by AddGlobalObjectIdentification().

The default configuration is affected. Fusion gateways (AddGraphQLGatewayServer() or AddGraphQLGateway()) answer these documents with an error instead of crashing. Versions before 16.0.0 are not affected.

Fixed Versions

  • 16.7.3

Impact

Any client that can send a query to the GraphQL endpoint can terminate the server process with one request. A StackOverflowException cannot be caught in .NET, so all in-flight requests and open subscriptions on that process are lost, and the request can be repeated after every restart. The attacker needs no authentication unless the endpoint requires it, and only needs type names that introspection or the client's own queries reveal. The parser's depth limits, cost analysis and execution limits do not prevent it.

The same gap lets some other invalid documents pass validation. They are answered with an unexpected execution error or executed in part, and they expose no data and bypass no limit.

This issue is classified as CWE-674: Uncontrolled Recursion.

Recommendation

Upgrade to 16.7.3 or later. The documents that caused the crash are then rejected with a validation error. Valid documents are not affected. Fusion gateways return the same validation error.

Affected versions

References

GitHub · ChilliCream/graphql-platform