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:
@fastify/http-proxy9.0.0through11.6.5parameterizedrewritePrefixsuffix amputation and path injection (CVE-2026-120213/GHSA-h3vp-4jfr-v364, CVSS 9.1 Critical, plusCVE-2026-120214/GHSA-hr26-gmr2-pwcv, CVSS 5.9 Medium): When an application configures@fastify/http-proxywith route parameters inprefixandrewritePrefix(for exampleprefix: '/users/:tenantId/avatar'andrewritePrefix: '/internal/tenants/:tenantId/public-avatar'),request.paramsvalues are already percent-decoded by Fastify’s router (find-my-way). Because@fastify/http-proxysplicedrequest.params[name]directly intorewritePrefixwith.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-avatarsuffix into a fragment or query string and routed the proxied request to/internal/tenants/admin/secret-keyswithout using any..traversal segments. Separately, in11.6.0through11.6.2(CVE-2026-120214),validateDestination()normalized literal backslashes beforedecodeURIComponent(), allowing%5c..%5csequences to survive validation. Fixed in@fastify/http-proxy 11.6.6.@fastify/reply-from<= 12.8.0WHATWGURLbackslash and control-character traversal (CVE-2026-117518/GHSA-vp2r-3vgv-32g9, CVSS 8.2 High): Inlib/utils.js,buildURL(source, reqBase)checkeddecodeURIComponent(source)only for'..','/..', and'../'with forward slashes before passingsourcetonew URL(source, reqBase). Because the WHATWGURLparser normalizes backslashes (\and%5c) to/onhttp:,https:,ws:, andwss:schemes and strips ASCII control characters (\t,\n,\r), requests such as/files/x%5c..%5c..%5cadminor/files/x/%09..%09/adminbypassed the check and escaped the upstream proxy prefix. Fixed in@fastify/reply-from 12.8.1.@fastify/multipart5.3.0through10.1.6unpropagated parser error hangs delayed stream consumers (CVE-2026-117531/GHSA-5849-5m6q-9632, CVSS 5.9 Medium): When a multipart upload body satisfiedContent-Lengthwithout a closing--boundary--marker inside a file part, the busboy error listener calledcurrentFile.destroy()with no error argument. Any route handler that performedawaitwork (such as a database or auth check) before pipingpart.fileattached to a stream that was already destroyed without an error or'end'event, causingpipeline(part.file, ...)orpart.toBuffer()to hang forever and leak the connection. Fixed in@fastify/multipart 10.1.7.@fastify/secure-session7.5.0through8.4.1unsigned fallback oncookie: { signed: true }(CVE-2026-117549/GHSA-4cgq-x5f7-r8jv, CVSS 4.2 Medium),fastify5.8.0through5.12.7streaminghandlerTimeoutprocess crash (CVE-2026-120216/GHSA-3qgw-9275-xf8w, CVSS 5.9 Medium), and@fastify/cors8.2.0through11.3.1onSendpreflight crash (CVE-2026-120215/GHSA-8c3j-mm64-257c, CVSS 3.7 Low): In@fastify/secure-session, whenunsignedCookie.validwasfalse, the request hook leftcookieset to the raw cookie string and passed it todecodeSecureSession()anyway, allowing a holder of an unexpired cookie to strip its signature after a@fastify/cookiesigning-secret rotation. Infastify(5.8.0to5.12.7) and@fastify/cors(8.2.0to11.3.1), a streaming response that exceeded a nonzerohandlerTimeoutafter sending headers (CVE-2026-120216) or a singleOPTIONSpreflight whenhook: 'onSend'was set (CVE-2026-120215) attempted a second header write, raising an uncaughtERR_HTTP_HEADERS_SENTexception 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
| Ecosystem | Package | CVE / GHSA | Severity | Affected versions | Fixed version | Vulnerable component |
|---|---|---|---|---|---|---|
| npm | @fastify/http-proxy | CVE-2026-120213 (GHSA-h3vp-4jfr-v364) | CVSS 9.1 Critical | >= 9.0.0, <= 11.6.5 | 11.6.6 | index.js (rewritePrefixWithVariables.replace() on unencoded request.params) |
| npm | @fastify/reply-from | CVE-2026-117518 (GHSA-vp2r-3vgv-32g9) | CVSS 8.2 High | <= 12.8.0 | 12.8.1 | lib/utils.js (buildURL() forward-slash-only .. check before new URL()) |
| npm | @fastify/http-proxy | CVE-2026-120214 (GHSA-hr26-gmr2-pwcv) | CVSS 5.9 Medium | >= 11.6.0, <= 11.6.2 | 11.6.3 (11.6.6) | index.js (validateDestination() backslash normalization order) |
| npm | @fastify/multipart | CVE-2026-117531 (GHSA-5849-5m6q-9632) | CVSS 5.9 Medium | >= 5.3.0, <= 10.1.6 | 10.1.7 | index.js (currentFile.destroy() called without err on truncated multipart body) |
| npm | fastify | CVE-2026-120216 (GHSA-3qgw-9275-xf8w) | CVSS 5.9 Medium | >= 5.8.0, <= 5.12.7 (with nonzero handlerTimeout) | 5.12.8 | lib/route.js and lib/error-handler.js (ERR_HTTP_HEADERS_SENT after streaming headers sent) |
| npm | @fastify/secure-session | CVE-2026-117549 (GHSA-4cgq-x5f7-r8jv) | CVSS 4.2 Medium | >= 7.5.0, <= 8.4.1 (with cookie: { signed: true }) | 8.4.2 | index.js (verify hook falls through when unsignedCookie.valid !== true) |
| npm | @fastify/cors | CVE-2026-120215 (GHSA-8c3j-mm64-257c) | CVSS 3.7 Low | >= 8.2.0, < 11.4.0 (with hook: 'onSend') | 11.4.0 | index.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/avatarmatched the:tenantIdparameter infind-my-way(which allows%2finside a parameter segment) and decodedrequest.params.tenantIdtoacme/billing-secrets#. - Splicing that decoded string into
rewritePrefixproduced/v1/tenants/acme/billing-secrets#/public-profile/avatar. - When
@fastify/reply-fromparsed that target URL,#/public-profile/avatarwas treated as a client-side URL fragment and stripped from the outbound HTTP request, forwardingGET /v1/tenants/acme/billing-secretsto the internal upstream. Using%3f(?) achieved the same suffix amputation by turning/public-profile/avatarinto 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-sessionsignature strip after cookie-secret rotation (CVE-2026-117549): When configured withcookie: { signed: true },@fastify/secure-sessionwraps its libsodiumcrypto_secretboxciphertext in a@fastify/cookieHMAC signature. In7.5.0through8.4.1, theonRequesthook checkedif (options.cookie.signed)and ranconst unsignedCookie = fastify.unsignCookie(cookie), but only reassignedcookie = unsignedCookie.valueinsideif (unsignedCookie.valid === true)with noelsebranch:
If an operator rotated the--- 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 } }@fastify/cookiesigning secret to invalidate existing sessions without rotating the libsodium encryptionkey, an attacker holding an old signed cookie (<base64-ciphertext>.<old-hmac>) could simply strip the.old-hmacsuffix and send the raw<base64-ciphertext>.unsignCookie()returned{ valid: false },cookiekept its original<base64-ciphertext>value, andfastify.decodeSecureSession(cookie)decrypted the session normally. Commite9312d3e3c(v8.4.2) setscookie = undefinedwheneverunsignedCookie.valid !== true.fastify5.12.8(CVE-2026-120216) and@fastify/cors11.4.0(CVE-2026-120215)ERR_HTTP_HEADERS_SENTcrashes: Infastify5.8.0through5.12.7, when a server set a nonzerohandlerTimeoutand a route returned aReadablestream (such as an SSE or chunked download endpoint), a slow stream that stayed open pasthandlerTimeoutafterreply.raw.headersSentbecametruecaused the timeout timer andfallbackErrorHandlerinlib/error-handler.jsto callreply.raw.writeHead(), throwing an uncaughtERR_HTTP_HEADERS_SENTexception that crashed the entire Node.js process (commit15fbadfcd9inv5.12.8aborts the in-flight socket withreply.raw.destroy(error)whenreply.raw.headersSent === true). Similarly, registering@fastify/corswithhook: 'onSend'caused everyOPTIONSpreflight request to callreply.send()from inside theonSendhook, re-entering the send pipeline and throwingERR_HTTP_HEADERS_SENT(commit32cf1c29f3inv11.4.0removes'onSend'fromvalidHooksso 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
- Upgrade
@fastify/http-proxyto>= 11.6.6and@fastify/reply-fromto>= 12.8.1: There is no configuration workaround forCVE-2026-120213orCVE-2026-117518. Ensure that upgrading@fastify/http-proxyalso refreshes transitive@fastify/reply-fromto12.8.1in your lockfile. - Upgrade
@fastify/multipartto>= 10.1.7andfastifyto>= 5.12.8: If you cannot upgradefastifyimmediately on a server that serves streaming routes, sethandlerTimeout: 0(the default) and enforce per-stream timeouts usingrequest.signalor stream timers. - Upgrade
@fastify/secure-sessionto>= 8.4.2and@fastify/corsto>= 11.4.0: Remember that retiring existing encrypted sessions in@fastify/secure-sessionrequires rotating the 32-byte libsodium encryptionkey(or removing the old key from thekeyarray), not only rotating the@fastify/cookiesigningsecret.
Timeline
- 2026-09-26:
@fastify/http-proxyreleasesv11.6.3(commit4defb68f43), normalizing percent-encoded backslashes invalidateDestination()(CVE-2026-120214). - 2026-11-02 (
08:50to10:51 UTC): Fastify maintainers tag and publish@fastify/corsv11.4.0(08:51 UTC),@fastify/http-proxyv11.6.6(08:55 UTC),@fastify/reply-fromv12.8.1(09:01 UTC),@fastify/secure-sessionv8.4.2(09:08 UTC),@fastify/multipartv10.1.7(09:11 UTC), andfastifyv5.12.8/v6.0.0-alpha.6(10:51 UTC). - 2026-11-02 (
11:17 UTC): The OpenJS Foundation CNA publishesCVE-2026-117518,CVE-2026-117531,CVE-2026-117549, andCVE-2026-120213throughCVE-2026-120216to 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
- OpenJS Foundation CNA Security Advisories (2 November 2026): CVE-2026-120213 to CVE-2026-120216 and CVE-2026-117518 to CVE-2026-117549
- fastify/fastify-http-proxy release v11.6.6 and commit 25c0d117da (CVE-2026-120213 / GHSA-h3vp-4jfr-v364)
- fastify/fastify-reply-from release v12.8.1 and commit b461e9cbee (CVE-2026-117518 / GHSA-vp2r-3vgv-32g9)
- fastify/fastify-multipart release v10.1.7 and commit 437d3e7c11 (CVE-2026-117531 / GHSA-5849-5m6q-9632)
- fastify/fastify-secure-session release v8.4.2 and commit e9312d3e3c (CVE-2026-117549 / GHSA-4cgq-x5f7-r8jv)
- fastify/fastify release v5.12.8 and commit 15fbadfcd9 (CVE-2026-120216 / GHSA-3qgw-9275-xf8w)
- fastify/fastify-cors release v11.4.0 and commit 32cf1c29f3 (CVE-2026-120215 / GHSA-8c3j-mm64-257c)