Skip to main content

Node2Shell: CVE-2026-111497

Exploit Node.js's Brotli decoder flaw (CVE-2026-111497) for RCE, then detect and patch it.

Task 1: Introduction: Node2Shell and a Bug in Node's Brotli Decoder

Task 2: Inside the Bug That Becomes a Memory Write

Task 3: Fingerprint and Trigger the Vulnerable Service

Task 4: Turning Memory Corruption into a Captured Flag

Task 5: Detection and Mitigation: Shutting Node2Shell Down

Back to all walkthroughs
Room Icon

Node2Shell: CVE-2026-111497

Max room.

Exploit Node.js's Brotli decoder flaw (CVE-2026-111497) for RCE, then detect and patch it.

medium

40 min

220

User profile photo.
User profile photo.

To access material, start machines and answer questions login.

Most people have zipped a folder before emailing it. The sender saves bandwidth, and the person on the other end unpacks it without thinking twice. Plenty of web services do the same thing with uploads. A client compresses the body of a request, labels it with a Content-Encoding header, and the server decompresses it before any application code reads a byte.

Quillstack, a small content-ingestion company at quillstack.thm, built its upload service around that habit. Its application programming interface (API) at api.quillstack.thm is the endpoint other programs send documents to, and it accepts uploads compressed with Brotli. Brotli is a lossless compression format that browsers and servers know by the token br. The API runs on Express, a Node.js web framework. Quillstack's version of Express decompresses those uploads automatically through its built-in body-parser middleware. Not every Express app does this. The body-parser changelog shows Brotli support arriving only in a newer major version, and older Express apps reject a br upload outright. Quillstack ships fast, and its Node.js upgrades lag behind the upstream security releases. The server you'll attack runs a Node.js build from just before the patch for this bug.

What happens when the compressed upload isn't a document at all, but a stream built to break the decompressor?

What CVE-2026-111497 Is

A CVE (Common Vulnerabilities and Exposures) id is the public catalog number a disclosed vulnerability is tracked under. CVE-2026-111497 sits in the Brotli decoder that Node.js bundles inside its own runtime. It isn't an npm package you can bump. On an official Node.js build, like the one this lab runs, every br body Express decompresses goes through that bundled copy. A Linux distribution's own Node.js package may link the system Brotli library instead, and that copy carries the same flaw until it's updated too.

The flaw is an out-of-bounds write. The decoder writes data past the end of a buffer it owns and overwrites whatever memory sits next to it. The Node.js security advisory lists three outcomes of that corruption. The service can crash, it can disclose process memory, or the attacker can achieve remote code execution (RCE), which means running their own programs on the server over the network. A crash on its own is a denial of service (DoS): the service stops answering legitimate users.

Two details make this one serious. The attacker needs no account, and a single ordinary web request reaches the vulnerable code. The root cause is just as small. The decoder reported one error condition under the wrong label and kept working when it should have stopped.

The name Node2Shell comes from Imperva Red Team, which coined it in Ron Masas's analysis of the bug. Security press coverage adopted it afterward, and this room borrows it too. It's a nickname, not an official title. The Node.js advisory names the flaw only by a descriptive title and its id. It never says Node2Shell, so search for the id when you look for primary sources.

How the Room Runs

The room takes you from the bug to the capture. We'll look at how the decoder goes wrong and which releases fix it. You then prove that Quillstack's API is feeding your bytes into the decoder. You then run a credited public exploit to turn the memory corruption into code execution and get a flag. We finish on the defender side with how the attack appears in the logs and how you'd shut it down.

You work entirely from the AttackBox. You get no shell and no Secure Shell (SSH) login on the target, so the bug itself is the only way into the Quillstack service.

A decompressor that files one error under the wrong label sounds like a crash waiting to happen rather than a shell. So how exactly can one mislabelled error condition in a compression library turn a perfectly normal upload into remote code execution?

Learning Objectives

This room walks you through a newly disclosed Node.js vulnerability, from the root cause through to a working exploit and the signals that a defender would see. You'll learn how to:

  • Explain how a Brotli bug becomes remote code execution.
  • Identify which Node.js versions are affected and patched.
  • Weigh a disputed DoS-only claim against hard evidence.
  • Fingerprint a service that auto-decompresses Brotli uploads.
  • Run a credited exploit to recover a secret.
  • Explain why the exploit is loud and detectable.

Room Prerequisites

This is a standalone Recent Threats room (no prior room required). You should be comfortable on the Linux command line and be able to send web requests via curl. A basic understanding of what a CVE is and what a web is will be sufficient as background. You don't need any exploit development experience, as the exploit is a provided, credited tool.

Before you start Task 2, press the Start AttackBox button to start the Attacker machine and press the Start Machine button to start the Target machine so that they are ready when you need them in later tasks.

Set up your virtual environment

To successfully complete this room, you'll need to set up your virtual environment. This involves starting both your AttackBox (if you're not using your VPN) and Lab Machines, ensuring you're equipped with the necessary tools and access to tackle the challenges ahead.
Attacker machine
Status:Off
Lab machine
Status:Off