Node2Shell CVEs: Brotli Out-of-Bounds Write in Node.js and What to Do Before KEV Catches Up

The Node.js project issued a cluster of advisories branded "Node2Shell" affecting the 26.x, 24.x, and 22.x release lines. The headline finding for defenders is CVE-2026-111497, described by the project as a flaw in the Node.js Brotli decoder that triggers an out-of-bounds write and permits remote code execution. A second high-severity entry, CVE-2026-105482, carries a CVSSv3 base score of 9.8 and spans the same three release lines. Neither has been confirmed exploited in the wild at the time of writing, but both sit in the exploitability class (unauthenticated, network-reachable, server-side) the CISA KEV catalog has been targeting fastest.

This post covers the mechanism, preconditions, exposure discovery, and pre-exploitation hardening.

What CVE-2026-111497 actually is

Brotli is a general-purpose compression algorithm Node.js exposes through the zlib module (as createBrotliDecompress, brotliDecompressSync, and the WebStream equivalents). Decompression routines are a classic source of memory-corruption bugs because the decoder must allocate output buffers whose size derives from attacker-controlled metadata inside the compressed stream. An out-of-bounds write in that path lets a crafted Brotli payload write past the end of a heap buffer. In a V8/Node process this generally lets a skilled attacker corrupt adjacent allocator metadata or object fields, achieving code execution inside the Node worker.

The project's advisory states the outcome plainly: "Node.js Brotli decoder out-of-bounds write permits remote code execution." Every currently supported release train is in scope. 22.x is the active LTS at the time of the advisory, so a large share of production Node deployments must patch.

The precondition an attacker needs

The attack surface is any code path that feeds untrusted Brotli-compressed bytes into the Node.js decoder. Typical exposure includes:

Brotli is not Node's default inbound decompression for HTTP: the built-in http module does not auto-decompress request bodies, and frameworks differ. The relevant question is whether any middleware or application code explicitly invokes the Brotli decoder on bytes that cross a trust boundary.

How to determine exposure

Start with an inventory of Node runtimes in use. A straightforward approach for Linux hosts:

# Enumerate Node binaries and their versions across a fleet
find / -xdev -type f \( -name node -o -name nodejs \) 2>/dev/null \
  | while read -r bin; do
      printf '%s\t' "$bin"
      "$bin" --version 2>/dev/null || echo "unreadable"
    done

# Container inventory via the image digest, not the tag
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{.status.containerStatuses[*].imageID}{"\n"}{end}' \
  | sort -u

Any 26.x, 24.x, or 22.x build older than the fixed release in the Node.js advisory is in scope. Do not rely on major-version tags alone (node:22); pin and verify the full patch version at container build time.

Next, grep your repositories for Brotli entry points:

# Direct usage of the Brotli decoder in application code
rg -n --hidden -g '!node_modules' \
  "brotliDecompress|createBrotliDecompress|BrotliDecompressStream|BrotliDecoderDecompress" .

# Framework middleware that enables br on the server side
rg -n --hidden -g '!node_modules' \
  "compression\(|shrink-ray|express-brotli|fastify-compress|@fastify/compress" .

# Outbound clients that honor br on responses
rg -n --hidden -g '!node_modules' \
  "accept-encoding.*br|Accept-Encoding.*br|decompress:\s*true" .

For runtime visibility, an eBPF or auditd rule logging Brotli decoder invocations shows which services exercise that code path under real traffic. Services that never call the decoder can be deprioritized; those that do should move first.

Correlate with your SBOM pipeline. The Node runtime version is a top-level component, so your SBOM query should be a one-liner once CVE-2026-111497 is indexed by your vulnerability database.

What to do before this reaches the exploited-in-the-wild lists

  1. Upgrade the Node.js runtime to the fixed release on 26.x, 24.x, and 22.x as published in the project advisory. Rebuild and redeploy container images; do not patch in place on immutable infrastructure.
  2. If you cannot upgrade immediately, strip or reject Content-Encoding: br at the edge for any endpoint whose downstream service decompresses it in Node. Nginx: proxy_set_header Accept-Encoding ""; on the request path and a header filter dropping inbound Content-Encoding: br. This is a temporary control, not a fix.
  3. Review outbound HTTP client code. If a service fetches arbitrary URLs (webhooks, SSRF-adjacent features, open redirector-like importers), remove br from its Accept-Encoding until the runtime is patched.
  4. In CI/CD, fail builds that produce images with vulnerable Node versions. A simple gate: run node --version during the build and compare against the advisory's fixed version table.
  5. Add detections for post-exploitation primitives: Node processes spawning shells, unusual egress from Node pods, unexpected child processes under PID 1 in containers. These are generic, low-cost, and will flag most memory-corruption payloads on execution.

The second finding worth tracking

CVE-2026-105482 is listed at CVSSv3 9.8 and affects the same three release lines (26.x, 24.x, 22.x). The project has not published granular mechanism detail, so speculation on the primitive is unwarranted. Treat it operationally as another unauthenticated remote path in the Node runtime and apply the same upgrade in the same change window. The remaining Node2Shell entries (CVE-2026-105483, CVE-2026-106069, CVE-2026-105481, CVE-2026-106072) range from high to medium severity and should be addressed in the same cycle; you are already rebuilding the image.

Why the urgency, in context

The same week this advisory landed, CISA added several unauthenticated-RCE and chainable auth-bypass issues to KEV, including CVE-2026-119977 in WordPress core, CVE-2026-97229 in GitLab, and the Ivanti Connect Secure chain CVE-2026-118527 and CVE-2026-111357. Under BOD 26-04, federal civilian agencies must remediate KEV entries on the schedule the catalog sets, and private-sector programs increasingly mirror the list. Server-side Node runtimes behind public HTTP ingress fit the profile KEV has prioritized fastest: unauthenticated, network-reachable, reliable exploitation primitives. Patch now, before an exploit module makes the decision for you.

Verifiable security.