---
id: "CVE-2026-120215"
kind: "vulnerability"
aliases: ["CVE-2026-120215"]
title: "@fastify/cors: preflight request can crash Node.js process with onSend"
severity: "low"
cvss: 3.7
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["@fastify/cors", "fastify", "node.js", "package"]
not_affected_if: ["default-hook", "no-process-crash-handler-needed", "preflight-disabled"]
published_at: "2026-11-02T11:17:31+00:00"
first_seen_at: "2026-11-02T11:22:54+00:00"
updated_at: "2026-11-02T11:24:21+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120215", "first_seen_at": "2026-11-02T11:22:54+00:00"}]
---

# @fastify/cors: preflight request can crash Node.js process with onSend

When @fastify/cors is registered with the non-default onSend hook, a single CORS preflight request makes the plugin re-send response headers, throwing an uncaught error. With no process-level error handler, this can terminate the Node.js process.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `npm ls @fastify/cors`; versions 8.2.0 through 11.3.x are in range.
- Search the application code for registrations of the CORS plugin that set the `hook` option to `onSend`.
- Check whether the process has an `uncaughtException` handler installed.

## Fix

- `@fastify/cors` `11.4.0` or later; in 11.4.0 `onSend` is rejected at registration instead of crashing at request time.
- Workaround stated in the source: use another hook such as the default `onRequest`, or set `preflight` to `false`.

## Timeline

- 2026-11-02T11:22:54+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120215

## Documents

- [advisory] Vendor advisory: github.com https://github.com/fastify/fastify-cors/security/advisories/GHSA-8c3j-mm64-257c

## From the sources

@fastify/cors is the CORS plugin for the Fastify web framework. In versions 8.2.0 through 11.3.x, an application that registers the plugin with the non-default onSend hook option crashes on a CORS preflight. On an OPTIONS request that carries the Origin and Access-Control-Request-Method headers, the plugin calls reply.send from inside the onSend hook and re-enters the send pipeline, so a second write of the response headers throws an uncaught ERR_HTTP_HEADERS_SENT that can terminate the Node.js process when no process-level handler is installed. An unauthenticated remote client can trigger this with a single preflight request, so the impact is availability only, and exploitation requires the non-default onSend configuration. The issue is fixed in @fastify/cors 11.4.0, where onSend is no longer an accepted hook value and registration fails with a clear error instead of crashing at request time, and users should upgrade to 11.4.0 or later. As a workaround, use any other hook such as the default onRequest, or set preflight to false.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
