Cost Limit Bypass via List Value Validation
Description
A Hot Chocolate 16.7 server stopped validating the rest of an operation after it saw a list value where an input object was expected, and reported no error for it, so the operation was treated as valid. A client could use this to get selections past validation that the default cost limit would otherwise refuse, and have the server execute them with their full resolver and data-source fan-out.
An application is affected when all of the following hold:
- It runs a Hot Chocolate server (
AddGraphQLServer(),AddGraphQL(), orAddGraphQLFunction()with Azure Functions) or a Fusion gateway (AddGraphQLGatewayServer()orAddGraphQLGateway()) on 16.7.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 at least one argument or input field whose type is an input object (for example a
where:filter or a mutationinput:).
Versions before 16.7.0 do not have the cost-analysis behavior this relies on and are not affected.
Fixed Versions
- 16.7.4
Impact
Any client that can send a query to the endpoint can get a selection executed that the default cost limit should refuse, by placing it after a malformed value that the server failed to reject. The selection runs with its full nested-list fan-out, so a small request can drive large resolver and data-source work and a handful of concurrent requests can exhaust the server's CPU and memory. No authentication is required and no data is read or changed.
This issue is classified as CWE-392: Missing Report of Error Condition.
Recommendation
Upgrade to 16.7.4 or later. A list value where an input object is expected is then reported as a validation error and the operation is rejected, so the cost limit again bounds the whole operation.