What’s Vulnerable › Vulnerabilities

CVE-2025-64166: Mercurius: Incorrect Content-Type parsing can lead to CSRF attack

Description

Mercurius is a GraphQL adapter for Fastify. Prior to version 16.4.0, a cross-site request forgery (CSRF) vulnerability was identified. The issue arises from incorrect parsing of the Content-Type header in requests. Specifically, requests with Content-Type values such as application/x-www-form-urlencoded, multipart/form-data, or text/plain could be misinterpreted as application/json. This misinterpretation bypasses the preflight checks performed by the fetch() API, potentially allowing unauthorized actions to be performed on behalf of an authenticated user. This issue has been patched in version 16.4.0.

Affected products

How to fix

Upgrade to a fixed version: mercurius-js mercurius 16.4.0. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2025-64166 or the next vulnerability affects your stack