Node2Shell: Node.js Brotli vulnerability allows remote code execution
A flaw in Node.js's bundled Brotli decoder allows an out-of-bounds write when decompressing malicious input, which can crash the process, leak memory, or potentially enable remote code execution. An attacker who can supply crafted Brotli data to an application could exploit this.
aikido.dev
Published on aikido.dev
Node.js CVE-2026-111497 (Node2Shell) is a Brotli flaw that can allow remote code execution. See who is affected, patched versions and the fix.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The Brotli decoder does not properly validate input before writing to a memory buffer, leading to an out-of-bounds write.
Impact
The flaw can crash the process, leak part of its memory, or potentially allow remote code execution; public proof-of-concept code achieved code execution on an unmodified Node.js build, though not on every attempt, and no in-the-wild exploitation had been reported as of October 22.
What the attacker needed
Node.js or Bun with vulnerable Brotli decoder; Attacker can supply Brotli data to the app
The fix
Upgrade to Node.js 22.23.4, 24.22.1, or 26.12.1 (or newer patch releases), or Bun 1.4.4 or later; the fix is an upstream Brotli patch that makes the decoder detect invalid input and stop before writing past the buffer.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Brotli is a way to compress data so it takes less space when sent over the internet. Node.js, a popular tool for running JavaScript on servers, includes its own copy of the Brotli decoder. A bug in that decoder means that if someone sends specially crafted compressed data, the program can write past the end of a memory buffer, which may crash it or let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.