Node2Shell

Node2Shell is the name for CVE-2026-111497, an out-of-bounds write in google's brotli decoder that lets anyone who can get a program to decompress a crafted brotli stream crash it, read its memory or run code in it.

what to doupdate the brotli your software uses to 1.0.10, 1.1.1 or 1.2.1, then restart the process and rebuild any image that carries it. for node.js that means 22.23.4, 24.22.1 or 26.12.1; for bun 1.4.4; for the PyPI packages brotli 1.2.1 and brotlicffi 1.2.1.0. end-of-life lines get no fix, so move off them.

sourcesCVE-2026-111497

what is Node2Shell?

a brotli stream is split into blocks, and the decoder switches between block types as it reads. a crafted stream declares a single block type for a kind and then asks the decoder to switch, which is not valid brotli. before the fix the helper DecodeBlockTypeAndLength() returned a plain boolean, so a caller could not tell an invalid stream from one that merely needed more input. the streaming decoder read the invalid switch as "need more input" and kept appending the attacker's bytes to an eight-byte internal buffer, writing past its end (CWE-252 is the bug, CWE-787 is what it causes).

the write lands in the decoder's own BrotliDecoderState, next to buffer_length, pos, the distance limits and the ring-buffer pointer. by mozilla's analysis an attacker who controls the stream overwrites those fields and reaches a controlled heap write through memmove16(&s->ringbuffer[pos], ...), which is a route to code execution. google's record pairs the two CWEs exactly.

the flaw is in google's reference C decoder, not in any one product. node.js and bun bundle their own copy; browsers, proxies, .NET, the PyPI brotli/brotlicffi packages, libcurl and many archive and font tools ship or link it. a program is only exposed when it actually decompresses brotli data an attacker controls. decoders rewritten in other languages (the java, javascript, C# and rust ports) do not reach the C bug; the go port had the same logic error but only crashed.

CVE-2026-111497
Brotli: Out-of-bounds write in the Brotli decoder ("Node2Shell") also affects the PyPI Brotli package

CISA lists it as Google Brotli Unchecked Return Value Vulnerability

what goes wrong

a crafted stream declares one block type and then asks the decoder to switch block types, which cannot happen. the block-switch helper returned a plain BROTLI_FALSE, which the streaming decoder read as "need more input" rather than "invalid stream". it kept appending the attacker's bytes to an eight-byte internal buffer and wrote past the end, corrupting the decoder's own state.

how it is reached

one crafted brotli stream that an application decompresses. the confirmed route is an HTTP body or response coded Content-Encoding: br; the public exploit stream for node.js runs about 23 MB, and the full browser chain in the mozilla report is about 22 MB in two network chunks.

confirmed on

code execution was shown on the official node.js 24.22.0 image, on arm64 by imperva and on x86-64 by ELLIO across a bare node:http server, express 5 and koa. the firefox copy of the decoder reached a controlled heap write by source analysis and sanitizer testing. for the python packages, researchers reproduced the fault but did not attempt code execution.

9.2 criticalCVSS 4.0, scored by google (the CNA)

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

9.8 criticalCVSS 3.1, scored by NVD

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

8.1 importantCVSS 3.1, scored by red hat

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

advisory GHSA-9v8h-qqgm-4m35

weakness classes: CWE-787 Out-of-bounds Write, CWE-252 Unchecked Return Value.

is Node2Shell being exploited?

timeline

  1. fix committed
  2. found in firefox
  3. firefox updated
  4. disclosed
  5. RCE demonstrated
  6. .NET fixed
  7. exploit traffic seen
  8. added to CISA KEV
  9. apple patches

yes. CISA added CVE-2026-111497 to its known exploited vulnerabilities catalog on 27 october 2026, with a 10 november deadline for US federal agencies, after exploit traffic was seen in the wild. EPSS is 0.99931 as of 23 november 2026.

imperva's red team (Ron Masas) demonstrated code execution on 22 october against the official node.js 24.22.0 arm64 image, through both a fetch() response and an express 5 request body, and confirmed 24.22.1 rejects the same input. the exploit did not succeed on every attempt, and imperva did not release it (sysdig).

ELLIO reproduced code execution on x86-64 across a bare node:http server, the node:24.22.0-slim image, express 5.3.0 and koa 3, each returning a shell as the service account. it reports a public exposure checker (node2shell-check, user agent Mozilla/5.0 (compatible; node2shell-check/1.0)) reaching its sensors first, and on 26 october 2026 at 15:08 UTC a 23,069,983-byte brotli-coded request body built to attack node.js 24.22.0 on x86-64, from 94.154.43.7 (an IP ELLIO rates malicious, tied to PHP2Shell exploitation). that first live attempt failed in ELLIO's own tests.

the exploit is build-specific. an offset that gave a shell on 24.22.0 gave nothing in 10,000 attempts against 22.23.3 and 26.12.0, each of which needs its own offset. a miss crashes the worker, so a failed attempt is a denial of service and, where core dumps are written, a route to another request's in-memory secrets.

public proof-of-concept code is on github (the first repository appeared on 21 october, about five hours after the fix). the earliest public PoC reached code execution only on a deliberately weakened build; later labs report probabilistic code execution on the official 24.22.0 x86-64 image. reliability depends on the build, concurrency and memory layout; some reports held that only denial of service is reliable.

the yeet programmable firewall

patch CVEsin minutes

When a CVE reaches the exploited list, your yeet network security agent reads it, writes the patch in seconds, and applies the new rule on every host.

PHP2Shell arrives from the KEV feed, the agent drafts a rule, a person applies it
  • minutes

    Mean Time to Mitigate

    Every new RCE is now a contest of agent speed.

  • 3 to 6 ms

    rule to live

    Policy is applied without restarts or redeploys, measured in our lab.

  • per host

    enforcement

    This host-based IPS bridges your NGFW patch gap immediately.

which brotli and node.js versions are affected, and which fix it?

the root bug is in the brotli library, and every product that bundles or links an affected copy has to ship its own update. install the brotli release for your branch, and the runtime release that carries it.

brotli branches affected by Node2Shell and the releases that fix it
brotli 1.2vulnerable1.2.0first fixed1.2.1install now1.2.1
brotli 1.1vulnerable1.1.0first fixed1.1.1install now1.1.1
brotli 1.0vulnerable1.0.3 to 1.0.9first fixed1.0.10install now1.0.10

brotli 1.0: the bug was introduced in 1.0.3; releases 1.0.0 through 1.0.2 predate it.

node.js branches affected by Node2Shell and the releases that fix it
node.js 26vulnerable26.0.0 to 26.12.0first fixed26.12.1install now26.12.1
node.js 24vulnerable24.0.0 to 24.22.0first fixed24.22.1install now24.22.1
node.js 22vulnerable22.0.0 to 22.23.3first fixed22.23.4install now22.23.4
node.js 25, 23, 20 and olderend of lifevulnerableall releasesfirst fixedno node.js releaseinstall nowmove to 22, 24 or 26

node.js 25, 23, 20 and older: the end-of-life 25.x, 23.x and 20.x lines bundle an affected brotli and get no fix. move to a supported line.

bun branches affected by Node2Shell and the releases that fix it
bun 1.xvulnerable1.4.3 and earlierfirst fixed1.4.4install now1.4.4

bun 1.x: bun build --compile executables stay affected until rebuilt on 1.4.4.

distribution packages

distributions patch their own brotli package, and where a product links the system library the distribution's update is what fixes it. some keep the old upstream version number, so the version string cannot prove the fix.

Distribution packages that carry the Node2Shell fix
debian 13 (trixie)packagebrotlifirst fixed package1.1.0-2+deb13u1version numberstays the sameadvisoryDSA-6582-1
debian 12 (bookworm)packagebrotlifirst fixed package1.0.9-2+deb12u1version numberstays the sameadvisoryDLA-4855-1
ubuntu 24.04packagebrotlifirst fixed package1.1.0-2ubuntu0.1version numberstays the sameadvisoryUSN-8956-1
ubuntu 22.04packagebrotlifirst fixed package1.0.9-2ubuntu0.1version numberstays the sameadvisoryUSN-8956-1
RHEL 10packagebrotlifirst fixed package1.1.0-8.el10_2.1version numberstays the sameadvisoryRHSA-2026:90449
RHEL 9packagebrotlifirst fixed package1.0.9-10.el9_8.1version numberstays the sameadvisoryRHSA-2026:90495
RHEL 8packagebrotlifirst fixed package1.0.6-5.el8_10version numberstays the sameadvisoryRHSA-2026:90501

how do I check whether my node.js is patched?

check the brotli that the program decoding untrusted data actually uses. a node.js version number alone can mislead, so confirm the release and, where the system library is linked, the package.

read the node.js version

the fixed node.js releases bundle the fixed brotli. a release at or above the fix for your line is patched; an earlier one, or any end-of-life line, is not.

node --version
  • vulnerablev24.22.0
  • fixedv24.22.1

tested: we read both strings from the official node:24.22.0-slim and node:24.22.1-slim images on 23 november 2026.

do not trust process.versions.brotli on node.js

node.js cherry-picked the fix without bumping the bundled brotli version string. a patched 24.x and an unpatched one both report 1.2.0, so this value cannot tell you whether the fix is in. use the node.js release version instead.

node
node -p process.versions.brotli
  • 24.22.0 (unpatched)1.2.0
  • 24.22.1 (patched)1.2.0

tested: we ran it in the official slim images on 23 november 2026: 22.23.3 and 22.23.4 both print 1.1.0; 24.22.0, 24.22.1, 26.12.0 and 26.12.1 all print 1.2.0.

ask the runtime whether it carries the fix

the fix adds one error code to the decoder, and node.js exposes it as a zlib constant. a build that has the constant has the fix. the command reads a constant and decodes nothing, so it is safe on a production host.

node -p "'BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH' in require('zlib').constants"
  • fixedtrue
  • not fixedfalse

tested: we ran it in the official slim images on linux arm64 on 23 november 2026: false on 22.23.3, 24.22.0 and 26.12.0, true on 22.23.4, 24.22.1 and 26.12.1. a distribution build of node.js that links the system brotli can print false on a patched host, so check the package there.

check the python packages

the PyPI brotli and brotlicffi packages bundle the decoder, and HTTP clients use them when installed. the distribution package python3-brotli is a different build, fixed through your distribution.

pip
pip show brotli brotlicffi
  • vulnerableName: Brotli Version: 1.2.0
  • fixedName: Brotli Version: 1.2.1

tested: fixed versions per the github advisory GHSA-9v8h-qqgm-4m35: brotli 1.2.1 and brotlicffi 1.2.1.0. the command itself is untested on our side.

check the system brotli library

where a program links the system library (debian's node.js, libcurl, many bindings) the distribution's brotli package is what fixes it. the upstream version string may not move on a backport, so read the package version and changelog.

dpkg -l | grep -i brotli
  • patched (ubuntu 24.04)libbrotli1 1.1.0-2ubuntu0.1
  • not patched (ubuntu 24.04)libbrotli1 1.1.0-2build2

tested: fixed package versions from ubuntu USN-8956-1 and the debian tracker. the commands are untested on our side; confirm the fixed version against your distribution's advisory.

restart and rebuild

a running process keeps the old decoder in memory until it restarts, and a container keeps it until you rebuild the image on a patched base. a floating tag such as node:24 serves the cached old version until you pull.

rebuild
docker build --pull -t <image> .

the patch

one small commit fixes the bug. it was written on 27 february 2026 as master commit 0ed4268a, "Detect and report invalid stream earlier", and sat in the public tree for eight months before the october releases cherry-picked it onto the three branches. the excerpts below are copied from the 1.2 branch commit b418fa8, which changes two files, adding 60 lines and removing 33, with no test files.

the block-switch helpers now return a BrotliDecoderErrorCode instead of a boolean. an invalid switch (one block type declared, so nothing to switch to) returns the new error BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH, value -17, and the decoder stops. a genuine shortfall of input still returns BROTLI_DECODER_NEEDS_MORE_INPUT, so the two conditions no longer share one answer.

a new macro, BROTLI_SAFE_WITH_STATUS, carries the error code out to the caller and jumps to saveStateAndReturn on anything other than success, in place of the old BROTLI_SAFE, which could only tell success from "need more input".

CVE-2026-111497+1 −3 in this file

the fix claims the reserved -17 slot for a new format error, BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH. before the fix this code did not exist, so a build that knows it carries the fix.

@@ -85,9 +85,7 @@ typedef enum {   BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR              \   BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR              \   BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR               \-                                                                           \-  /* -17 code is reserved */                                               \-                                                                           \+  BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_SWITCH, -17) SEPARATOR           \   BROTLI_ERROR_CODE(_ERROR_, COMPOUND_DICTIONARY, -18) SEPARATOR           \

what changes for you after the upgrade

  • a new public error constant, BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH (-17). node.js exposes it as BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH and returns it to the application; a crafted request now fails fast with that error (node.js answers an inbound request with a 400).
  • no behaviour change for valid streams. the fix rejects input that was already malformed; well-formed brotli decodes as before.

how do I detect Node2Shell attempts?

no single signal is proof. a crash or a rise in HTTP 5xx is a lead, not evidence; a successful exploit may leave no crash, and each request shape below has legitimate uses.

in requests

  • a request body or response carrying Content-Encoding: br into a service that decodes it. match br case-insensitively, and inside a list such as gzip, br.

    Content-Encoding: br

    legitimate clients and servers also send brotli-coded bodies.

  • an unusually large brotli request body. the public node.js exploit stream runs about 23 MB; the browser chain in the mozilla report is about 22 MB.

    size alone proves nothing; many brotli bodies are small and many large bodies are benign.

in logs

  • unexpected worker crashes or restarts, or node.js answering ERR__ERROR_FORMAT_BLOCK_SWITCH / HTTP 400 on a patched build, right after a brotli request. where core dumps are enabled, a crash can write another request's secrets to /var/lib/systemd/coredump.

    ERR__ERROR_FORMAT_BLOCK_SWITCH

on the host

  • a shell, downloader or network redirection started by the node.js or web-server account, such as /bin/sh wired to a socket, curl or wget.

    this is evidence the attack already worked; the host needs incident response, not a filter.

public detection rules

Public detection rules for Node2Shell
microsoft azure WAFrulesDRS 2.2 rule 920450 (restricted headers, adds Content-Encoding)sourcemicrosoft
sysdig securerulesNode.js Process Crash Followed by In-Place Program Execution; Node.js Process Redirected Network Socket to Standard Streamsourcesysdig

what can I do if I can't upgrade node.js yet?

node.js and the brotli project publish no in-runtime workaround, so the upgrade is the fix. each stopgap below closes one path and leaves others open, so stack the ones that fit and patch anyway.

Stopgaps for Node2Shell, what each one closes and what it leaves open
reject Content-Encoding: br on inbound requests at the proxy, load balancer or WAFper red hat (RHSB-2026-015)closesthe inbound request-body path, for traffic that crosses the edgeleaves openbrotli responses your own code fetches, service-to-service traffic, and requests that reach the origin directly. match br case-insensitively, including inside a list such as gzip, br
turn off brotli inflation in the body parser (express.json({ inflate: false }))per sysdigclosescompressed request bodies reaching the node.js decoder through that parserleaves openthe fetch() response path, direct node:zlib calls, and it also rejects gzip and deflate bodies
uninstall the PyPI brotli and brotlicffi packagesper broccoli2shell.comclosesbrotli decoding by urllib3/requests, httpx, aiohttp and scrapy, which only use it when installedleaves openany code that still imports a brotli decoder directly, and the distribution's python3-brotli
disable only the brotli decompressor filter in envoy and istioper patch the planetclosesbrotli decompression at the proxy, both directionsleaves openany downstream decoder the proxy forwards encoded bytes to; keep gzip and zstd filters
disable automatic brotli response decompression in HTTP clientsper patch the planetclosesthe outbound path, where your code fetches an attacker-influenced URLleaves openinbound request bodies, and a server can send brotli even when you drop br from Accept-Encoding, so reject the response before decoding it
turn on your edge WAF's Node2Shell ruleper microsoftclosesknown request shapes that cross the edge (microsoft's rule 920450 restricts Content-Encoding; vercel and other providers deployed rules on disclosure day)leaves openresponses your app fetches, direct-to-origin traffic, and encodings the rule does not name. check whether the rule logs or blocks

Node2Shell questions

what is Node2Shell (CVE-2026-111497)?

Node2Shell is an out-of-bounds write in google's brotli decoder. a crafted brotli stream that a program decompresses can corrupt the decoder's memory, which can crash it, leak its memory or run code. the bug is in the C library, not in one product, so node.js, bun, python packages, .NET, browsers and proxies that bundle or link an affected copy are all exposed. it is also called Broccoli2Shell and HTTP2Shell.

which brotli and node.js versions fix Node2Shell?

google brotli 1.0.10, 1.1.1 and 1.2.1 fix it. node.js carries the fix in 22.23.4, 24.22.1 and 26.12.1; bun in 1.4.4; the PyPI packages in brotli 1.2.1 and brotlicffi 1.2.1.0. end-of-life node.js lines (25.x, 23.x, 20.x) get no fix, so move to a supported line.

I'm on node.js and process.versions.brotli says 1.2.0. am I patched for Node2Shell?

that value cannot tell you. node.js cherry-picked the fix without changing the bundled brotli version string, so a patched 24.x and an unpatched one both print 1.2.0. check the node.js release instead: 24.22.1 and later on the 24.x line are patched, 24.22.0 and earlier are not. on an official build you can also ask the runtime: node -p "'BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH' in require('zlib').constants" prints true when the fix is in.

does Node2Shell need the attacker to be logged in?

no. the bug is reached while a program decompresses brotli data, before any application login. any client that can send a request the server decodes, or any server whose brotli response your code fetches, can reach it.

does a bare node.js HTTP server decode brotli request bodies?

no. a plain node:http server does not inflate an incoming brotli body on its own. something has to hand the bytes to the decoder: express 5 or body-parser 2 parsers, the koa body parsers, @fastify/compress with request decompression, a fetch() of an attacker-influenced URL (undici decodes brotli responses), or a direct node:zlib brotli call. express 4 and body-parser 1.x do not decode brotli request bodies.

are python and .NET affected by Node2Shell?

yes. the PyPI brotli (fixed 1.2.1) and brotlicffi (fixed 1.2.1.0) packages bundle the same decoder, and requests, httpx and aiohttp use it when installed. microsoft shipped .NET fixes (runtime 8.0.33, 9.0.22, 10.0.14); in .NET, brotli decoding is off by default, so only applications that enable request decompression, HttpClient brotli decompression or BrotliStream/BrotliDecoder are exposed. researchers did not demonstrate code execution in the python packages.

is Node2Shell being exploited?

yes. CISA added it to its known exploited vulnerabilities catalog on 27 october 2026. ELLIO recorded a crafted exploit request in the wild on 26 october from an IP tied to mass exploitation, though that first attempt failed in its tests. code execution has been reproduced on the official node.js 24.22.0 image, and public proof-of-concept code exists.

does a WAF or rejecting Content-Encoding: br protect me from Node2Shell?

partly, for inbound requests that cross the edge. rejecting Content-Encoding: br at a proxy closes the request-body path, matched case-insensitively and inside lists such as gzip, br. it does not cover a brotli response your own code fetches, service-to-service traffic, or requests that reach the origin directly. keep the rule on and upgrade.

do I need to restart or rebuild after patching Node2Shell?

yes. a running process keeps the old decoder in memory until it restarts, and a container keeps it until you rebuild the image on a patched base and redeploy. bun build --compile executables stay affected until rebuilt. a Dockerfile pinned to node:24.22.0 stays vulnerable until you move the pin.

why are there three names: Node2Shell, Broccoli2Shell and HTTP2Shell?

they are one CVE, CVE-2026-111497. imperva's red team named it Node2Shell in its 22 october write-up, and by 28 october it was also tracked as HTTP2Shell. Broccoli2Shell is Juliano Rizzo's name, on the view that the flaw is in brotli itself and reaches well beyond node.js. github's advisory uses Node2Shell; the CVE record and brotli release notes use none of the names.

how was Node2Shell found and when was it fixed?

openai codex security (Khai Tran and Sylvie Mayer) reported it to node.js. the root-cause fix was already written in google/brotli on 27 february 2026, before anyone knew it was a security bug, and sat in the public tree for eight months until the october releases carried it. an automated, AI-assisted report to mozilla described the same overflow in firefox in april 2026.

sources

from the brotli and node.js projects

government and CERT

researchers

vendors and distributions

changelog and credits

  1. page published. facts checked against the node.js advisory, the google/brotli fix commit and releases, the CVE record, NVD, the github advisory, red hat, debian and ubuntu trackers, the mozilla bug and CISA KEV catalog 2026.11.23. version checks run in the official node.js images.

reported by Khai Tran and Sylvie Mayer of OpenAI Codex Security, and fixed in node.js by Matteo Collina and Antoine du Hamel, as the node.js advisory credits them; the CVE record credits the reporters. the upstream brotli fix was written by Evgenii Kliuchnikov. an automated, AI-assisted report filed through mozilla's bugmon account described the same overflow in firefox independently.

this page is maintained by yeet, which makes the yeet programmable firewall. we are not affiliated with google, node.js or the researchers. tell us if something here is wrong.

see the yeet programmable firewall on your own hosts

30 minutes with an engineer who builds yeet. we check where your TLS ends and which kernel you run, and work through a rule for Node2Shell with you.