# GHSA-X3HJ-GXJV-GPMF: Cross-Site Request Forgery via Persisted Operation Routes

- Database: GitHub
- Severity: CVSS 6.5 (Medium)
- Published: 2026-10-21
- Modified: 2026-10-21

## Affected versions

- HotChocolate.AspNetCore (NuGet): from 14.0.0, fixed in 14.3.3
- HotChocolate.AspNetCore (NuGet): from 15.0.0, fixed in 15.1.19
- HotChocolate.AspNetCore (NuGet): from 16.0.0, fixed in 16.6.9
- HotChocolate.Fusion (NuGet): from 14.0.0, fixed in 14.3.3
- HotChocolate.Fusion (NuGet): from 15.0.0, fixed in 15.1.19
- HotChocolate.Fusion.AspNetCore (NuGet): from 16.0.0, fixed in 16.6.9

## Description

### Summary

The persisted operation routes mapped by `MapGraphQLPersistedOperations()` execute a POST request whatever its `Content-Type`. A web page on another origin can send such a POST with `Content-Type: text/plain`, or with no `Content-Type` at all. That is a CORS simple request, which a browser sends without a preflight and with the user's cookies, so the page can run a persisted operation, including a mutation, as the signed-in user. The GraphQL endpoint mapped by `MapGraphQL()` refuses the same request.

An application is affected when all of the following hold:

* It maps the persisted operation routes with `MapGraphQLPersistedOperations()`, on a Hot Chocolate server or a Fusion gateway. In 14.x, the routes exist only in applications that target .NET 8 or later.
* It authenticates requests with credentials that the browser attaches automatically, such as cookies. That includes cookies with any `SameSite` value when the attacking page is on the same site, for example on another subdomain.
* A persisted operation changes state, such as a mutation.

### Fixed Versions

The vulnerability is fixed in the following releases:

* 16.6.9
* 15.1.19
* 14.3.3

### Impact

A page that a signed-in user visits can execute persisted operations with that user's identity. It cannot read the responses, so the impact is the effect of the operations it runs, such as any persisted mutation. The attacker needs the ID of a persisted operation, which a web client usually carries in its code.

This issue is classified as **CWE-352: Cross-Site Request Forgery (CSRF)**.

### Recommendation

Upgrade to one of the fixed releases. A POST to a persisted operation route must then carry `Content-Type: application/json`, and a request without it is refused, as it is on the GraphQL endpoint.

If an immediate upgrade is not possible, refuse POST requests to the persisted operation routes that do not carry a JSON `Content-Type`, before they reach Hot Chocolate:

```csharp
app.Use(async (context, next) =>
{
    if (HttpMethods.IsPost(context.Request.Method)
        && context.Request.Path.StartsWithSegments("/graphql/persisted")
        && !context.Request.HasJsonContentType())
    {
        context.Response.StatusCode = StatusCodes.Status415UnsupportedMediaType;
        return;
    }

    await next(context);
});
```

Use the path passed to `MapGraphQLPersistedOperations()` if it is not the default `/graphql/persisted`. If the application calls `app.UseEndpoints()`, register the middleware before it.

## References

- https://github.com/ChilliCream/graphql-platform/security/advisories/GHSA-x3hj-gxjv-gpmf

Page: https://cve.now/GHSA-X3HJ-GXJV-GPMF

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