Skip to content

A compressed HTTP body sounds like a bandwidth detail. Node2Shell shows why it also belongs in a security review: decoding attacker-controlled data can reach native code beneath your JavaScript.

The issue is CVE-2026-111497, a flaw in the Brotli decoder bundled with Node.js. The Node.js project rated it High and released fixes on October 21, 2026. Possible outcomes include a process crash, disclosure of process memory, and remote code execution. [1][2]

Term Meaning
Brotli A compression format, widely used on the web. HTTP marks it with Content-Encoding: br.
Native code Code compiled to machine instructions (here, C), running underneath JavaScript. Node.js uses it for heavy work such as compression.
Out-of-bounds write Writing data past the end of a memory area reserved for it, which corrupts whatever lives next to it.
Middleware Code that runs as part of an application’s request–response cycle, for all requests or only some routes. Parsing the request body is a common example.
WAF Web Application Firewall: a filter in front of your application that inspects incoming traffic.

A decoder reconstructs the original data from a compressed stream, checking that the stream makes sense as it goes.

Here, an invalid block transition was treated as if the input were merely incomplete. Instead of stopping with a permanent error, the streaming decoder could keep adding input bytes to an internal buffer only eight bytes long, and write past its end. That out-of-bounds write corrupts process memory. [1]

That explains how a JavaScript service can suffer a memory-corruption vulnerability. The faulty operation happens inside native code, not in your JavaScript.

The bug lives in Google’s Brotli library itself, which Node.js bundles. Affected versions run from 1.0.3 to 1.2.0, except the fixed releases 1.0.10 and 1.1.1. [2][6]

There are two useful places to start looking.

Incoming requests. In Express 5, the body parsers (body-parser 2.x) can inflate compressed request bodies before your route handler receives them. Brotli support arrived in body-parser 2.0.0, and inflation is enabled by default. A request carrying Content-Encoding: br can therefore trigger decompression as part of parsing. [4] Express 4 with body-parser 1.x does not decode Brotli bodies, so it does not open this particular path. [3][4]

Imagine an API that accepts JSON. Its handler validates the resulting object carefully, but decompression happens earlier, and before any authentication check that runs inside your routes. Checking the JSON fields cannot repair a memory bug encountered while preparing that object.

Express is not the only possibility, but supporting Brotli is not the same as using the affected library. A package may ship its own decoder. What matters is whether attacker-supplied data reaches the bundled decoder, for example through Node.js’s node:zlib Brotli functions. [1] So for each parser in your stack, whatever the framework, check how it actually decompresses.

Responses from other servers. Imperva also demonstrated the vulnerability through a Brotli response consumed by Node.js’s built-in fetch(), which decodes Brotli responses automatically. [3] That makes features which retrieve external content worth reviewing, alongside public API endpoints.

A bare Node.js HTTP server does not automatically decode every incoming Brotli body. The application needs a path that reaches the decoder.

For a concrete review, trace the data through three questions:

  1. Who controls the compressed bytes?
  2. Which middleware or client decodes them?
  3. Which runtime executes that operation?

The framework name alone cannot answer those questions.

What did researchers actually demonstrate?

Section titled “What did researchers actually demonstrate?”

Imperva reported code execution on the official Node.js 24.22.0 Linux arm64 image, using both incoming request bodies and consumed responses. It tested specific combinations, not every release in between: body-parser 2.0.0 on its own, Express 5.0.0 with body-parser 2.0.1, and Express 5.3.0 with body-parser 2.3.0. The same inputs were rejected on 24.22.1. [3]

The proof needed multiple attempts. It established exploitation for those tested builds and configurations, rather than for every architecture or application. A successful laboratory demonstration also does not establish that production systems have already been compromised.

These are the Node.js security releases published for this issue: [1]

Node.js release line Fixed release
22.x 22.23.4
24.x 24.22.1
26.x 26.12.1

Use these versions or newer supported releases containing the fix.

If you run Node.js in containers, the fix arrives through the container base image: the image your container is built from, such as node:24. It decides which Node.js executable your app runs on, so the image must be updated and rebuilt.

End-of-life versions are always affected when a security release occurs, and receive no fix. [1] Check the Node.js release schedule to see whether your line, Node.js 20 for example, has reached end-of-life, and move unsupported installations onto a supported line. [9]

The underlying dependency matters beyond this one runtime, too. Google’s Brotli project lists fixes in 1.0.10, 1.1.1, and 1.2.1. [2][6] Other software embedding Brotli needs its own update: Bun, for example, fixed it in 1.4.4. [5] The Node2Shell nickname does not define the full affected ecosystem.

Start with:

Terminal window
node -p "JSON.stringify({node:process.version, executable:process.execPath})"

This reports the version and executable path for the Node process you just launched. It does not inspect an already-running service. Your terminal, process manager, and container may use different installations.

For stronger confirmation, record the same values in the application’s private startup logs after deployment:

console.info("Runtime:", {
node: process.version,
executable: process.execPath,
});

Node’s process API exposes these values directly. [7] Keep the log internal; there is no need to publish a diagnostic endpoint.

My deployment checklist would be:

  1. Identify each runtime used by the service, workers, and scheduled jobs.
  2. Update the deployment’s runtime or container base image.
  3. Rebuild and redeploy the affected artifacts.
  4. Restart or replace old processes.
  5. Confirm the runtime in the newly started application and test normal traffic.

A clean npm audit report does not complete this check. npm audits package dependencies; it does not certify that the Node executable running them is patched. [8] Updating an npm package, Express included, does not replace that executable either.

If the update needs a short rollout window

Section titled “If the update needs a short rollout window”

Where compressed request bodies are unnecessary, disabling inflation makes the parser reject them:

app.use(express.json({ inflate: false }));

Apply the same option to every body parser you use, including express.raw(), express.text(), and express.urlencoded(). Put it in the actual parser configuration, before any other middleware decodes the body. [4]

This rejects other compressed encodings too, so test legitimate clients. It only covers the request-parsing path; review fetch() calls and other response handling separately.

Imperva has published WAF protection, but an inbound filter does not cover a response your application fetches elsewhere. [3] The runtime update is what fixes the shared decoder flaw.

The question I would put in the deployment review is simple: which running process now contains the fix, and how have we verified it? That turns a security update from a checked box into something we can demonstrate.

  1. Node.js — Wednesday, October 21, 2026 Security Releases
  2. CVE-2026-111497 record (Google, CVE Program)
  3. Imperva — Node2Shell: From Brotli Data to Remote Code Execution
  4. Express — body-parser documentation
  5. Bun — Security advisory GHSA-663w-cv8g-jj2p
  6. Google Brotli — v1.2.1 release
  7. Node.js — process API
  8. npm — auditing package dependencies
  9. Node.js — release schedule