critical

CVE

CVE-2026-120213, CVE-2026-117518, CVE-2026-120214, CVE-2026-117531, CVE-2026-120216, CVE-2026-117549, CVE-2026-120215

CWE

CWE-22, CWE-436, CWE-918, CWE-400, CWE-347, CWE-755

Affected Surface

  • npm `@fastify/http-proxy` versions `>= 9.0.0, <= 11.6.5` (`CVE-2026-120213` / `GHSA-h3vp-4jfr-v364`, CVSS 9.1 Critical, fixed in `11.6.6`) and `>= 11.6.0, <= 11.6.2` (`CVE-2026-120214` / `GHSA-hr26-gmr2-pwcv`, CVSS 5.9 Medium, fixed in `11.6.3`)
  • npm `@fastify/reply-from` versions `<= 12.8.0` (`CVE-2026-117518` / `GHSA-vp2r-3vgv-32g9`, CVSS 8.2 High, fixed in `12.8.1`)
  • npm `@fastify/multipart` versions `>= 5.3.0, <= 10.1.6` (`CVE-2026-117531` / `GHSA-5849-5m6q-9632`, CVSS 5.9 Medium, fixed in `10.1.7`)
  • npm `@fastify/secure-session` versions `>= 7.5.0, <= 8.4.1` (`CVE-2026-117549` / `GHSA-4cgq-x5f7-r8jv`, CVSS 4.2 Medium, fixed in `8.4.2`)
  • npm `@fastify/cors` versions `>= 8.2.0, < 11.4.0` when configured with `hook: 'onSend'` (`CVE-2026-120215` / `GHSA-8c3j-mm64-257c`, CVSS 3.7 Low, fixed in `11.4.0`)
  • npm `fastify` versions `>= 5.8.0, <= 5.12.7` when configured with a nonzero `handlerTimeout` on streaming routes (`CVE-2026-120216` / `GHSA-3qgw-9275-xf8w`, CVSS 5.9 Medium, fixed in `5.12.8`)

TL;DR

On 2 November 2026 (08:51 to 11:17 UTC), the Fastify team and the OpenJS Foundation CVE Numbering Authority (CNA) published a coordinated wave of seven security advisories across six core Fastify packages:

  1. @fastify/http-proxy 9.0.0 through 11.6.5 parameterized rewritePrefix suffix amputation and path injection (CVE-2026-120213 / GHSA-h3vp-4jfr-v364, CVSS 9.1 Critical, plus CVE-2026-120214 / GHSA-hr26-gmr2-pwcv, CVSS 5.9 Medium): When an application configures @fastify/http-proxy with route parameters in prefix and rewritePrefix (for example prefix: '/users/:tenantId/avatar' and rewritePrefix: '/internal/tenants/:tenantId/public-avatar'), request.params values are already percent-decoded by Fastify’s router (find-my-way). Because @fastify/http-proxy spliced request.params[name] directly into rewritePrefix with .replace(':' + name, value) without re-encoding it, sending a parameter containing %2f (/) together with %23 (#) or %3f (?), such as /users/admin%2fsecret-keys%23/avatar, decoded into /internal/tenants/admin/secret-keys#/public-avatar. The injected # or ? turned the mandatory /public-avatar suffix into a fragment or query string and routed the proxied request to /internal/tenants/admin/secret-keys without using any .. traversal segments. Separately, in 11.6.0 through 11.6.2 (CVE-2026-120214), validateDestination() normalized literal backslashes before decodeURIComponent(), allowing %5c..%5c sequences to survive validation. Fixed in @fastify/http-proxy 11.6.6.
  2. @fastify/reply-from <= 12.8.0 WHATWG URL backslash and control-character traversal (CVE-2026-117518 / GHSA-vp2r-3vgv-32g9, CVSS 8.2 High): In lib/utils.js, buildURL(source, reqBase) checked decodeURIComponent(source) only for '..', '/..', and '../' with forward slashes before passing source to new URL(source, reqBase). Because the WHATWG URL parser normalizes backslashes (\ and %5c) to / on http:, https:, ws:, and wss: schemes and strips ASCII control characters (\t, \n, \r), requests such as /files/x%5c..%5c..%5cadmin or /files/x/%09..%09/admin bypassed the check and escaped the upstream proxy prefix. Fixed in @fastify/reply-from 12.8.1.
  3. @fastify/multipart 5.3.0 through 10.1.6 unpropagated parser error hangs delayed stream consumers (CVE-2026-117531 / GHSA-5849-5m6q-9632, CVSS 5.9 Medium): When a multipart upload body satisfied Content-Length without a closing --boundary-- marker inside a file part, the busboy error listener called currentFile.destroy() with no error argument. Any route handler that performed await work (such as a database or auth check) before piping part.file attached to a stream that was already destroyed without an error or 'end' event, causing pipeline(part.file, ...) or part.toBuffer() to hang forever and leak the connection. Fixed in @fastify/multipart 10.1.7.
  4. @fastify/secure-session 7.5.0 through 8.4.1 unsigned fallback on cookie: { signed: true } (CVE-2026-117549 / GHSA-4cgq-x5f7-r8jv, CVSS 4.2 Medium), fastify 5.8.0 through 5.12.7 streaming handlerTimeout process crash (CVE-2026-120216 / GHSA-3qgw-9275-xf8w, CVSS 5.9 Medium), and @fastify/cors 8.2.0 through 11.3.1 onSend preflight crash (CVE-2026-120215 / GHSA-8c3j-mm64-257c, CVSS 3.7 Low): In @fastify/secure-session, when unsignedCookie.valid was false, the request hook left cookie set to the raw cookie string and passed it to decodeSecureSession() anyway, allowing a holder of an unexpired cookie to strip its signature after a @fastify/cookie signing-secret rotation. In fastify (5.8.0 to 5.12.7) and @fastify/cors (8.2.0 to 11.3.1), a streaming response that exceeded a nonzero handlerTimeout after sending headers (CVE-2026-120216) or a single OPTIONS preflight when hook: 'onSend' was set (CVE-2026-120215) attempted a second header write, raising an uncaught ERR_HTTP_HEADERS_SENT exception that terminated the Node.js process.

What to do now: Upgrade @fastify/http-proxy to >= 11.6.6, @fastify/reply-from to >= 12.8.1, @fastify/multipart to >= 10.1.7, @fastify/secure-session to >= 8.4.2, @fastify/cors to >= 11.4.0, and fastify to >= 5.12.8.

Affected packages

EcosystemPackageCVE / GHSASeverityAffected versionsFixed versionVulnerable component
npm@fastify/http-proxyCVE-2026-120213 (GHSA-h3vp-4jfr-v364)CVSS 9.1 Critical>= 9.0.0, <= 11.6.511.6.6index.js (rewritePrefixWithVariables.replace() on unencoded request.params)
npm@fastify/reply-fromCVE-2026-117518 (GHSA-vp2r-3vgv-32g9)CVSS 8.2 High<= 12.8.012.8.1lib/utils.js (buildURL() forward-slash-only .. check before new URL())
npm@fastify/http-proxyCVE-2026-120214 (GHSA-hr26-gmr2-pwcv)CVSS 5.9 Medium>= 11.6.0, <= 11.6.211.6.3 (11.6.6)index.js (validateDestination() backslash normalization order)
npm@fastify/multipartCVE-2026-117531 (GHSA-5849-5m6q-9632)CVSS 5.9 Medium>= 5.3.0, <= 10.1.610.1.7index.js (currentFile.destroy() called without err on truncated multipart body)
npmfastifyCVE-2026-120216 (GHSA-3qgw-9275-xf8w)CVSS 5.9 Medium>= 5.8.0, <= 5.12.7 (with nonzero handlerTimeout)5.12.8lib/route.js and lib/error-handler.js (ERR_HTTP_HEADERS_SENT after streaming headers sent)
npm@fastify/secure-sessionCVE-2026-117549 (GHSA-4cgq-x5f7-r8jv)CVSS 4.2 Medium>= 7.5.0, <= 8.4.1 (with cookie: { signed: true })8.4.2index.js (verify hook falls through when unsignedCookie.valid !== true)
npm@fastify/corsCVE-2026-120215 (GHSA-8c3j-mm64-257c)CVSS 3.7 Low>= 8.2.0, < 11.4.0 (with hook: 'onSend')11.4.0index.js (reply.send() called inside onSend hook on OPTIONS preflight)

Technical analysis

1. @fastify/http-proxy 11.6.6 (CVE-2026-120213) and @fastify/reply-from 12.8.1 (CVE-2026-117518): escaping upstream proxy prefixes without literal ../

Many API gateways use @fastify/http-proxy with parameterized prefix and rewritePrefix options to confine unauthenticated or tenant-scoped callers to a single upstream sub-resource, such as:

fastify.register(httpProxy, {
  upstream: 'http://internal-backend:8080',
  prefix: '/tenants/:tenantId/avatar',
  rewritePrefix: '/v1/tenants/:tenantId/public-profile/avatar'
})

When Fastify’s router (find-my-way) matches /tenants/:tenantId/avatar, it percent-decodes the captured :tenantId segment before populating request.params.tenantId. In @fastify/http-proxy 9.0.0 through 11.6.5, the pre-handler substituted each decoded request.params entry directly into rewritePrefixWithVariables:

--- a/index.js
+++ b/index.js
@@ -827,7 +827,17 @@ async function fastifyHttpProxy (fastify, opts) {
 
       let rewritePrefixWithVariables = rewritePrefix
       for (const [name, value] of Object.entries(params)) {
-        rewritePrefixWithVariables = rewritePrefixWithVariables.replace(`:${name}`, value)
+        const paramValue = name === '*'
+          ? value.replaceAll('#', '%23').replaceAll('?', '%3F')
+          : encodeURIComponent(value)
+        rewritePrefixWithVariables = rewritePrefixWithVariables.replace(`:${name}`, paramValue)
       }

Because value was not re-encoded with encodeURIComponent(), an attacker did not need .. dot-segments to escape /v1/tenants/:tenantId/public-profile/avatar:

  • Sending GET /tenants/acme%2fbilling-secrets%23/avatar matched the :tenantId parameter in find-my-way (which allows %2f inside a parameter segment) and decoded request.params.tenantId to acme/billing-secrets#.
  • Splicing that decoded string into rewritePrefix produced /v1/tenants/acme/billing-secrets#/public-profile/avatar.
  • When @fastify/reply-from parsed that target URL, #/public-profile/avatar was treated as a client-side URL fragment and stripped from the outbound HTTP request, forwarding GET /v1/tenants/acme/billing-secrets to the internal upstream. Using %3f (?) achieved the same suffix amputation by turning /public-profile/avatar into a query string (?public-profile/avatar).

In @fastify/reply-from <= 12.8.0 (CVE-2026-117518 / GHSA-vp2r-3vgv-32g9), buildURL(source, reqBase) in lib/utils.js suffered from a complementary parser mismatch when reqBase used an http:, https:, ws:, or wss: URL scheme:

--- a/lib/utils.js
+++ b/lib/utils.js
@@ -96,8 +103,26 @@ function buildURL (source, reqBase) {
-  const decoded = decodeURIComponent(source)
-  if (decoded === '..' || decoded.includes('/..') || decoded.includes('../')) {
+  const queryIndex = source.indexOf('?')
+  const fragmentIndex = source.indexOf('#')
+  let pathEnd = source.length
+  if (queryIndex !== -1) pathEnd = queryIndex
+  if (fragmentIndex !== -1 && fragmentIndex < pathEnd) pathEnd = fragmentIndex
+
+  const sourcePath = source.slice(0, pathEnd)
+  decodeURIComponent(source)
+  const decodedPath = decodeURIComponent(sourcePath)
+  const normalizedPath = decodedPath.replaceAll('\\', '/')
+  const pathSegments = normalizedPath.split('/')
+
+  if (
+    hasControlCharacter(source) ||
+    hasControlCharacter(decodedPath) ||
+    decodedPath.includes('\\') ||
+    source.startsWith(' ') ||
+    (pathEnd === source.length && source.endsWith(' ')) ||
+    pathSegments.includes('.') ||
+    pathSegments.includes('..')
+  ) {
     const err = new Error('source/request contain invalid characters')
     err.statusCode = 400
     throw err

Previously, buildURL() only checked whether decodeURIComponent(source) contained '..', '/..', or '../', and then handed source to new URL(source, base). Under the WHATWG URL Standard, “special” schemes (http, https, ws, wss) treat backslashes (\) as path separators and strip ASCII tab/newline characters (0x09, 0x0A, 0x0D) before resolving dot-segments. A request to /files/x%5c..%5c..%5cadmin or /files/x/%09..%09/admin contained neither '/..' nor '../' during buildURL()’s string check, yet new URL() resolved it to /admin on the upstream host. Commit b461e9cbee (v12.8.1) rejects control characters, backslashes, leading/trailing spaces, and . or .. segments in the path component before calling new URL().

2. @fastify/multipart 10.1.7 (CVE-2026-117531): silent currentFile.destroy() hangs async req.parts() consumers

When a Fastify route iterates for await (const part of req.parts()) and performs any asynchronous operation (such as checking user permissions or querying a database) before consuming part.file, @fastify/multipart continues reading the incoming HTTP body into the internal busboy parser in the background.

If a client sends a request whose Content-Length is complete (so the socket does not abort) but whose payload ends inside a file part without the closing --boundary-- delimiter, busboy emits Unexpected end of form. In @fastify/multipart 5.3.0 through 10.1.6, eos cleanup called currentFile.destroy() with no error argument:

--- a/index.js
+++ b/index.js
@@ -497,7 +497,12 @@ function fastifyMultipart (fastify, options, done) {
         request.unpipe(bb)
 
         if ((err || request.aborted) && currentFile) {
-          currentFile.destroy()
+          // Destroy the file stream with the error so that consumers which
+          // attach their stream handlers after the fact (e.g. after an async
+          // operation) still observe the failure instead of hanging.
+          currentFile.destroy(err)
           currentFile = null
         }
       }

In Node.js streams, calling stream.destroy() without an Error marks the readable stream as destroyed without recording an error and without emitting 'end'. When the route handler’s await resolved 10 milliseconds later and passed part.file to await pipeline(part.file, writable) or await part.toBuffer(), the promise never resolved or rejected, leaving the HTTP connection and any held database transactions or semaphores open indefinitely. Commit 437d3e7c11 (v10.1.7) passes err to currentFile.destroy(err).

3. @fastify/secure-session 8.4.2 (CVE-2026-117549), fastify 5.12.8 (CVE-2026-120216), and @fastify/cors 11.4.0 (CVE-2026-120215)

  • @fastify/secure-session signature strip after cookie-secret rotation (CVE-2026-117549): When configured with cookie: { signed: true }, @fastify/secure-session wraps its libsodium crypto_secretbox ciphertext in a @fastify/cookie HMAC signature. In 7.5.0 through 8.4.1, the onRequest hook checked if (options.cookie.signed) and ran const unsignedCookie = fastify.unsignCookie(cookie), but only reassigned cookie = unsignedCookie.value inside if (unsignedCookie.valid === true) with no else branch:
    --- a/index.js
    +++ b/index.js
    @@ -254,6 +254,12 @@ function fastifySecureSession (fastify, options, next) {
               if (unsignedCookie.valid === true) {
                 cookie = unsignedCookie.value
    +          } else {
    +            cookie = undefined
               }
             }
    If an operator rotated the @fastify/cookie signing secret to invalidate existing sessions without rotating the libsodium encryption key, an attacker holding an old signed cookie (<base64-ciphertext>.<old-hmac>) could simply strip the .old-hmac suffix and send the raw <base64-ciphertext>. unsignCookie() returned { valid: false }, cookie kept its original <base64-ciphertext> value, and fastify.decodeSecureSession(cookie) decrypted the session normally. Commit e9312d3e3c (v8.4.2) sets cookie = undefined whenever unsignedCookie.valid !== true.
  • fastify 5.12.8 (CVE-2026-120216) and @fastify/cors 11.4.0 (CVE-2026-120215) ERR_HTTP_HEADERS_SENT crashes: In fastify 5.8.0 through 5.12.7, when a server set a nonzero handlerTimeout and a route returned a Readable stream (such as an SSE or chunked download endpoint), a slow stream that stayed open past handlerTimeout after reply.raw.headersSent became true caused the timeout timer and fallbackErrorHandler in lib/error-handler.js to call reply.raw.writeHead(), throwing an uncaught ERR_HTTP_HEADERS_SENT exception that crashed the entire Node.js process (commit 15fbadfcd9 in v5.12.8 aborts the in-flight socket with reply.raw.destroy(error) when reply.raw.headersSent === true). Similarly, registering @fastify/cors with hook: 'onSend' caused every OPTIONS preflight request to call reply.send() from inside the onSend hook, re-entering the send pipeline and throwing ERR_HTTP_HEADERS_SENT (commit 32cf1c29f3 in v11.4.0 removes 'onSend' from validHooks so registration fails fast at startup).

Detection and remediation

# 1. Check installed Fastify core and plugin versions across Node.js projects
npm ls fastify @fastify/http-proxy @fastify/reply-from @fastify/multipart @fastify/secure-session @fastify/cors 2>/dev/null || true

# 2. Search lockfiles and manifests for vulnerable versions
rg -n '"(@fastify/(http-proxy|reply-from|multipart|secure-session|cors)|fastify)"' \
  package.json package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null

# 3. Audit source code for parameterized rewritePrefix, hook: 'onSend' in @fastify/cors, or handlerTimeout
rg -n 'rewritePrefix|reply\.from\(|handlerTimeout|decodeSecureSession' \
  --glob '*.{js,ts,mjs,cjs}' . 2>/dev/null
  1. Upgrade @fastify/http-proxy to >= 11.6.6 and @fastify/reply-from to >= 12.8.1: There is no configuration workaround for CVE-2026-120213 or CVE-2026-117518. Ensure that upgrading @fastify/http-proxy also refreshes transitive @fastify/reply-from to 12.8.1 in your lockfile.
  2. Upgrade @fastify/multipart to >= 10.1.7 and fastify to >= 5.12.8: If you cannot upgrade fastify immediately on a server that serves streaming routes, set handlerTimeout: 0 (the default) and enforce per-stream timeouts using request.signal or stream timers.
  3. Upgrade @fastify/secure-session to >= 8.4.2 and @fastify/cors to >= 11.4.0: Remember that retiring existing encrypted sessions in @fastify/secure-session requires rotating the 32-byte libsodium encryption key (or removing the old key from the key array), not only rotating the @fastify/cookie signing secret.

Timeline

  • 2026-09-26: @fastify/http-proxy releases v11.6.3 (commit 4defb68f43), normalizing percent-encoded backslashes in validateDestination() (CVE-2026-120214).
  • 2026-11-02 (08:50 to 10:51 UTC): Fastify maintainers tag and publish @fastify/cors v11.4.0 (08:51 UTC), @fastify/http-proxy v11.6.6 (08:55 UTC), @fastify/reply-from v12.8.1 (09:01 UTC), @fastify/secure-session v8.4.2 (09:08 UTC), @fastify/multipart v10.1.7 (09:11 UTC), and fastify v5.12.8 / v6.0.0-alpha.6 (10:51 UTC).
  • 2026-11-02 (11:17 UTC): The OpenJS Foundation CNA publishes CVE-2026-117518, CVE-2026-117531, CVE-2026-117549, and CVE-2026-120213 through CVE-2026-120216 to NVD and the GitHub Advisory Database.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.

References