TL;DR
Last week’s HTTP2Shell disclosure (CVE-2026-111497) is a memory-corruption bug in the Brotli decoder that ships inside the Node.js binary. It is not an npm package, so npm audit, Dependabot and lockfile scanners say nothing. It reached Backline customers through container image scans, and the fix is not one thing: some images need a patch bump, some need nothing for this CVE, and some need a major runtime migration plus code changes, because Node.js 20 is end of life and never gets a fix.
For our customers, Backline traced reachability per service, dismissed the unreachable findings under the customer’s own remediation policy, and opened verified pull requests for the rest, including the code changes the Node.js 24 migration forces.
We can’t show a customer’s code, so we rebuilt the scenario in our lab as three small services with the same three outcomes. What follows is their evidence, and the checklist we’d hand any team that has to move off Node.js 20 because of this CVE.
What HTTP2Shell is, in one minute
CVE-2026-111497 is an out-of-bounds write in DecodeBlockTypeAndLength, part of the Brotli decoder that Node.js bundles into its zlib module. Feed the decoder a crafted stream and the process can crash, leak memory or, in some configurations, run attacker code. CVSS 4.0 scores it 9.2 (network, no privileges, no user interaction), and within hours it had public proof-of-concept code and a CISA KEV listing.
The decoder has three doors in a typical Node.js service. Which doors are open decides whether you are exposed at all:
- Inbound request bodies. Frameworks that honor
Content-Encoding: brdecompress the body before your handler runs. In the versions we tested, Express 5 (body-parser 2.x) does and Express 4 (body-parser 1.x) answers415instead. - Outbound responses. The global
fetch()(undici) transparently decodesbrresponses. If your code, or any dependency, fetches a URL an attacker can influence, the attacker’s server picks the bytes. - Direct
zlibcalls.brotliDecompress,brotliDecompressSyncandcreateBrotliDecompresson data from outside.
Fixed releases are Node.js 22.23.4, 24.22.1 and 26.12.1. Node.js 20 reached end of life earlier this year and has no fix. That last sentence is where most of the pain in this post comes from.
Why your dependency scanner is quiet
The vulnerable code is compiled into /usr/local/bin/node, not installed by npm. Nothing about it appears in package.json or package-lock.json, so every tool that keys on lockfiles reports a clean bill of health. All three lab services pass npm audit with zero findings today, and all three are affected.
What does see it is a container image scan that inventories binaries. In our customers’ environments that was AWS Inspector on ECR, which reports the Node.js runtime as a node package at /usr/local/bin/node with a fixed-in version. That finding is the only signal most teams get, and on its own it is a weak one: it names an image, not a service, a code path or an owner.
Backline maps that image back to the repository and Dockerfile that build it and to the application it belongs to, then asks the question that matters: can untrusted Brotli bytes reach this process?
The lab: three images, one CVE, three different answers
We rebuilt what we saw at customers as three small Express services, each shipped as an ECR image and scanned by Inspector. Same CVE on every image. Three different right answers.
| Service | Runtime in image | How Brotli bytes could get in | Reachable? | Risk score | What Backline did |
|---|---|---|---|---|---|
| order-notes-service | Node.js 24.22.0 | Express 5 decodes Content-Encoding: br request bodies | Yes, inbound | 100 | PR: patch bump to 24.22.1, no code changes |
| inventory-import-service | Node.js 20.20.2 (EOL) | Express 4 rejects br with 415; no outbound HTTP; a Brotli helper exists but is never called | No | 38 | Dismissed by the customer's remediation policy |
| link-preview-service | Node.js 20.20.2 (EOL) | A dependency calls fetch() on a user-supplied URL | Yes, through a dependency | 100 | PR: migrate to 24.22.1 and fix two breaking changes |
The risk score is not the CVSS. It combines the CVE’s severity, the exploit signals we track (KEV listing, public PoCs, weaponized tooling, EPSS), whether the vulnerable code is reachable in this service, and the business criticality of the application it belongs to. For this CVE the exploit signals max out, so reachability is what separates a 100 from a 38.
Case 1: the easy one, if you know it’s reachable
order-notes-service is a CommonJS Express 5 app with a health check and two routes. It runs Node.js 24.22.0, the release right before the fix. Its code never mentions Brotli, zlib or fetch, and a quick read would call it unaffected.
It isn’t. POST /notes parses bodies with express.json() (src/app.js:10). Express 5.3.0 ships body-parser 2.4.0, and body-parser 2.x decompresses Content-Encoding: br with zlib.createBrotliDecompress() (body-parser/lib/read.js:224) before the route handler ever sees the request. Any unauthenticated client controls the compressed bytes that reach the vulnerable decoder. Backline’s Risk Analysis agent flagged exactly that path, with the file and line references above as evidence, and marked the other doors (fetch, brotliDecompress, brotliDecompressSync) as not reachable.
The fix is as small as it gets: move every Node.js pin from 24.22.0 to 24.22.1. There are five of them, and missing one is how a fix quietly doesn’t ship:
Dockerfile · .nvmrc · package.json · package-lock.json · .github/workflows/ci.yml
--- Dockerfile
-FROM node:24.22.0-bookworm-slim
+FROM node:24.22.1-bookworm-slim
--- .nvmrc
-24.22.0
+24.22.1
--- package.json
"engines": {
- "node": "24.22.0"
+ "node": "24.22.1"
}
--- package-lock.json (root engines mirror, regenerated by npm install)
- "engines": { "node": "24.22.0" }
+ "engines": { "node": "24.22.1" }
--- .github/workflows/ci.yml
- uses: actions/setup-node@v4
with:
- node-version: '24.22.0'
+ node-version: '24.22.1'
No code changes. Backline ran the service’s test suite on the new runtime, added a local test that plays the attacker’s part (a Brotli-compressed body with Content-Encoding: br against POST /notes), confirmed the whole thing passes on 24.22.1, and opened the pull request with that verification attached.
Case 2: affected, not reachable, and dismissed on purpose
inventory-import-service looks worse on paper than case 1. It runs Node.js 20.20.2, which is end of life and will never get a fix, and src/lib/compression.js contains a function that calls zlib.brotliDecompressSync. A grep-based triage would put it at the top of the list.
Backline’s Risk Analysis agent put it at the bottom, and here is what it had to establish to get there:
- Inbound
brnever reaches a decoder. Express 4.22.3 ships body-parser 1.20.9, which inflates onlygzip,deflateandidentity. A body withContent-Encoding: brgets415 unsupported content encoding "br"on bothPOST /itemsandPOST /import, before any decompression. - The Brotli helper is dead code.
decodeBrotliBuffer()is exported but no route, module or test calls it.src/app.jsimports onlygunzipBuffer, and gzip is a different decoder. - No outbound HTTP. The service makes no network requests and its full dependency tree (68 packages, all from Express 4) contains no HTTP client and no Brotli-aware decompressor.
src/lib/compression.js (exported, never called)
// Imported by src/app.js
function gunzipBuffer(buffer) {
return zlib.gunzipSync(buffer, { maxOutputLength: MAX_OUTPUT_BYTES });
}
// Exported, but no route, module or test calls it
function decodeBrotliBuffer(buffer) {
return zlib.brotliDecompressSync(buffer, { maxOutputLength: MAX_OUTPUT_BYTES });
}
module.exports = { gunzipBuffer, decodeBrotliBuffer };
Backline also added a local test that sends a Brotli body with Content-Encoding: br to POST /items and asserts the 415 and that nothing was stored, so the “no” is recorded as a check, not an opinion.
The customer’s remediation policy says: don’t open remediations for findings whose reachability is Not Reachable. So Backline dismissed this one and recorded why (“Matched condition: Reachability is Not Reachable”), instead of spending an engineer’s week migrating an EOL runtime under incident pressure. Note what the dismissal does not say: that Node.js 20 is fine. It isn’t, and the migration belongs on the roadmap. It just isn’t this CVE’s emergency.
Case 3: reachable through a dependency, and the version bump breaks the app
link-preview-service is an ESM service that turns a URL into a shareable preview card. Like case 2 it runs Node.js 20.20.2, and like case 2 its own code never calls fetch, zlib or any HTTP client. Unlike case 2, it is one hop away from the decoder:
Call path: POST /previews → Brotli decoder
POST /previews {url} src/app.js:25 (http/https check only, no host allowlist)
└─ getPreview(url) src/app.js:33 → link-unfurl/index.js (a dependency)
└─ fetch(url) link-unfurl/index.js:30 (global fetch decodes Content-Encoding: br)
└─ Node.js Brotli decoder
Anyone who can call the API points the service at a server they control, and that server chooses the Brotli bytes. Backline’s Risk Analysis agent followed the call into node_modules, reported the path above as evidence, and confirmed the mechanism with a local test: a server that serves a Brotli-compressed page, posted to /previews, comes back as a preview, which only works because fetch decoded it.
There is no patch for this runtime, and a bump alone breaks the service
Node.js 20 is end of life. The nearest fixed releases are 22.23.4 and 24.22.1, so this is a major-version migration, not a bump, and the customer’s remediation policy targets the 24 LTS line. Before touching the repository, Backline’s breaking-change analysis compared the service’s code and dependencies with what changed between Node.js 20 and 24, and flagged two things a Dockerfile-only fix would break. For this post we ran the unchanged service on node:24.22.1-bookworm-slim to show what that looks like. Nothing boots:
npm test · node:24.22.1-bookworm-slim · unchanged code
file:///work/src/config.js:1
import config from '../config.json' assert { type: 'json' };
^^^^^^
SyntaxError: Unexpected identifier 'assert'
TypeError [Error]: crypto.createCipher is not a function
Both worked on Node.js 20, with a deprecation warning in the logs that nobody was reading. Node.js 22 dropped import assertions in favor of import attributes, and removed crypto.createCipher / createDecipher (deprecation DEP0106) outright. A team that bumps the base image and ships finds this out in production, and a test suite that never loads config.js or issues a token would not have warned them.
The remediation plan Backline executed
The plan had three parts: move the five runtime pins to 24.22.1, replace the import assertion, and replace the cipher without invalidating existing data. The import assertion is a one-token change:
src/config.js
-import config from '../config.json' assert { type: 'json' };
+import config from '../config.json' with { type: 'json' };
The cipher is the trap. src/lib/tokens.js encrypts preview keys with createCipher('aes-256-cbc', secret), and every key the service ever issued is a link someone shared. The obvious rewrite, createCipheriv with a fresh key derivation, boots fine and silently breaks every existing link, because createCipher derived its key and IV from the secret with OpenSSL’s EVP_BytesToKey (MD5, one round, no salt) and nothing else does.
So the plan does two things in tokens.js:
- New keys use
createCipherivwith AES-256-GCM, an HKDF-SHA256 key and a random 96-bit IV, prefixedv2.and authenticated, so a tampered key is rejected. - Old keys (no prefix) go through a legacy decrypt path that reproduces
EVP_BytesToKeyand callscreateDecipheriv('aes-256-cbc', key, iv). Backline added a test for it that decrypts a key generated by the original code on Node.js 20.
src/lib/tokens.js
import crypto from 'node:crypto';
+const VERSION_PREFIX = 'v2.';
+const IV_BYTES = 12;
+const TAG_BYTES = 16;
+
+function deriveKey(secret) {
+ return Buffer.from(crypto.hkdfSync('sha256', secret, 'link-preview-service', 'preview-key/v2', 32));
+}
+
+// Keys issued before v2 were encrypted with crypto.createCipher, which derived the key and IV
+// from the secret with OpenSSL's EVP_BytesToKey (MD5, one round, no salt). Reproducing it keeps
+// those keys readable after createCipher was removed from Node.js.
+function legacyKeyAndIv(secret) {
+ const password = Buffer.from(secret, 'utf8');
+ let material = Buffer.alloc(0);
+ let block = Buffer.alloc(0);
+ while (material.length < 48) {
+ block = crypto.createHash('md5').update(Buffer.concat([block, password])).digest();
+ material = Buffer.concat([material, block]);
+ }
+ return { key: material.subarray(0, 32), iv: material.subarray(32, 48) };
+}
+
+function decryptLegacyToken(token, secret) {
+ const { key, iv } = legacyKeyAndIv(secret);
+ const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
+ return Buffer.concat([decipher.update(Buffer.from(token, 'base64url')), decipher.final()]).toString('utf8');
+}
+
export function encryptToken(plaintext, secret) {
- const cipher = crypto.createCipher('aes-256-cbc', secret);
- return Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]).toString('base64url');
+ const iv = crypto.randomBytes(IV_BYTES);
+ const cipher = crypto.createCipheriv('aes-256-gcm', deriveKey(secret), iv);
+ const ciphertext = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
+ return VERSION_PREFIX + Buffer.concat([iv, cipher.getAuthTag(), ciphertext]).toString('base64url');
}
export function decryptToken(token, secret) {
- const decipher = crypto.createDecipher('aes-256-cbc', secret);
- return Buffer.concat([decipher.update(Buffer.from(token, 'base64url')), decipher.final()]).toString('utf8');
+ if (!token.startsWith(VERSION_PREFIX)) {
+ return decryptLegacyToken(token, secret);
+ }
+ const payload = Buffer.from(token.slice(VERSION_PREFIX.length), 'base64url');
+ const iv = payload.subarray(0, IV_BYTES);
+ const tag = payload.subarray(IV_BYTES, IV_BYTES + TAG_BYTES);
+ const decipher = crypto.createDecipheriv('aes-256-gcm', deriveKey(secret), iv);
+ decipher.setAuthTag(tag);
+ return Buffer.concat([decipher.update(payload.subarray(IV_BYTES + TAG_BYTES)), decipher.final()]).toString('utf8');
}
With the plan executed, Backline ran the full suite on Node.js 24.22.1 and it passes. It also passes on Node.js 20.20.2: the code changes can be deployed first, on the old runtime, and the runtime switch becomes a separate, boring rollout. Backline flagged this remediation as Review needed rather than a safe auto-merge, because it changes application code and a crypto format, and attached the reasoning so the reviewer doesn’t have to rediscover it.
If you’re impacted: the checklist, and why “just bump Node” is only step 3
A version bump is the whole fix for case 1 and only part of it anywhere else. On Node.js 20 there is no version to bump to, and on 22 or 24 the runtime removed APIs your code may depend on. Your test suite may or may not tell you; most don’t cover config loading, token formats or startup. Here is the order we’d work in.
- Find the images, not the packages. Pull the runtime version out of every image scan (Inspector, or any scanner that inventories binaries). Lockfile tools won’t help. Affected: Node.js 20 or older, 22 below 22.23.4, 24 below 24.22.1, and 26 below 26.12.1.
- Decide reachability per service before you decide priority. Walk the three doors above for each service and write down the evidence for every no: which body parser is in play, whether anything calls
fetch()on an outsider’s URL, and whether any directzlibBrotli call is actually invoked. The door grep misses is the second one; followfetch()intonode_modules. If all three are no, record the evidence and move the migration off the incident track. If any is yes, it goes on the incident track. - Pin the runtime in every place it’s pinned. Dockerfile,
.nvmrc,package.jsonengines, the lockfile’s mirror ofengines, and CI’ssetup-node. A service whose Dockerfile says 24.22.1 and whose CI still tests on 24.22.0 has not been verified. - Analyze the breaking changes before you change anything, and don’t let the test suite be the analysis. A green suite on the new runtime proves only what the suite covers, and a red one is a partial list. Instead, diff what changed between your runtime and the target (removed APIs, dropped syntax, changed defaults) against your code and your dependencies, and write the migration plan from that. For a 20 to 22/24 jump, start with these:
assert { type: 'json' }import assertions are gone: usewith { type: 'json' }.crypto.createCipher/createDecipherare gone (DEP0106): move tocreateCipheriv/createDecipheriv.- Native addons need a rebuild against the new ABI; packages with an
engines.nodeceiling need a bump. - Deprecation warnings in your current runtime’s logs are a cheap first pass. They are not the whole list.
- When a removed API shaped persisted data, migrate the data path, not just the call.
createCipheris the example here: swapping increateCipherivwith a new key derivation compiles, passes a naive test and invalidates every token already in the wild. Keep a decrypt path for the old format (forcreateCipherthat means reproducingEVP_BytesToKey), write the new format with a version marker, and test the old format against a fixture produced by the original code on the old runtime. The same shape applies to any removed API whose output you stored: hashes, serializers, URL parsers. - Make the code changes deployable on the old runtime first. If the migrated code passes on both runtimes, ship it before the image change. Then the runtime switch is a one-line Dockerfile diff with a clean rollback.
- Verify on the fixed image, then attach the verification to the PR. Run the existing suite on the new runtime, add a test that plays the attacker’s part through the door you found in step 2, and put the output in the PR. That is what lets a reviewer approve a crypto change.
Final Take Out
HTTP2Shell is a runtime bug wearing a dependency-CVE costume. It lives where lockfile scanners don’t look, its exploitability depends on framework and dependency behavior your own code never mentions, and its fix ranges from a one-line bump to a major migration with data-compatibility work. Treating the three cases above the same way, either by ignoring all of them or by migrating all of them in a panic, is the expensive mistake.
That is the work Backline did for our customers automatically: image to repository to application, reachability with file-and-line evidence, exploit signals and business criticality folded into one score, the customer’s policy deciding what gets dismissed, and pull requests that carry the breaking-change fixes and the test runs that prove them. The three lab services are small on purpose; the paths through Express 5, a transitive fetch, and a removed crypto API are the shapes we saw at customers.
If you want to see how your images score, or you’re staring at a Node.js 20 fleet and a Friday, talk to us.