{"id":"CVE-2025-64166","published":"2026-03-05T15:31:45Z","modified":"2026-03-05T16:34:35Z","title":"Mercurius: Incorrect Content-Type parsing can lead to CSRF attack","vendor":"mercurius-js","product":"mercurius","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00184,"percentile":0.08122,"provenance":"source"},"cwes":[{"id":"CWE-352","name":"Cross-Site Request Forgery"}],"references":[{"url":"https://github.com/mercurius-js/mercurius/security/advisories/GHSA-v66j-6wwf-jc57","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/mercurius-js/mercurius/pull/1187","tags":["x_refsource_MISC"]},{"url":"https://github.com/mercurius-js/mercurius/commit/962d402ec7a92342f4a1b7f5f04af01776838c3c","tags":["x_refsource_MISC"]}],"priority":{"score":5.4,"factors":[{"name":"EPSS percentile","points":1.62},{"name":"CVSS severity","points":3.78}]},"vendorSlug":"mercurius-js","affectedVersions":[{"vendor":"mercurius-js","product":"mercurius","versions":["< 16.4.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-03-05T16:34:32.783675Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"mercurius","vulnerableRanges":["<16.4.0"],"patched":["16.4.0"],"from":["GHSA-v66j-6wwf-jc57"],"provenance":"source"}],"summary":{"text":"The Mercurius GraphQL adapter for Fastify, published by mercurius-js, mishandles the Content-Type header of incoming requests, so form-encoded, multipart, and text/plain requests can be treated as application/json. An attacker can exploit this cross-site request forgery flaw from a network position without authentication, but it requires a user to interact with a malicious page while authenticated, causing unauthorized actions to be performed on that user's behalf.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:20:18Z"},"euvd":{"id":"EUVD-2025-208313","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-mercurius-js-mercurius-cve-2025-64166","children":[{"from":"CVE-2025-64166","to":"CVE-2026-30241","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"npm:mercurius","fromFixed":"16.4.0","toFixed":"16.8.0","daysApart":1},{"kind":"same-code","provenance":"machine","files":["index.js","lib/routes.js"],"commits":["https://github.com/mercurius-js/mercurius/commit/962d402ec7a92342f4a1b7f5f04af01776838c3c","https://github.com/mercurius-js/mercurius/commit/5b56f60f4b0d60780b0ff499a479bd830bdd6986"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.23,"basis":"same product + description similarity"}]}],"packageHistory":[{"cve":"CVE-2021-43801","published":"2021-12-13","fixed":"8.11.2","kev":false},{"cve":"CVE-2023-22477","published":"2023-01-09","fixed":"11.5.0","kev":false},{"cve":"CVE-2025-64166","published":"2026-03-05","fixed":"16.4.0","kev":false},{"cve":"CVE-2026-30241","published":"2026-03-06","fixed":"16.8.0","kev":false}],"package":"npm:mercurius"}}