New from Wiz Research: Critical NGINX flaw. Understand the risk and impact.
Vulnerability DatabaseGHSA-qwwm-252j-9whw

GHSA-qwwm-252j-9whw: 
JavaScript vulnerability analysis and mitigation

Summary

There is a vulnerability in the function processRequest (used by the middleware created by the functions graphqlUploadExpress and graphqlUploadKoa) when processing GraphQL multipart requests. Duplicate file multipart form fields cause temporary file and file descriptor leaks because new resources are created each time duplicate files are processed, and only references to the final duplicate resources are retained for cleanup when the response closes or the Node.js process gracefully exits.

Details

While processing multipart request files, the file field name is used to retrieve the relevant Upload instance from the upload map: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/processRequest.mjs#L235 Because there is no check if the same upload has already been processed, if the option maxFiles set to > 1, when a duplicate is processed a new capacitor is created: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/processRequest.mjs#L247 The file upload stream is piped into it and the same Upload instance is resolved again: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/processRequest.mjs#L288-L289 This overwrites the original file upload resource reference with the new duplicate one: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/Upload.mjs#L23-L38 Later file upload resource cleanup only processes the final duplicate resources: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/processRequest.mjs#L330-L338 Each earlier capacitor is no longer reachable from map. fs-capacitor unlinks the temp file on destroy() or release() and on a graceful process exit; a signal leaves it. The readme's deduplication note covers one file referenced multiple times in operations, not several files using the same multipart request form field name: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/readme.md?plain=1#L43

Proof of concept

Save as server.mjs:

import express from "express";
import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";
const app = express();
app.use(
  "/graphql",
  graphqlUploadExpress({ maxFiles: 10, maxFileSize: 10000000 }),
  (req, res) => res.json({ ok: true }),
);
app.listen(3000, "127.0.0.1");

Install, create the two 500 KB files, and run:

npm i express@5.3.0 graphql@17.1.0 graphql-upload@18.0.1
head -c 500000 /dev/zero > a.bin; head -c 500000 /dev/zero > b.bin
mkdir tmp; TMPDIR=$PWD/tmp node server.mjs &
curl -s -o /dev/null -w '%{http_code}\n' \
  -F 'operations={"query":"{ ping }"}' \
  -F 'map={"0":["variables.file"]}' \
  -F '0=@a.bin;filename=a.bin' \
  -F '0=@b.bin;filename=b.bin' \
  http://127.0.0.1:3000/graphql

It prints:

200
$ ls -l tmp
-rw------- 1 user user 500000 ... capacitor-45d9c5a47fc7ea70af7943b5bdb1a7df.tmp

The response arrives and 1 500000-byte temp file remains in tmp. The same request with map {"0":["variables.file"],"1":["variables.other"]} and distinct names 0 and 1 leaves tmp empty.

Impact

Applications accepting GraphQL multipart requests using the functions processRequest, graphqlUploadExpress, or graphqlUploadKoa from affected versions of graphql-upload configured with the option maxFiles > 1 are vulnerable to denial of service. Multipart requests with duplicate file multipart form fields with the same name in the file upload map cause temporary files and open file descriptors to remain allocated after request/response completion. Repeated requests can exhaust disk space or available file descriptors, preventing the application from handling legitimate requests. With finite limits for maxFiles and maxFileSize configured, a single request can leave approximately (maxFiles - 1) × maxFileSize bytes of temporary file data on disk when maxFiles is > 1; the default limits impose no finite upper bound. Exploitation does not require successful GraphQL operation execution. Authentication is required only if the application enforces it before upload processing.


Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-5vm7-vc2x-p3w2HIGH7.5
  • JavaScript logoJavaScript
  • graphql-upload
NoNoNov 18, 2026
GHSA-p4q5-rhgr-hg46HIGH7.5
  • JavaScript logoJavaScript
  • @orpc/server
NoYesNov 18, 2026
GHSA-3xgv-mvj6-g78rMEDIUM6.5
  • JavaScript logoJavaScript
  • @modelcontextprotocol/inspector
NoYesNov 18, 2026
GHSA-qwwm-252j-9whwMEDIUM5.3
  • JavaScript logoJavaScript
  • graphql-upload
NoNoNov 18, 2026
GHSA-38j4-j742-j7r3LOW3.7
  • JavaScript logoJavaScript
  • @modelcontextprotocol/server-everything
NoYesNov 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management