News › #security

CVE-2026-111497: an out-of-bounds write in the Brotli decoder, reported by OpenAI Codex Security, hits Node.js, Bun, Envoy and Python clients

5 min readVerified
october-2026-security-releases

A malformed Brotli stream could make Google's C decoder write past an eight-byte internal buffer. Fixes shipped on 21 October 2026 in Brotli 1.0.10/1.1.1/1.2.1, Node.js 22.23.4/24.22.1/26.12.1, Bun 1.4.4, Envoy and Istio. We explain the bug, who is exposed (fetch, body parsers, Python HTTP clients), what is unknown about the AI role, and how to check your runtime.

In short

On 21 October 2026, Node.js, Google's Brotli project and several downstream projects shipped fixes for CVE-2026-111497, an out-of-bounds write in the Brotli decoder (Google rates it 9.2, Critical, under CVSS 4.0; Node.js rates it High). A crafted compressed stream can corrupt process memory; the advisories list crash, memory disclosure and possible remote code execution as consequences. The Node.js advisory credits Khai Tran and Sylvie Mayer of OpenAI Codex Security, The fixes shipped on the same day as PHP's fixes for two critical engine flaws that were also found with frontier models. The flaw is in the shared C library, so it reaches far beyond Node.js: Bun, Envoy, Istio, Python HTTP clients with the brotli package, and many applications that embed the decoder.

How it works

Brotli is the compression format behind Content-Encoding: br on the web. Many programs decompress Brotli data that comes straight from the network: an HTTP client that reads a server response, or a web framework that accepts a compressed request body. The decoder therefore parses attacker-controlled bytes.

A Brotli stream may announce how many different "block types" it uses and later switch between them. According to the Node.js advisory, the decoder did not treat an invalid block switch as a format error. It reported "I need more input" instead. A streaming caller then keeps feeding bytes, and the decoder keeps appending them to a small internal buffer of eight bytes, without ever rejecting the stream. Once more than eight bytes arrive, the write goes past the end of the buffer.

Analogy: a ticket checker who, on seeing an invalid ticket, says "wait a moment" instead of "rejected", while the queue keeps pushing people into a room with eight seats.

Under the hood

The bug class. The GitHub advisory classifies it as CWE-252 (unchecked return value); Cycode also lists CWE-787 (out-of-bounds write). The vulnerable code is c/dec/decode.c in google/brotli. The upstream fix commit is db24a98. iTnews reports that a related change ("detect and report invalid stream earlier") was already committed upstream in February 2026 but was not part of an official release until October; we could not confirm this from a primary source.

Why streaming makes it worse. A one-shot decoder that receives the whole input at once would simply stop when input ends. A streaming decoder is designed to pause when it needs more data and resume later. The faulty state (an error disguised as "needs more input") turns every additional chunk into another write. The attacker controls how many bytes are sent, so the size of the overflow is attacker-controlled.

CVSS 4.0 vector (GitHub advisory): AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H. Network-reachable, no privileges, no user interaction, but "attack requirements present": the target must actually run attacker data through a Brotli decoder.

Who is exposed (per Node.js and Cycode).

Path Exposed?
zlib.brotliDecompress, brotliDecompressSync, createBrotliDecompress on untrusted data yes
Built-in fetch() reading a response from a URL the attacker controls (it decodes br automatically) yes
Express 5 / body-parser 2.x, @fastify/compress, several Koa body parsers (decode br request bodies) yes
Express 4 / body-parser 1.x, a bare node:http server no automatic br request decoding
Python urllib3, requests, httpx, aiohttp, Scrapy with brotli or brotlicffi installed the decoder is used; code execution not shown for Python (Cycode)

Fixed versions.

Component Fixed in
Node.js 22.23.4, 24.22.1, 26.12.1 (20.x and other end-of-life lines get no fix)
google/brotli 1.0.10, 1.1.1, 1.2.1 (affected: 1.0.3 to 1.2.0)
PyPI brotli / brotlicffi 1.2.1 / 1.2.1.0
Bun 1.4.4 (rebuild bun build --compile binaries)
Envoy 1.40.0, 1.39.3, 1.38.6, 1.37.8
Istio 1.30.6, 1.31.2 (1.29.9 also listed; 1.29 is end-of-life)
brotli4j (Java) / Ruby brotli gem 1.24.0 / 0.9.1

Exploitation status. Cycode reports that code execution was demonstrated publicly on the official Node.js 24.22.0 arm64 image and that a public proof of concept exists. As of 23 October no exploitation in the wild was reported. Several outlets now use the name "HTTP2Shell"; this is a marketing name, not a flaw in the HTTP/2 protocol.

The AI angle, and what is unknown. The primary advisory only credits OpenAI Codex Security. The Hacker News reports that OpenAI's agents found the bug while red-teaming OpenAI's own training environment; OpenAI's own post on that work (23 October) does not mention Brotli, so we treat the connection as reported but unconfirmed. Neither source says how much of the discovery was done by a model and how much by the human researchers.

Mitigations if you cannot patch now (from the advisories and Impress Watch): reject Content-Encoding: br at the proxy, disable Brotli decompression in body parsers and HTTP clients, and turn off the Brotli decompression filter in Envoy and Istio. Removing br from Accept-Encoding is not enough, because a malicious server can send Brotli anyway. gzip and deflate are not affected.

Try it yourself

This script checks whether your Node.js release line is patched and shows, with harmless data, that fetch() decodes Brotli without being asked. It does not contain or trigger the exploit. Tested with Node.js 22.23.4 on Linux.

// check-brotli-exposure.mjs  (Node.js 18+)  run: node check-brotli-exposure.mjs
import http from "node:http";
import zlib from "node:zlib";

const fixed = { 22: [22, 23, 4], 24: [24, 22, 1], 26: [26, 12, 1] };
const v = process.versions.node.split(".").map(Number);
const t = fixed[v[0]];
const ok = t && (v[1] > t[1] || (v[1] === t[1] && v[2] >= t[2]));
console.log(`node ${process.versions.node}, bundled brotli string ${process.versions.brotli}`);
console.log(ok ? "release line patched for CVE-2026-111497" : "NOT patched or end-of-life line: upgrade");

const body = zlib.brotliCompressSync(Buffer.from("hello from a br-encoded response"));
const server = http.createServer((req, res) => {
  res.writeHead(200, { "Content-Encoding": "br", "Content-Type": "text/plain" });
  res.end(body);
}).listen(0, async () => {
  const r = await fetch(`http://127.0.0.1:${server.address().port}/`);
  console.log("fetch() returned:", JSON.stringify(await r.text()));
  zlib.brotliDecompress(Buffer.from([0x1b, 0xff, 0xff, 0xff, 0x00, 0x00]), (err) =>
    console.log("malformed input ->", err ? err.code : "no error"));
  server.close();
});

Output we got on Node.js 22.23.4:

node 22.23.4, bundled brotli string 1.1.0
release line patched for CVE-2026-111497
fetch() returned: "hello from a br-encoded response"
malformed input -> Z_BUF_ERROR

Note the second line of the first output: the patched Node.js 22.23.4 still reports Brotli "1.1.0". Do not use process.versions.brotli to decide whether you are patched; use the Node.js version. For Python, run pip show brotli brotlicffi and upgrade to 1.2.1 / 1.2.1.0 or later. For containers, check the base image tag and rebuild; a patched host does not fix an old runtime inside an image.

Sources

  1. Node.js October 2026 security releases (nodejs.org)
  2. google/brotli v1.2.1 release
  3. google/brotli fix commit db24a98
  4. GitHub Advisory GHSA-9v8h-qqgm-4m35
  5. Cycode: node2shell (CVE-2026-111497), what to patch
  6. iTnews: Node2Shell flaw embedded far beyond Node.js
  7. Impress Watch (Japanese): HTTP2Shell in Brotli
  8. The Hacker News: OpenAI agents demonstrate VM escapes