@fastify/cors is vulnerable to Uncaught Exception
37
CVE Score
Low
Uncaught Exception
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.
Upgrade the @fastify/cors package to 11.4.0 or later.
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.
8.2.0 - 11.3.1
Fixed in 11.4.0@fastify/cors is vulnerable to Uncaught Exception in versions 8.2.0 - 11.3.1.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.