New from Wiz Research: Critical NGINX flaw. Understand the risk and impact.
Vulnerability DatabaseGHSA-5vm7-vc2x-p3w2

GHSA-5vm7-vc2x-p3w2: 
JavaScript vulnerability analysis and mitigation

Summary

There are vulnerabilities in the function processRequest (used by the middleware created by the functions graphqlUploadExpress and graphqlUploadKoa) when processing GraphQL multipart requests. Requests with file upload map operations object paths traversing other uploads or containing __proto__ keys can, due to insufficient validation, result in prototype manipulation and upload state corruption that could cause an uncaught exception that terminates the Node.js process. An attacker can therefore cause a denial of service by sending a maliciously crafted multipart request that terminates the process handling requests.

Details

While processing a multipart request, when setting an Upload instance in the GraphQL operations according to the object path specified by the client in the file upload map, there is no check beforehand that the path doesn’t set the upload in a problematic place: https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/processRequest.mjs#L205 Problematic places can be:

  • Within an already placed Upload instance. Replacing Upload instance properties with another Upload instance can cause uncaught exceptions later when they are used.
  • Under a __proto__ key. Setting an upload under a __proto__ key can change the prototype of an object in the GraphQL operations instead of setting an ordinary property. For example, in a GraphQL multipart request, with operations like this:
    {
      "query": "mutation ($file: Upload!) { upload(file: $file) { success } }",
      "variables": {
        "file": {
          "promise": {
            "filename": true
          }
        }
      }
    }
    And a file upload map like this:
    {
      "1": ["variables.file.__proto__"]
    }
    The client-supplied file object acquires an Upload instance as its prototype, causing it to pass the instanceof Upload check used by the scalar GraphQLUpload since graphql-upload v10 (see #181): https://github.com/jaydenseric/graphql-upload/blob/4824216bf46c94516e9f36d3e88ed0d5ae412126/GraphQLUpload.mjs#L77 The scalar then returns the promise data to application resolvers. The consequences depend on how the resolver code uses the file upload promise. A resolver using .then() on the value throws a TypeError because the object has no callable then method. A resolver using await receives the supplied object because await accepts non-promise values. While file upload details like filename and mimetype provided by the client already shouldn’t be trusted, resolver code expects them to at least be of a certain type. In this example, filename is a boolean instead of the expected string, which could cause unanticipated problems in resolver code that attempts to do things like use string methods on the value. Attempting to call createReadStream would fail. An attacker can therefore cause, depending on application resolver code, a mutation to fail after it has already persisted changes or allocated resources. Without appropriate transaction rollback or error cleanup, this could leave persisted data in an inconsistent state or resources unreleased. Prototype manipulation can also allow later file upload map paths to reach and modify an Upload instance through an inherited array element. For example, in a GraphQL multipart request that’s missing file fields, with operations like this:
{
  "variables": {
    "files": []
  }
}

And a file upload map like this:

{
  "1": ["variables.files.__proto__.0"],
  "2": ["variables.files.0.reject"]
}

Upload 1’s Upload instance has its method reject replaced, and similar to a previously explained example, when the request finishes without uploading files, calling reject causes an uncaught exception that could terminate the Node.js process. An array can inherit an element from its prototype. Reading that element returns the upload, even though the array itself does not contain it as an own property. An own-property-only safety check would miss the inherited upload, which the object-path setter can still reach and modify. The fix is to reject file upload map object paths that either:

  • Enter an existing Upload instance.
  • Contain a __proto__ segment.

Proposed fix

Reject a map path that has a __proto__ key, or that goes through an Upload instance, with the existing 400 "Invalid object path" error. The Upload check resolves each key with object-path's own get, so it sees the same values set will, including inherited array elements. Its cost stays linear in the path length. A GraphQL variable literally named __proto__ now gets a 400. Input object fields can't use that name because names starting with __ are reserved. The fix adds both checks and regression tests for these map paths:

  • variables.file.reject, the path behind the line 319 crash.
  • variables.file.file, the path behind the line 337 crash.
  • variables.file then variables.file.reject in the same entry.
  • variables.file.promise.then, which catches a check that only looks at the immediate parent.
  • variables.files.0.resolve, an upload in an array.
  • variables.file.__proto__, forging an upload.
  • variables.files.__proto__.0, the inherited array element. The line 87 triggers (a disconnect, or a body without its closing boundary) are stopped by the same check when map is parsed, so they don't need their own tests. All 7 tests fail without the fix. Removing either check makes its own tests fail. Each test sends every file named in map, so without the fix the tests fail on the missing 400 error, not by crashing the process. Moving resolve, reject and file into processRequest's own state would also stop both crashes, but a path could still replace upload.promise.

Proof of concept

Tested with Node.js 24.22.2, graphql-upload 18.0.1, Express 5.3.0 and graphql 17.0.2. Install the packages:

mkdir poc && cd poc
npm init -y
npm install graphql-upload@18.0.1 express@5.3.0 graphql@17.0.2

Save this as server.mjs and start it with node server.mjs:

import express from "express";
import graphqlUploadExpress from "graphql-upload/graphqlUploadExpress.mjs";
express()
  .use(graphqlUploadExpress())
  .use((_request, response) => {
    response.send("OK");
  })
  .listen(3000, "127.0.0.1");

In another terminal, send this request:

curl http://127.0.0.1:3000 \
  -F 'operations={"variables":{"file":null}}' \
  -F 'map={"1":["variables.file"],"2":["variables.file.reject"]}'

curl gets no response (Empty reply from server), and the server exits:

file:///.../node_modules/graphql-upload/processRequest.mjs:319
          upload.reject(createError(400, "File missing in the request."));
                 ^
TypeError: upload.reject is not a function

Start the server again and send the same request with variables.file.file instead of variables.file.reject. curl gets 200 OK, then the server exits with TypeError: Cannot read properties of undefined (reading 'release') from line 337. Both requests also crash a plain node:http server that calls processRequest directly, on 10.0.0, 11.0.0, 13.0.0, 15.0.2, 16.0.2, 17.0.0 and 18.0.1. They don't crash 8.1.0 or 9.0.0.

Impact

Applications accepting GraphQL multipart requests using the functions processRequest, graphqlUploadExpress, or graphqlUploadKoa from affected versions of graphql-upload are vulnerable to denial of service. A maliciously crafted request can cause an uncaught exception that terminates the Node.js process, interrupting other requests handled by that process. This does not require successful GraphQL operation execution or any file contents to be uploaded. Authentication is required only if enforced before upload processing. Attackers can also bypass GraphQLUpload scalar input validation, supplying client-controlled values where resolvers expect file upload promises and file details. Depending on application resolver code, this can cause mutations to fail after changes have been persisted or resources allocated. Without appropriate transaction rollback or error cleanup, persisted data could be left inconsistent or resources unreleased. These additional consequences depend on the application and are not demonstrated by the examples alone.


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