Denial of Service via Type Confusion in Operation Execution
Description
Hot Chocolate 16 and the Fusion gateway do not reject operations that exceed an internal limit of the operation compiler. Executing such an operation causes a type confusion, and the server process terminates. The default request limits, such as field cost, field count and request size, do not prevent it.
An application is affected when both of the following hold:
- It runs a Hot Chocolate server (
AddGraphQLServer(),AddGraphQL(), orAddGraphQLFunction()with Azure Functions) or a Fusion gateway (AddGraphQLGatewayServer()orAddGraphQLGateway()). - It accepts operation documents from clients. This is the default. Applications that only execute persisted operations are not affected.
Fixed Versions
- 16.7.3
Impact
A single request terminates the server process. The request does not need to be authenticated. Error filters, exception handlers and execution timeouts do not run, and all requests in flight and all subscriptions on the process are lost. The request can be repeated after every restart.
This issue is classified as CWE-843: Access of Resource Using Incompatible Type ('Type Confusion').
Recommendation
Upgrade to 16.7.3 or later. An operation that exceeds the limit is then rejected with an error. Valid operations are not affected.
There is no workaround.