# GHSA-J5VG-MQW8-P958: Denial of Service in Document Validation

- Database: GitHub
- Severity: CVSS 9.1 (Critical)
- Published: 2026-10-30
- Modified: 2026-10-30

## Affected versions

- HotChocolate.Validation (NuGet): from 16.0.0, fixed in 16.7.3
- HotChocolate.Validation (NuGet): from 15.0.0, fixed in 15.1.20
- HotChocolate.Validation (NuGet): from 14.0.0, fixed in 14.3.4
- HotChocolate.Validation (NuGet): fixed in 13.9.19
- HotChocolate.AspNetCore (NuGet): from 16.0.0, fixed in 16.7.3
- HotChocolate.AspNetCore (NuGet): from 15.0.0, fixed in 15.1.20
- HotChocolate.AspNetCore (NuGet): from 14.0.0, fixed in 14.3.4
- HotChocolate.AspNetCore (NuGet): fixed in 13.9.19
- HotChocolate.Fusion (NuGet): from 15.0.0, fixed in 15.1.20
- HotChocolate.Fusion (NuGet): from 14.0.0, fixed in 14.3.4
- HotChocolate.Fusion (NuGet): fixed in 13.9.19
- HotChocolate.Fusion.AspNetCore (NuGet): from 16.0.0, fixed in 16.7.3

## Description

### Summary

Hot Chocolate limits how deeply a GraphQL document can be nested with the parser option `MaxAllowedRecursionDepth`. Document validation, cost analysis and operation compilation are not bound by this limit and had no depth limit of their own. A client document can make them overflow the stack, and the process terminates with a `StackOverflowException`.

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.

### Fixed Versions

* 16.7.3
* 15.1.20
* 14.3.4
* 13.9.19

### Impact

An unauthenticated client can terminate the server or gateway process with a single request. A `StackOverflowException` cannot be caught, so every in-flight request and open subscription on that process is dropped, and the request can be repeated after each restart. The attacker needs almost no knowledge of the schema. Authorization on fields or types does not prevent it, because the crash happens before any field is resolved. The parser's `MaxAllowedRecursionDepth` and `AddMaxExecutionDepthRule` do not prevent it either. Requiring authentication for the GraphQL endpoint limits the attack to authenticated clients.

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

### Recommendation

Upgrade to one of the fixed releases. The validator then refuses an operation whose selection sets are nested deeper than 200 levels, counting the nesting inside the fragments it uses. Fields with a selection set, inline fragments and fragment spreads each count as one level. Such an operation is answered with a validation error. The limit is set with `MaxAllowedSelectionSetDepth` on the validation options:

```csharp
builder
    .AddGraphQLServer()
    .ConfigureValidation((_, b) => b.ModifyOptions(o => o.MaxAllowedSelectionSetDepth = 100));
```

If the application raises the parser option `MaxAllowedRecursionDepth`, raise this limit as well. A document whose fragment spreads form a cycle is now answered with the fragment cycle error only.

There is no workaround.

## References

- https://github.com/ChilliCream/graphql-platform/security/advisories/GHSA-j5vg-mqw8-p958

Page: https://cve.now/GHSA-J5VG-MQW8-P958

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
