Intel

AIKIDO-2026-215874

@fastify/cors is vulnerable to Uncaught Exception

CVE-2026-120215Published 4 days ago
November 3, 2026

37

CVE Score

Low

Uncaught Exception

Are you affected? Scan for Free

TL;DR

Before the fix, registering @fastify/cors with the non-default hook: 'onSend' option and preflight enabled (the default) let any unauthenticated client crash the Node.js process with a single CORS preflight OPTIONS request carrying Origin and Access-Control-Request-Method headers. fastifyCors registered its handler on the onSend hook, and the preflight branch called reply.send() from inside that hook, re-entering Fastify's send pipeline so a second header write threw an uncaught ERR_HTTP_HEADERS_SENT. The fix removes onSend from the accepted hook values, so registration fails with a clear TypeError instead of crashing at request time.

How do I fix this?

Upgrade the @fastify/cors package to 11.4.0 or later.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and register the plugin with the non-default hook: 'onSend' option with preflight enabled, and unauthenticated clients can reach its CORS preflight handling.

Versions

8.2.0 - 11.3.1

Fixed in 11.4.0

Background info

@fastify/cors is vulnerable to Uncaught Exception in versions 8.2.0 - 11.3.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea