Low Severity CVE-2026-111497
Published: Nov 3, 2026

[GitHub] CVE-2026-111497-brotli-pwn

Other
Type
N/A
CVSS Score
1
Views
Anonymous
Author

Description

# CVE-2026-111497: Node.js Brotli decoder OOB write — analysis, PoC, Docker lab

> Chinese version above, English version below.

This repository documents our reproduction and analysis of CVE-2026-111497. All experiments were completed locally or on self-built test machines, with no access to any third-party systems.

## Summary

| Capability | Result | Conditions |
|---|---|---|
| Local code execution | ✅ 3/3 reproducible | Node + unpatched libbrotlidec + deterministic layout (`--predictable` or ASLR disabled) |
| Denial of service | ✅ 86-byte stream | Any unpatched version, no high traffic required |
| Remote overflow trigger | ✅ Verified | Target process accepts two attacker-controlled writes |
| Remote process memory read | ✅ In inspector exposure scenarios | Process running with `--inspect` |
| Remote blind RCE | ❌ Not feasible | ASLR enabled, no `--predictable`; wrap compensation is unpredictable |

The last point is not due to lack of effort, but because this vulnerability itself only provides "16-byte write relative to ring," with no built-in address leak; public PoCs also stop at the same point. Section 5 details the specific bottleneck.

## 1. The Vulnerability

The Brotli decoder built into Node.js lacks length validation for the tail copy of `BrotliDecoderState.buffer.u8` on the streaming path of `BrotliDecoderDecompressStream`.

- Affected: Node 22.x < 22.23.4, 24.x < 24.22.1, 26.x < 26.12.1; already EOL branches are no longer patched.
- Fix commit: `google/brotli@0ed4268a4401abcb4472096340477cf4af7d1a2b` ("Detect and report invalid stream earlier"); Node side simultaneously exposes `BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH` in `src/node_zlib.cc`.
- Oldest reproducible commit: `34f020fa9daba975747b29885314c2545b7aa040`.

Triggering requires a stream of approximately 23 MB: first a 16 MiB compressed metablock, packed with 2^24 "zero-output" dictionary transform commands, exhausting `block_length[2]`; the decoder then returns `NEEDS_MORE_INPUT` but has already consumed all input. Writing a small segment of data afterward copies attacker bytes into the 8-byte `buffer.u8[]`, overflowing the structure boundary.

## 2. Environment Requirements

- Linux x86-64;
- Node.js 22/24/26, with `libbrotlidec.so.1` still an unpatched version (≤ 1.2.0 / 1.1.x). Ubuntu 24.04's included `nodejs` 22.22.1 is dynamically linked to system brotli and can be used directly for reproduction;
- `gcc`, `python3` (for stream generation and compilation);
- Ability to read `/proc/self/mem` (PoC uses it to locate decoder state and libc);
- Deterministic layout: `setarch x86_64 -R node ...` or `node --predictable`.

Check if the target is dynamically linked:

```console
$ ldd "$(command -v node)" | grep brotli
libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1
$ node -p "process.versions.brotli"
1.2.0
```

If `ldd` does not show `libbrotlidec` (common in official static builds), the vulnerability path is usually unreachable; switch to a distribution-packaged Node.

## 3. Reproduction

Generate the trigger stream (approximately 23 MB; not included in the repository):

```console
$ python3 poc/gen_stream.py stAA536.br "$(python3 -c 'print("aa"*536)')"
wrote=stAA536.br bytes=23069229 sha256=...
```

Run the local PoC:

```console
$ PWNCMD='printf CVE-2026-111497 > /tmp/pwn_marker.txt' PK=4 \
node --predictable poc/pwn_local.js
```

Translated to English from Chinese. Show original · see the source links.
Community Rating
0

Login to rate this exploit

Quick Actions