# CVE-2025-64166: Mercurius incorrect Content-Type parsing CSRF vulnerability

Source: https://junglewise.ai/threats/cve-2025-64166-mercurius-incorrect-content-type-parsing-csrf-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-05. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-64166 · Severity: low · CVSS 3.1 · Published 2026-03-05

Mercurius is a GraphQL framework for Node.js applications that handles incoming requests. A flaw in how it parses the Content-Type header allows attackers to bypass browser security controls and trick authenticated users into unknowingly performing actions (such as data modifications or deletions) on malicious websites. This could lead to unauthorized changes to user data or application state without the user's awareness.

Technologies: [mercurius (npm)](https://junglewise.ai/threats/technologies/mercurius). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-64166 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-64166 being exploited in the wild.

**How severe is CVE-2025-64166?** Low severity, with a CVSS score of 3.1, published 5 March 2026.

**Which products and versions are affected?** mercurius (npm) SEMVER:introduced=0,fixed=16.4.0.

**Is there a fix for CVE-2025-64166?** Yes. mercurius (npm): upgrade to 16.4.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-64166 attacked?** It is attacked over the network.

**Am I affected by CVE-2025-64166?** Check whether you run mercurius (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- mercurius (npm): upgrade to 16.4.0 or later

  ```sh
  npm install mercurius@16.4.0
  ```


## Technical details

The vulnerability is a Cross-Site Request Forgery (CSRF) issue (CWE-352) stemming from incorrect Content-Type header parsing in Mercurius. Requests with Content-Type headers such as application/x-www-form-urlencoded, multipart/form-data, or text/plain are misinterpreted as application/json, bypassing browser preflight checks enforced by the Fetch API and CORS. An unauthenticated attacker can craft a malicious request from a cross-origin context that, when visited by an authenticated user, performs unauthorized GraphQL mutations on behalf of that user. The vulnerability affects Mercurius versions up to 16.3.0 and is fixed in version 16.4.0. Mitigation involves implementing CSRF protection as detailed in pull request #1187.

## Affected products

- Mercurius Mercurius ≤ 16.3.0

## Identifiers

- CVE-2025-64166
- GHSA-v66j-6wwf-jc57

## Timeline

- 2026-03-05: disclosed
- 2026-03-05: patched: fixed in version 16.4.0

## References

- [https://github.com/mercurius-js/mercurius/security/advisories/GHSA-v66j-6wwf-jc57](https://github.com/mercurius-js/mercurius/security/advisories/GHSA-v66j-6wwf-jc57)

## Related threats

- [Mercurius queryDepth limit bypass in WebSocket subscriptions](https://junglewise.ai/threats/cve-2026-30241-mercurius-querydepth-limit-bypass-in-websocket-subscriptions)
- [mercurius uncaught exception in subscriptions](https://junglewise.ai/threats/cve-2023-22477-mercurius-uncaught-exception-in-subscriptions)
- [mercurius-js mercurius denial of service via uncaught exception](https://junglewise.ai/threats/cve-2021-43801-mercurius-js-mercurius-denial-of-service-via-uncaught-exception)
