ENGINEERING

Node2Shell is a Brotli bug: on Linux, your Node.js version number won’t tell you if you’re fixed

Updated October 26: Microsoft fixed it in .NET 8.0.33, 9.0.22 and 10.0.14, and RFF’s check now finds .NET too. On Windows that’s the bigger job: even the Photos app carries its own vulnerable .NET.

Updated October 25: it isn’t just Node. Anything that carries its own copy of Brotli needs its own update. Which ones have shipped, and which I couldn’t confirm yet, below.

On October 21, Node.js shipped 22.23.4, 24.22.1 and 26.12.1 to fix CVE-2026-111497, an out-of-bounds write in the Brotli decoder. Imperva named it Node2Shell and got code running on the official Node.js 24.22.0 build with nothing but crafted Brotli data. A public proof of concept has been out since October 22. No exploitation has been reported yet.

Node.js 20 and older get no fix. Neither do the odd-numbered lines.

Who can be reached

A Node app is exposed when it decompresses Brotli data an attacker controls. Three common ways that happens without anyone writing “brotli” in their code:

A plain Node HTTP server doesn’t decode request bodies on its own.

The bug is in Brotli, not in Node

The Node.js fix is an update of its bundled copy of Google’s Brotli library, and Google released Brotli 1.2.1, 1.1.1 and 1.0.10 the same day for the same CVE. That matters on Linux, because distribution Node packages often don’t use the bundled copy.

I checked two lab machines:

So on those machines Node’s version number is irrelevant. 22.22.1 isn’t “below 22.23.4” in any way that matters; it’s exactly as safe as the system Brotli library, and neither distribution had shipped a fixed one on October 23. The fix will arrive as a libbrotli1 or libbrotli update.

The same library is loaded by plenty of other programs. On the Ubuntu lab machine that list included NetworkManager, CUPS, fwupd and the GNOME shell. Whether each of them ever decodes Brotli from the network is a different question, but they all get fixed by the same package update, and they all keep running the old copy until they restart.

Check one Linux machine

Ask Node which Brotli it’s actually running:

node -e "console.log(require('fs').readFileSync('/proc/self/maps','utf8').includes('libbrotlidec') ? 'system Brotli library' : 'bundled Brotli')"

If it says system Brotli library, check the library package, not Node. On Debian and Ubuntu:

zgrep -c CVE-2026-111497 /usr/share/doc/libbrotli1/changelog.Debian.gz

On RHEL, Rocky and Alma:

rpm -q --changelog libbrotli | grep -c CVE-2026-111497

0 means the fix isn’t installed yet. If it says bundled Brotli, Node’s own version is the answer: node --version should be 22.23.4, 24.22.1, 26.12.1 or newer.

One trap: node -p process.versions.brotli looks like the obvious check, and it isn’t. The fixed Node.js 24.22.1 still reports Brotli 1.2.0, the same as the vulnerable 24.22.0, because the patch didn’t change the version string. It’s useful for one thing only: on Rocky it said 1.0.9, which gives away that Node is using the system library.

After the library update, anything that had it loaded keeps running the old code until it restarts. This lists those processes:

sudo grep -l 'libbrotlidec.* (deleted)$' /proc/[0-9]*/maps

Check one Windows machine

Official Windows builds of Node bundle Brotli, so the version is the right test, and you can read it from the file without running anything. node.exe turns up in more places than Program Files: nvm-windows, portable zips, and vendor products that ship their own copy. dir searches a drive far faster than PowerShell does:

cmd /c "dir /s /b C:\node.exe 2>nul" | ForEach-Object { "{0,-10} {1}" -f (Get-Item $_).VersionInfo.ProductVersion, $_ }

Anything below 22.23.4, 24.22.1 or 26.12.1 needs updating, and 20 or older needs moving to a supported line. A copy under C:\ProgramData shows up twice, the second time under C:\Users\All Users: that’s a Windows junction to the same folder, not a second copy. Electron apps (VS Code, Teams, Slack) embed Node differently and don’t show up here; their fixes come from each vendor.

It’s not just Node.js

The bug is in Google’s Brotli library, so it’s in every app that compiled in its own copy of versions 1.0.3 through 1.2.0. Updating Node or your Linux libbrotli package doesn’t touch those. Each one needs its own update, from whoever ships it.

Fixed so far (as of October 25):

Then there’s the stuff sitting on your desktops. Browsers decode Brotli every time a site sends Content-Encoding: br, and 7-Zip forks like 7-Zip-zstd and NanaZip ship a Brotli codec. I couldn’t find a fixed version for any of those yet, so I’m not going to guess at one. Keep the browsers on auto-update (they move fastest), and update the 7-Zip forks when their maintainers ship. If you’ve got a PDF or imaging tool that opens Brotli-compressed content, ask the vendor. (Yes, that’s the “email the vendor and wait” answer. Sorry.)

I’ll update this list as fixes land.

Doing this across a fleet

The RFF Script Library has two entries:

Neither one runs a binary a user could have planted. On Linux it only runs root-owned copies; for the rest it reads the version from an nvm-style folder name or says it couldn’t tell. In the lab, two booby-trapped “node” files in a user’s home folder were found and never executed.

RFF is free for your first 100 endpoints: getrff.com.

Sources

One email per new post, nothing else. Unsubscribe in one click. Or use the RSS feed.

Comments

Comments use GitHub Discussions, so you'll need a GitHub account to post. Corrections are especially welcome.