TIL: process.versions.brotli won't tell you if Node is patched
process.versions.brotli reports the same Brotli version before and after Node's CVE-2026-111497 fix. Check zlib.constants for the -17 error code instead.
If you want to know whether a Node.js runtime has the fix for CVE-2026-111497 (the Brotli decoder out-of-bounds write), process.versions.brotli won’t tell you. Node cherry-picked a single upstream commit (deps: brotli: cherry-pick 0ed4268a4401abcb44720963) instead of moving to Brotli 1.2.1, so the reported version stays the same across the fix.
The same security release added src: expose BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH (changelog), the new error code from the upstream fix. That constant is a feature you can check from code:
// check-brotli-fix.mjs
import zlib from 'node:zlib';
const code = zlib.constants.BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH;
console.log('node', process.version, '| bundled brotli', process.versions.brotli);
console.log(code === -17
? 'block-switch error code present (-17): patched decoder'
: 'block-switch error code missing: upgrade to 22.23.4, 24.22.1 or 26.12.1');
Run against the official Linux x64 binaries on October 25, 2026, last vulnerable release next to first fixed release in each line:
node v24.22.0 | bundled brotli 1.2.0
block-switch error code missing: upgrade to 22.23.4, 24.22.1 or 26.12.1
node v24.22.1 | bundled brotli 1.2.0
block-switch error code present (-17): patched decoder
node v22.23.3 | bundled brotli 1.1.0
block-switch error code missing: upgrade to 22.23.4, 24.22.1 or 26.12.1
node v22.23.4 | bundled brotli 1.1.0
block-switch error code present (-17): patched decoder
24.22.0 and 24.22.1 both say Brotli 1.2.0. Only the constant changes.
Two caveats. The version number is still the real answer: 22.23.4, 24.22.1, 26.12.1 or later in the same line. And a distro that backports the decoder patch into its own Node build may not expose the constant, so on a distro package a missing constant means you should read the vendor advisory before concluding anything.
If you deploy to a managed runtime such as Vercel, logging these two lines from a function shows what’s actually running. A Vercel community thread from October 23 shows a redeployed function printing node=v24.21.0 and brotli=1.2.0, and that brotli number alone couldn’t have told anyone whether it was patched.
My earlier TIL on HN Algolia numericFilters was the same kind of lesson: the obvious field isn’t the one that answers your question.