Hot Chocolate's Utf8GraphQLParser has Stack Overflow via Deeply Nested GraphQL Documents
ChilliCream graphql-platform
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| HotChocolate.Language NuGet |
|
|
ChilliCream graphql-platform
| Product | Affected | Fixed in |
|---|---|---|
| HotChocolate.Language NuGet |
|
|
Hot Chocolate is an open-source GraphQL server. Prior to versions 12.22.7, 13.9.16, 14.3.1, and 15.1.14, Hot Chocolate's recursive descent parser `Utf8GraphQLParser` has no recursion depth limit. A crafted GraphQL document with deeply nested selection sets, object values, list values, or list types can trigger a `StackOverflowException` on payloads as small as 40 KB. Because `StackOverflowException` is uncatchable in .NET (since .NET 2.0), the entire worker process is terminated immediately. All in-flight HTTP requests, background `IHostedService` tasks, and open WebSocket subscriptions on that worker are dropped. The orchestrator (Kubernetes, IIS, etc.) must restart the process. This occurs before any validation rules run — `MaxExecutionDepth`, complexity analyzers, persisted query allow-lists, and custom `IDocumentValidatorRule` implementations cannot intercept the crash because `Utf8GraphQLParser.Parse` is invoked before validation. The `MaxAllowedFields=2048` limit does not help because the crashing payloads contain very few fields. The fix in versions 12.22.7, 13.9.16, 14.3.1, and 15.1.14 adds a `MaxAllowedRecursionDepth` option to `ParserOptions` with a safe default, and enforces it across all recursive parser methods (`ParseSelectionSet`, `ParseValueLiteral`, `ParseObject`, `ParseList`, `ParseTypeReference`, etc.). When the limit is exceeded, a catchable `SyntaxException` is thrown instead of overflowing the stack. There is no application-level workaround. `StackOverflowException` cannot be caught in .NET. The only mitigation is to upgrade to a patched version. Operators can reduce (but not eliminate) risk by limiting HTTP request body size at the reverse proxy or load balancer layer, though the smallest crashing payload (40 KB) is well below most default body size limits and is highly compressible (~few hundred bytes via gzip).
From the CVE record · GitHub_M
Hot Chocolate's Utf8GraphQLParser lacks a recursion depth limit in affected versions. A crafted, deeply nested GraphQL document can cause a stack overflow that terminates the worker process before validation runs, dropping requests, background tasks, and WebSocket subscriptions. The input does not specify whether authentication or user interaction is required.
Engineers running ChilliCream graphql-platform with NuGet HotChocolate.Language versions below 12.22.7, 13.0.0–13.9.15, 14.0.0–14.3.0, or 15.0.0–15.1.13 should check their deployments.