Description
@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.
Published: 2026-11-02
Score: 3.7 Low
EPSS: n/a
KEV: No
Impact: Denial of Service
Action: Upgrade
AI Analysis

Impact

@fastify/cors, the CORS plugin for the Fastify web framework, contains a flaw when the non‑default onSend hook is used. On a CORS preflight (an OPTIONS request that includes Origin and Access-Control-Request-Method headers) the plugin calls reply.send from inside the onSend hook, re‑entering the send pipeline. This attempts to write response headers twice, triggering an uncaught ERR_HTTP_HEADERS_SENT exception that can crash the Node.js process if no process‑level error handler is present. The vulnerability is a pure availability issue; an unauthenticated attacker can trigger it with a single preflight request, and exploitation requires the offending onSend configuration. The weakness is a form of improper error handling, mapped to CWE‑248.

Affected Systems

The affected product is the @fastify/cors package. Versions from 8.2.0 up to and including 11.3.x are vulnerable. The issue was resolved in version 11.4.0, which rejects onSend as a hook parameter and fails registration with a clear error, preventing runtime crashes. Users of Fastify should therefore update their @fastify/cors dependency to 11.4.0 or later, or adjust the configuration to avoid the removed hook.

Risk and Exploitability

The CVSS base score of 3.7 places the vulnerability in the low‑to‑moderate severity range. Exploitation is easy: a remote client can send a crafted OPTIONS request to any endpoint that has @fastify/cors registered with a non‑default onSend hook. No authentication is required and no privilege escalation is needed, but the impact is termination of the Node.js process, which may disrupt service availability. The EPSS score is not available, and the vulnerability is currently not included in the CISA KEV catalog, indicating no known widespread exploitation.

Generated by OpenCVE AI on November 2, 2026 at 11:22 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade @fastify/cors to version 11.4.0 or later
  • If upgrading immediately is not possible, configure the plugin to use an accepted hook such as onRequest, or simply disable the preflight handling by setting preflight to false
  • Ensure process‑level error handling is in place to capture any unexpected send‑pipeline errors, providing an additional safety net if the plugin misbehaves

Generated by OpenCVE AI on November 2, 2026 at 11:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 02 Nov 2026 10:30:00 +0000

Type Values Removed Values Added
Description @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.
Title @fastify/cors vulnerable to Denial of Service on a CORS preflight with the onSend hook
Weaknesses CWE-248
References
Metrics cvssV3_1

{'score': 3.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: openjs

Published:

Updated: 2026-11-02T10:20:47.667Z

Reserved: 2026-10-31T15:01:18.624Z

Link: CVE-2026-120215

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-11-02T11:17:31.413

Modified: 2026-11-02T11:17:31.413

Link: CVE-2026-120215

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-11-02T11:30:14Z

Weaknesses