TL;DR
TL;DR
- Node2Shell (CVE-2026-111497) is an out-of-bounds write in the Brotli decoder bundled with Node.js. Node.js says it can permit remote code execution. The fixed releases are 22.23.4, 24.22.1 and 26.12.1.
- The dangerous input is compressed binary data in a request body. A signature has nothing readable to match, and a WAF cannot see whether the origin decodes that body at all.
- Following the October 21 disclosure, Impart developed custom detection rules for Node2Shell and CVE-2026-105482. The rules were added to the CVE protection pack where customers can enable with a single click.
- The rules provide visibility into which apps receive the risky traffic so teams can patch those first. Upgrading Node.js is the only complete fix.
Node2Shell in brief
Node.js published its October 2026 security release on October 21. It fixed 10 vulnerabilities, four rated High. Imperva’s research team has named CVE-2026-111497 Node2Shell.
The flaw is an out-of-bounds write in the Brotli decoder that ships inside Node.js. A malformed Brotli stream can reach a block transition that the stream’s own structure rules out. The vulnerable decoder reads that as a request for more input and keeps processing in a bad state, where it should return a format error. Node.js says this can permit remote code execution.
Imperva’s researchers demonstrated code execution against the official Node.js 24.22.0 image and confirmed that 24.22.1 rejects the same input. Execution took multiple attempts in their setup.
| Field | Value |
|---|---|
| Vulnerability | CVE-2026-111497 (Node2Shell) |
| Severity | High |
| Weakness | Out-of-bounds write in the bundled Brotli decoder |
| Affected | Node.js 26.x, 24.x and 22.x before the fixed releases |
| Fixed in | Node.js 22.23.4, 24.22.1 and 26.12.1 |
| Impact | Remote code execution |
A request alone does not reach the decoder. Node’s core HTTP server does not decode inbound Brotli on its own. Application code or middleware has to do it, and Express 5 and body-parser 2 can inflate Brotli request bodies when their parsers are configured to. Node’s built-in fetch() also decodes compressed responses from other servers. Every one of those paths ends in the same decoder.
The same release fixed a second bug that web traffic can carry. CVE-2026-105482, also rated High, makes dns.resolve() cut a hostname at an embedded null byte. An application can validate one hostname while Node.js connects to another. Attackers can use that to get around allowlists and reach internal systems.
What teams can do to quickly mitigate exposure
Patching comes first. It also takes time, especially where Node.js sits inside container images and vendor software that a team does not control.
Four steps cover the gap:
- Upgrade. Move to Node.js 22.23.4, 24.22.1 or 26.12.1, and rebuild and redeploy any image that bundles a Node binary. Node.js notes that End-of-Life versions are affected whenever a security release ships, so applications on an unsupported line need to move to a supported one.
- Reduce exposure. Check the Node.js version inside each deployed image and host, because a package inventory can miss a runtime bundled in a container. Then map where untrusted Brotli data enters, which means request-body middleware that decodes it and services that fetch compressed responses from other servers. Limit unexpected Brotli request bodies while you patch. Test any restrictions against legitimate traffic first, since some clients intentionally upload Brotli-compressed data.
- Monitor. Watch for Brotli-encoded request bodies on routes that have never received them, and for Node.js process exits during decompression. Neither is a reliable sign of exploitation on its own.
- Validate virtual patches. Ask vendors for evidence of coverage, testing and known limitations.
Why WAFs struggle with Node2Shell
WAFs are effective against known attack patterns such as SQL injection and cross-site scripting. Node2Shell does not look like either. Imperva has published dedicated rules for CVE-2026-111497, which shows that Layer 7 protection can reduce exposure here.
Four properties of the bug limit what any rule can claim.
- The payload is compressed binary. Nothing in it reads as an attack string. Judging its content means decoding it, which puts a decoder in the inspection path and hands hostile input to the same kind of code that fails in Node.js. Impart’s rule does not parse the stream. The one malformed sequence in the public upstream regression test also does not prove that every exploit variant looks the same, so a byte signature would cover one input and say little about the rest.
- The request does not establish exposure. A WAF cannot see whether the origin runs Node.js, which version, or whether the route decodes the body. A route is exposed only when middleware such as body-parser inflates the Brotli body. A rule that blocks every Content-Encoding: br request also blocks traffic to origins that never decode it.
- Brotli is ordinary traffic. Browsers advertise Brotli support in the Accept-Encoding header, so a loose match on “br” fires on normal requests. Some legitimate tools also upload Brotli-compressed bodies on purpose. A blanket block breaks those clients.
- Some paths run outbound. The same decoder handles compressed responses that Node.js services fetch from other servers. A WAF in front of the application inspects inbound requests and does not see those.
The null-byte bug has a different shape. The hostname looks valid to the application, and the hidden byte makes Node.js resolve a different host. A null byte in a hostname is never normal, but a rule cannot prove that the value reaches the vulnerable lookup.
How stateful Layer 7 rules can detect Node2Shell
Patching can take weeks. During that window, the useful question is which of your apps actually receive the risky traffic.
Impart rules are small programs compiled to WebAssembly. A rule can match a single request, and it can carry what it learned in the request phase into the response phase, within the inspector’s latency budget.
The Node2Shell rule uses that second ability to report at two levels.
- CVE-2026-111497-exposure is added in the request phase when the request declares Brotli in its Content-Encoding header and carries a body. The rule matches br as a whole entry in the header’s list, in any letter case and with any spacing, so look-alikes such as brotli and x-br do not trigger it. It ignores Accept-Encoding, which browsers use to advertise Brotli support, and it ignores a bodyless request, because nothing reaches the decoder. It reads one header first and checks for a body only on a match, so other traffic pays almost nothing.
- CVE-2026-111497-not-rejected is added in the response phase when the exposure tag fired and the origin answered with a status below 400. It means the application did not turn the request away with an error. It does not prove the decoder ran, since a 204, a redirect or a handler that ignores the body also qualifies. Because it is added after the response, it is telemetry and cannot block the request it was observed on.
A route that receives Brotli bodies and keeps answering without an error belongs at the top of the upgrade list. Repeated -not-rejected tags on a route are one input to deciding whether Brotli bodies are expected there.
The second rule watches the places hostnames travel. CVE-2026-105482-suspicious is added when a raw null byte or an encoded %00 appears in the Host header, X-Forwarded-Host, Forwarded, Referer, Origin or Destination, or in a query or structured-body field whose name contains a host or URL word such as url, host, callback or redirect. The rule reads field names word by word, so redirect_uri and targetUrl match while security and ghost_note do not.
HTTP inspection has limits. Neither rule can read the malicious data inside a compressed body, and neither can tell whether an origin runs a vulnerable Node.js. A few legitimate tools upload Brotli on purpose and get tagged too. The null-byte rule skips the URL path, cookies, plain-text bodies and fields with other names. A tag is a reason to look at a route, not proof of an attack.
.png)
Understand the attack
An edge rule cannot establish that the origin is Node.js, that it runs an affected version, or that the route decodes the body. It also cannot see inside the compressed stream. That shaped the strategy. Instead of matching exploit payloads, the team focused on the conditions the bug needs and on signals that give context, and it named each tag for how confident the signal is.
Generate protection logic
The Runtime Defense Harness generated candidate rules for the two web-reachable bugs. The Brotli candidate matches the content-coding token exactly, requires a real body, and reports exposure before it says anything about the response. The null-byte candidate stays on host-bearing surfaces and reads field names word by word, not by substring.
Test it and try to break it
Generating a rule is only the beginning. The Runtime Defense Harness evaluates candidate protections against labeled malicious and legitimate traffic, using the same enforcement engine that runs in production. Adversarial testing looks for bypasses, and independent engineering review checks effectiveness, false-positive risk and known coverage gaps. Browsers that advertise Brotli, look-alike encodings and legitimate Brotli uploads are the cases a careless rule gets wrong, so the tests have to cover them.
Deploy with human sign-off
Before deployment, a security engineer reviews the testing evidence and approves the protection. Once deployed, validated rules run deterministically in the traffic path, with no AI inference on each request.
No HTTP-layer control can fully remove this exposure, and upgrading Node.js is the only complete fix. Two of the ten vulnerabilities in the release have dedicated Impart rules, and the upgrade is the fix for all ten. What the rules add is visibility into which apps receive the risky traffic while you patch, and a way to put the exposed routes first.
Questions to ask your WAF vendor about virtual patching
The next runtime vulnerability will arrive the same way, with a fix available and a long list of systems still waiting for it. These questions apply to that one too.
- Can our WAF enforce custom security logic beyond predefined signatures?
- Can it correlate a request with its response, and a client’s behavior across requests?
- Does each rule state what it can and cannot prove?
- Can we validate virtual patches against our own traffic?
- Can we turn protection on quickly, in report-only mode first, without introducing false positives?
Customers can turn on both Node.js rules today in the CVE protection pack.

