(Brotli 1.0.3–1.2.0 per the upstream CVE record, plus bundled copies · Node.js, Python, Bun, Envoy · behind nginx/Apache/CDN proxies · v4 release, 2026-10-25)
Detection-engineering guide for the Brotli decoder out-of-bounds write (CVE-2026-111497, CWE-787 + CWE-252, CVSS v4.0 9.2): the decoder confuses malformed input with incomplete input, keeps filling an 8-byte state buffer past its end, and corrupts adjacent state. Our angle: reproduction and detection — not discovery.
Exploitation status: CISA's SSVC decision points as of 2026-10-23 show Exploitation = None, and the CVE is not in KEV. That assessment does not establish that no exploitation has occurred or will occur — the material below is directly useful for investigating suspicious activity today, not only for preparation.
Verification statuses — three independent dimensions (all three can be true at once for any rule):
- Rule correctness: does it compile, load, and behave as specified?
Our
sigma check+ functional suite covers this. - Detection performance: does it distinguish the target condition from realistic negatives? Only partially established — every rule is fixture-matched (fires on strings/flows from ONE crafted payload) with production precision unknown until production benign baselines run.
- Operational readiness: has it produced the intended alert from real deployed telemetry? No rule yet — all are deployment-unverified.
| Rule | Where | Rule correctness | Detection performance | Operational readiness |
|---|---|---|---|---|
sigma brotli-block-switch-probe (d399f74f) |
§1 | verified (fixture matrix, 137/137) | 2 pos / 15 neg — zero benign FP; fires only on the full-drain geometry (1 of 7 trigger variants) | unverified |
sigma python-decoder-unhealthy (39cd92fe) |
§1 | verified (fixture matrix) | 1 pos / 16 neg — zero benign FP; highest-precision receipt (flush-stage, patched builds); single-fixture caveat | unverified |
sigma node-zbuf-eof (71830d89, single-event) |
§1 | verified (fixture matrix + production-format fixtures) | 5 pos / 12 neg — confirmed FP class: fires on ANY truncated input (3 benign fixtures) → TRIAGE; cannot fire on line-split production logs — use the correlation rule below for that shape | unverified |
sigma python-decoder-failed (090042ad) |
§1 | verified (fixture matrix) | 14 pos / 3 neg — generic by design (version-blind) → TRIAGE | unverified |
sigma node-eof-message (d5178d3d) + node-zbuf-code (e384e932) — correlation component pair |
§1 | verified (production-format fixtures: each fires on line-split input where the single-event rule cannot) | generic components — informational level, correlation-only use | unverified |
sigma node-eof-near-zbuf (999a07f6, temporal correlation) |
§1 | verified on the production-format fixtures (fires on express/console.error stderr; the single-event rule does not); v4 removed logsource/condition to match the correlation spec — re-run sigma check |
fires on ANY truncated/malformed stream handled by the workload → TRIAGE | unverified |
sigma urllib3-decode-failure (4c8d283a) |
§1 | syntax-verified; string confirmed verbatim from urllib3/response.py (not yet fired against a live urllib3 receipt) | generic: any br decode failure trips it | unverified |
| suricata 2026114971 (br request-body tripwire, rev 3) | §3 | verified, HTTP/1.1 + HTTP/2 (pcap replays: fires on the br-request flow in both; silent on gzip/x-br bodies) | content-agnostic (header match) | unverified |
| suricata 2026114972/73 (egress anomaly, rev 4 — direction-corrected) | §3 | verified on asymmetric-HOME_NET pcaps (fires: internal client → external server; silent: inverted topology and benign) | supplementary — isolated flows only; urllib3/requests clients advertise br and are invisible to it (§3) | unverified |
| ModSecurity 2026114975 (br request-body) | §4 | verified (v3 engine, 7/7 fixtures) — fires on br/BR/br;q=0/gzip, br; silent on gzip/x-br/absent. v2 engine untested (needs Apache) |
token-precise at the engine level; FP source = clients legitimately sending br bodies | unverified |
falco crash→exec / memfd / egress (cve111497_falco.yaml) |
§2 | pattern-only; not compiled — v4 fixed three logic/syntax defects (see Changes in v4); validate with falco -V |
unknown | unverified — requires a kernel-instrumented host |
- Patch brotli to 1.0.10/1.1.1/1.2.1 (three fixed branches per the
upstream CVE record; versions outside 1.0.3–1.2.0 are unaffected per
that record — separate package/distributor advisories govern other
builds, and PyPA's advisory covers older affected
Brotlireleases); Node.js to 22.23.4/24.22.1/26.12.1; PythonBrotli≥1.2.1,brotlicffi≥1.2.1.0; Bun ≥1.4.4; Envoy/Istio per vendor. EOL Node lines (25, 23, 21, 20 and older): no fix — migrate. - Restart processes; rebuild containers. The decoder stays loaded until
both. Inventory by loaded decoder provenance:
process.versionis reliable for identifying official nodejs.org distributions, but it does not establish the status of separately loaded native libraries or application-vendored decoder copies. Known trap (verified in our lab):process.versions.brotlistill reports 1.2.0 on the patched node 24.22.1 — the cherry-picked fix does not bump the embedded string. Distro builds linking system libbrotli: inventory by distro package version. - Stopgap = tripwire: reject inbound request bodies with
Content-Encoding: brat the proxy — Brandefense's suggested mitigation (via Sysdig's analysis), not vendor guidance. App-side:express.json({ inflate: false })— note this rejects ALL compressed request bodies (gzip too), not only br. Run alert-only first to baseline; it doubles as a detection (§3). No evidence CDNs broadly deployed this on disclosure day. - Deploy the rules below, starting with the fixture-matched ones, and baseline before blocking.
One verified malformed payload (23,068,706 bytes, sha256 15273d4e…,
byte-identical to the independent lesterlam/node2shell reproduction's
MANIFEST) through four runtimes:
| Runtime | Vulnerable | Patched |
|---|---|---|
| node 24.22.0 (bundled brotli 1.2.0), one-shot and streaming | Z_BUF_ERROR: unexpected end of file (one-shot); ERR__ERROR_FORMAT_BLOCK_LENGTH_2 (streaming) |
— |
| node 24.22.1 (bundled brotli 1.2.0 + fix), one-shot | — | ERR__ERROR_FORMAT_BLOCK_SWITCH |
| python Brotli 1.2.0 (streaming, 1-byte feed) | no exception during the tested feed sequence; can_accept_more_data() remained True |
— |
| python Brotli 1.2.1 (streaming) | — | process() → generic decoder failed; flush → brotli.error: brotli: decoder is unhealthy |
Four consequences, stated carefully:
- The probe IS observable — but it needs a join key, and it is not by itself proof of intent. Both outcomes of a vulnerable-vs-patched probe are visible (bogus "unexpected end of file" vs the new hard error). A source producing BOTH across a fleet is mapping the estate — but a single error is only malformed-input telemetry. Decoder errors land in application logs without client IPs; IPs land in proxy logs — join on request IDs (or timestamp+source at the proxy) across the two stores.
process.versions.brotlilies;process.versiondoes not (for official distributions). Behavioral probing is the definitive classifier — and it is an active memory-corrupting payload: lab or canary only (§6).- No crash in our one-shot config. The OOB write happens in the decoder's 8-byte input stash during incremental feeding. Our raw-decoder ASAN harness (three feed geometries: 1KB chunks, byte-by-byte, and chunks-then-bytes) produced NO out-of-bounds access and clean rejections — an honest negative: the corruption requires the wrapper-level retry loop (node zlib / python binding), not the raw API with these geometries.
- In our tested Python harness, the vulnerable decoder raised nothing. That is a statement about one harness and one feed sequence — NOT that no production Python logger can record a problem, and not a prioritization argument. Prioritize patching by decoder reachability, exposure, blast radius, and patch availability — not by this asymmetry.
Eight Sigma rules ship in Appendix A: four direct detectors, a line-split component pair + temporal correlation (production log shapes), and a urllib3 wrapper rule. Every selection string is verbatim from captured receipts; the fixture matrix is Appendix B.
Production log shapes (verified against real Express 5 default-handler and
console.error stderr): node prints Error: unexpected end of file and
code: 'Z_BUF_ERROR' ~13 lines apart, and docker/k8s/journald ingest per
line — so a single-event rule requiring both strings never fires there. Use
the temporal correlation pair (node-eof-message + node-zbuf-code →
node-eof-near-zbuf) for that shape; the single-event node-zbuf-eof rule
applies to JSON-line loggers only (pino/winston serialize err.message and
err.code into one record). An empty br body (Content-Length: 0) produces
the same Z_BUF_ERROR receipt in Express — added to the FP class. Confounder
on the same bodies: GHSA-27r3-jxmh-p828 (body-parser hang on trailing bytes
after a compressed body, fixed in body-parser 2.4).
Specificity interpretation (important — these are diagnostic levels, not measured FP rates):
| Rule | Fires on | Interpretation |
|---|---|---|
brotli-block-switch-probe (d399f74f) |
*ERROR_FORMAT_BLOCK_SWITCH* |
high-value malformed-input telemetry — identifies a specific invalid Brotli condition on patched decoders; does NOT establish malicious intent by itself |
python-decoder-unhealthy (39cd92fe) |
brotli: decoder is unhealthy |
generic post-error decoder state — the 1.2.0 binding contains the same message (raised when operating on a decoder already marked unhealthy); our fixture shows it at the flush stage of 1.2.1, but it is not exploit-specific |
python-decoder-failed (090042ad) |
brotli: decoder failed |
generic decompression error — version-blind (both versions emit it); a named FP source exists in the wild (pydantic/httpx2 discussion #1124) |
node-zbuf-eof (71830d89) |
Z_BUF_ERROR + unexpected end of file |
incomplete-input / decompression-error triage — the pair occurs for benign truncated brotli and other compressed input; requires context before any escalation |
Decoder errors are observable indicators of malformed or incomplete compressed input. None independently establishes malicious intent, exploitation, or successful compromise.
Log-loss caveat: these receipts are RELIABLE FOR PROBES — a clean rejection lets the runtime serialize the error. A WEAPONIZED exploit corrupts the same state the logger depends on and often SIGSEGVs before any catch block flushes, and async log transports (Winston/Pino network sinks) can drop the final record at process death. Therefore: capture container stdout/stderr at the RUNTIME level (docker/k8s log driver, journald), never rely on application framework loggers — and treat the process-layer rules (§2) as the layer that survives weaponization.
Applicable logs (verified per stack where noted):
node application stderr and container stdout (docker/k8s log drivers);
Express 5 (v5.x, express.json middleware, node 24.22.0/24.22.1, default
error handler, NODE_ENV unset): the DEFAULT error handler emits both receipts
verbatim to stderr — Error: unexpected end of file + errno: -5, code: 'Z_BUF_ERROR' (vulnerable) and Error: Decompression failed + errno: -17, code: 'ERR__ERROR_FORMAT_BLOCK_SWITCH' (patched), with HTTP status 400.
The 400 status is what the HTTP layer returns — whether it appears in an
access log depends on request/access logging being configured; the stderr
receipt is the default-behavior observation. Custom error handlers can
behave differently.
journald for systemd node/python services; gunicorn/uvicorn worker logs;
proxy error logs do NOT see backend decoder errors unless the backend's
stderr is explicitly piped there; coredumpctl/journal for crash backtraces.
Outbound client wrappers (source-verified strings): urllib3 raises
DecodeError("Received response with content-encoding: br, but failed to decode it.") (urllib3/response.py) — sigma rule urllib3-decode-failure.
httpx wraps the binding message in httpx.DecodingError (httpx/_decoders.py)
— already covered by the binding rules. aiohttp raises ContentEncodingError
only when Brotli is NOT installed (http_parser.py) — not a decode-failure
signal. body-parser 1.x (Express 4) has no br case and rejects such bodies
(415); 2.x (Express 5) decodes them — a 415 on a br body is itself a signal.
Body-size limits and the tested stream: Express 5's default 100kb
limit counts DECOMPRESSED bytes — in our test the 23MB compressed stream
still reached the decoder and produced the receipt. Other output geometries
could hit the decompressed-output limit first; this is a measured finding for
the tested configuration, not a universal property. Wire-size limits
(nginx client_max_body_size) stop the stream at the proxy, and a 413 on a
Content-Encoding: br body is itself a detection signal. The trigger cannot
be assumed shrinkable: among our tested variants, only the 23,068,706-byte
fixture produced the differential — no global minimum triggering size has
been established.
A runtime sensor cannot see the overflow (Sysdig's conclusion; identical to our PHP2Shell finding). The detectable chain:
- node/python worker crashes (frequent; every PoC produces them — low value alone).
- The same workload then spawns a shell/downloader, loads a memfd, or makes new outbound connections — the pattern Sysdig's managed rule targets ("Node.js Process Crash Followed by In-Place Program Execution").
Parent-process scope: the falco parent macros for this CVE are
node, bun, python*, gunicorn, uvicorn, plus pm2 and cluster
primaries. Apache/nginx are NOT the parent of a proxied backend — a Node
app behind mod_proxy runs as its own process under systemd, pm2 or a container
init. (The PHP2Shell engagement's Apache-parented shells came from
php-fpm/mod_php execution and do NOT transfer here.)
Correlate on workload identity, not PID. Failed attempts crash the process, so the PID that crashed is gone; the successful attempt may not crash at all. Key on container ID / pod / systemd unit over a window (30 minutes as a starting point; tune to your baseline).
Suspicious execution is an independent signal — with context requirements.
In-memory exploitation may produce NO crash and NO /bin/sh spawn, so
memfd_create and outbound sockets from web-worker contexts must be evaluated
on their own. But "every memfd or outbound socket = Tier-1" would drown in
noise (node build tooling legitimately execs children). Alert Tier-1 when
there is meaningful context: execution FROM a memfd, unexpected destination
or first-seen egress, process ancestry inconsistent with the workload role,
or violation of a documented policy. The crash→exec chain remains the
strongest escalation path; its absence never downgrades a context-qualified
suspicious-execution alert.
- 2026114971 (rev 3, token-precise; HTTP/1.1 + HTTP/2): inbound request body with
Content-Encoding: br— the stopgap control doubles as detection. The FP source is legitimate clients that DO send br bodies (mobile apps, GraphQL uploaders, internal meshes) — run alert-only first to baseline, and scope any block to EXTERNAL PUBLIC INGRESS endpoints where br bodies are not documented. HTTP/1.1 AND HTTP/2 verified (the rule fires on a real HPACK-encoded h2 POST; the benign h2 control stays silent) — H3/QUIC and TLS-terminated paths remain untested; deploy at the terminating layer or accept the gap. - 2026114973 + 2026114972 (rev 4, direction-corrected) — SUPPLEMENTARY
protocol-anomaly telemetry, not a primary outbound detector. rev 3 and
earlier had the directions inverted (an internal-server shape) and replayed
clean only because both pcap endpoints sat inside the default HOME_NET —
always test with asymmetric HOME_NET (server on a public IP). Two
structural limits:
(a) flowbits are flow-scoped, not transaction-scoped — HTTP/1.1
keep-alive with multiple requests or HTTP/2 multiplexing can contaminate
the correlation; our three isolated-flow PCAP replays do not establish
correctness for persistent or multiplexed connections. (b) "Did not
advertise br" is not simply "no br in Accept-Encoding" — RFC 9110
negotiation semantics: header ABSENT → any content coding allowed;
*→ allowed;gzip, deflate→ br not advertised as acceptable;br;q=0→ explicitly unacceptable; EMPTY value → content coding not desired. Rev 4 approximates this: absent / empty /identity/gzip, deflate/br;q=0/x-brTAG;*and any non-zero-qbrcount as advertised. Absent-header tagging is a documented FP source. And even a genuine negotiation mismatch is not evidence of exploitation — malicious brotli can arrive after perfectly legitimate negotiation. Engine note: absence assertions do not work onhttp.request_header(chunk-wise evaluation); the rule useshttp.header.raw. Reliable evaluation needs HTTP-compliant interpretation plus transaction-granularity correlation — or the SIEM join. The strongest control for SSRF-prone workloads remains decompression checks / br stripping at service-mesh egress gateways (Envoy filters); Envoy itself is already patched. - The crafted stream itself: a structural bit pattern in a binary brotli stream — not expressible as a content match; capture-and-YARA or decoder-side logging covers it.
SecRule REQUEST_HEADERS:Content-Encoding "@rx (?i)(^|[,\s;])br([,\s;]|$)" \
"id:2026114975,phase:1,pass,log,msg:'CVE-2026-111497 br request body'"
- Token-precise POSITIVE match — verified against the real libmodsecurity
3.0.14 engine (7/7 fixtures: fires on
br,BR,br;q=0,gzip, br; silent ongzip,x-br, absent header). Never negate the operator: a draft with!@rxdenies requests WITHOUT br and passes the actual attack. Shownpass,log(alert-only first); switch todeny,status:415after baselining and only on protected endpoints. Engine directives and the rule ship separately (engine.conf+rule-2026114975.conf) — pasting a combined file flips SecRuleEngine On globally;pass,logproduces no intervention in the v3 API, so the harness (e7_modsec.cpp) asserts against the shipped deny twin (rule-2026114975.deny-twin.conf). - Covers INBOUND only. The outbound fetch path is invisible to a WAF (the response is decoded inside the client process). Mitigation for outbound: patching is the complete remedy, but an egress proxy/mesh that REJECTS br response encodings before decompression also removes the attack path (Envoy filters; §3).
| Signals | Verdict |
|---|---|
| br request body / malformed stream from one source | probe/scan |
| decoder error receipts from one source, no crash | version-probing (patched targets answer BLOCK_SWITCH) — malformed-input telemetry, not proof of intent |
node/python worker killed by SIGSEGV (exit 139) / abort (134) — k8s restartCount climbing — within seconds of a br transfer |
attempt (crashes are the noise floor — correlate before escalating) |
| suspicious process execution, memfd-backed execution, or anomalous network activity associated with an exposed brotli-decoding workload | suspected compromise — high-priority investigation. Confirm unauthorized execution before declaring confirmed RCE, and establish separate evidence before attributing that execution to CVE-2026-111497 |
The public results, stated precisely:
- Imperva Red Team: remote code execution on the official Node 24.22.0 arm64 image, achieved after several attempts (exploit unreleased).
- A second team (local-execution variant): needs an unfixed SYSTEM brotli plus a predictable memory layout; their blind remote attempt with ASLR failed. This is the result that matters for the system-libbrotli population — the majority of non-Node exposure.
- Vercel: memory disclosure demonstrated (crash with attacker-influenced state). A concrete network/process observable for the disclosure stage is still an open lab item — no detection row is claimed for it here.
- DoS-only dissent: one team argues crashes-only; the narrow-RCE framing above is the honest middle.
Our own lab: the behavioral differential is verified; the crash and any disclosure are NOT reproduced by us (§ consequence 3; see Limitations) — consistent with the "several attempts" and "predictable layout" caveats.
process.versions.brotliinventory on cherry-picked builds (reports 1.2.0 on patched node 24.22.1); node-version inventory on distro builds and for application-vendored decoder copies — inventory by loaded decoder provenance.- Payload byte-signatures for the stream (structural bit pattern; the attacker-controlled parts — addresses, commands — change per target).
- Content-match rules for the crafted stream at the network layer.
- Crash-only alerting (the noise floor), and WAF coverage of outbound fetches.
- Removing
brfromAccept-Encoding— a malicious server sends br anyway, andfetch()in Node ignoresAccept-Encoding: identityentirely (Semgrep) — our egress rule exists precisely because of this. - Relying on body-size limits for insulation in node-direct stacks: the tested limit counts decompressed bytes, so the compressed 23MB trigger reached the decoder anyway (scoped to the tested stream/middleware). Wire-size limits at proxies DO insulate.
- Behavioral probing of production services: it is an active memory-corruption payload — lab or canary only.
- Treating any single decoder error as evidence of attack: the generic strings fire on benign truncated input (§1).
- https://broccoli2shell.com/ — recall notice: version matrix, exposure map, vendored-copy audit, patch/verification commands
- https://www.aikido.dev/blog/python-packages-vulnerable-node2shell-brotli-cve-2026-111497 (2026-10-23) — Python blast radius: urllib3/requests/aiohttp/httpx auto-decode, patch matrix, HTTP2Shell framing
- https://www.sysdig.com/blog/node2shell-cve-2026-111497-detecting-the-node-js-brotli-rce (2026-10-24) — reachability table, demonstrated-vs-claimed, runtime-detection model, Debian system-brotli note, Brandefense attribution
- Node.js October 2026 security releases; GHSA-9v8h-qqgm-4m35; https://nvd.nist.gov/vuln/detail/CVE-2026-111497
- https://github.com/google/brotli/releases + fix commit
0ed4268 - Imperva Red Team — code execution on the official Node 24.22.0 arm64 image
- OpenSourceMalware — Python impact analysis; OpenAI/patchtheplanet — February disclosure timeline
- Semgrep —
fetch()ignoringAccept-Encoding: identity - urllib3/response.py, httpx/_decoders.py, aiohttp/http_parser.py — wrapper error strings verified from source
- GHSA-27r3-jxmh-p828 — body-parser hang on trailing bytes after a compressed body (fixed 2.4) — confounder on the same br bodies
- pydantic/httpx2 discussion #1124 — named FP source for generic brotli decode errors
- https://github.com/lesterlam/node2shell — independent reproduction whose MANIFEST our payload matches byte-for-byte
- Our own lab (2026-10-25): 4-runtime A/B differential on the verified
23MB payload (
cmd-drain-t24.br(sha25615273d4e…, Appendix D)); receipts in Appendix C; pcap replay results; raw-decoder ASAN negative (lab records not distributed — hashes in Appendix D) - URLs pending verification: OpenSourceMalware post, OpenAI/patchtheplanet post, Imperva write-up, Brandefense write-up, httpx2 discussion.
Every artifact is in Appendix A under a heading that is its filename. To extract them and check integrity against Appendix D:
import re, hashlib, pathlib, sys
F = "`" * 3 # code-fence marker, built so this snippet stays renderable
md = pathlib.Path(sys.argv[1]).read_text()
out = pathlib.Path("artifacts"); out.mkdir(exist_ok=True)
for name, body in re.findall(r"^## `([^`]+)`\n\n" + F + r"\w*\n(.*?)" + F, md, re.S | re.M):
(out / name).write_text(body)
d1 = re.search(r"^## D1 — Distributed.*?" + F + r"\n(.*?)" + F, md, re.S | re.M).group(1)
for line in filter(str.strip, d1.splitlines()):
h, name = line.split()
got = hashlib.sha256((out / name).read_bytes()).hexdigest()
print(("OK " if got == h else "BAD ") + name)Hashes are SHA-256 of each code block's exact content (trailing newline included). The trigger payload is not distributed; its hash is listed for matching against the independent reproduction only.
- Falco (pattern-only, still uncompiled): rule 1 tested
proc.namefor the runtime AND the shell at once, so it could never fire — now tests the parent. Rule 2 condition was syntactically invalid (contains memfd:<macro>) — nowproc.is_exe_from_memfd. Rule 3 comparedfd.ipto a CIDR string and alerted on every connection — now the defaultoutboundmacro plus an allowlist.python*is now matched withstartswith(python3.12 etc.); allowlist macros added; output no longer asserts "suspected compromise" for a shell spawn alone. - Sigma 999a07f6: removed
logsourceandcondition, which are not part of a temporal correlation rule; documented the group-by field mapping. - ModSecurity: shipped the deny twin the 7/7 result depended on; fixed
the harness (missing
<cstring>, prepended directives were built but never loaded). Rule text unchanged. - Text: removed stale claims (2026114971 "HTTP/1.1 only", 73 "models
only the absence case"), duplicated sentences, internal references to
undistributed logs; corrected code-fence languages; regenerated Appendix D
(the previous
rule-2026114975.confhash did not match the shipped text).
title: Python Brotli decoder failed — generic binding error (CVE-2026-111497)
id: 090042ad-4fdb-4d20-a6c2-a276bdf0b1b8
name: cve-2026-111497-python-decoder-failed
status: experimental
description: >
Detects the python brotli binding's generic failure message. VERSION-BLIND:
vulnerable (1.2.0) and patched (1.2.1) bindings emit the identical string
and the binding exposes no error code, so this is triage-tier malformed-
input telemetry only. A named FP source exists in the wild
(pydantic/httpx2 discussion #1124). Correlate with br-transfer context.
date: 2026-10-25
logsource:
category: application
product: python
detection:
keywords:
- 'brotli: decoder failed'
condition: keywords
falsepositives:
- Any malformed or truncated brotli input (pydantic/httpx2 discussion #1124)
- Other libraries wrapping the same binding message
level: medium
tags:
- cve.2026-111497
- stp.2atitle: Python Brotli decoder unhealthy — poisoned-decoder state (CVE-2026-111497)
id: 39cd92fe-fa82-49bf-b7f5-d3c70b313a13
name: cve-2026-111497-python-decoder-unhealthy
status: experimental
description: >
Detects "brotli: decoder is unhealthy" — the python binding's refusal to
operate on a decoder that already failed. GENERIC POST-ERROR STATE: the
1.2.0 binding contains the same message (raised when operating on a
decoder previously marked unhealthy), so the string alone does not date
the build or prove a probe. It fires only if the application calls into
the decoder again after the first failure (app-behavior dependent). In
our fixture corpus it appeared once — the flush stage of the patched
1.2.1 binding after the malformed 23MB stream — and on no benign fixture.
date: 2026-10-25
logsource:
category: application
product: python
detection:
keywords:
- 'brotli: decoder is unhealthy'
condition: keywords
falsepositives:
- The 1.2.0 binding emits the same string after any first decoder failure
- Any application reusing a brotli decoder object after a failure
level: medium
tags:
- cve.2026-111497
- stp.3atitle: urllib3 brotli decode failure on response (CVE-2026-111497)
id: 4c8d283a-03ca-4a48-83d2-885deb4a0b5e
name: cve-2026-111497-urllib3-decode-failure
status: experimental
description: >
urllib3 raises DecodeError("Received response with content-encoding: %s,
but failed to decode it.") when the declared response coding cannot be
decoded — verbatim from urllib3/response.py (DECODER_ERROR_CLASSES path).
For Content-Encoding: br this is the outbound client-side attack surface
(a malicious server answers br to a vulnerable client). The chained
traceback carries the underlying binding message (covered by the python
binding rules). Generic: any br-decode failure trips it, including
truncated bodies and unrelated server bugs.
date: 2026-10-25
logsource:
category: application
product: python
detection:
enc:
- 'content-encoding: br'
msg:
- 'failed to decode it'
condition: enc and msg
falsepositives:
- Any br decode failure (truncated body, server bug, broken compressor)
- Clients fetching legitimately brotli-corrupted content
level: medium
tags:
- cve.2026-111497
- stp.2atitle: Node brotli decompression failure — Z_BUF_ERROR with unexpected EOF, single event (CVE-2026-111497)
id: 71830d89-a843-422c-afca-3f622f4636a4
name: cve-2026-111497-node-zbuf-eof
related:
- id: 999a07f6-5360-4d8b-b08a-fd48e8a7bca8
type: derived
status: experimental
description: >
Single-EVENT form: both the "unexpected end of file" message and the
Z_BUF_ERROR code inside one log record — produced by JSON-line loggers
(pino/winston serialize err.message and err.code into one record).
PRODUCTION console.error/Express output splits these ~13 lines apart and
per-line ingests never co-occur them: use the temporal correlation rule
999a07f6 for that shape. TRIAGE: this pair occurs for ANY truncated
brotli or gzip stream (3 benign fixtures in our corpus fire it) — it is
incomplete-input telemetry, not a CVE-specific signature, and the
vulnerable-side receipt additionally varies with chunk geometry.
date: 2026-10-25
logsource:
category: application
product: nodejs
detection:
zbuf:
- 'Z_BUF_ERROR'
eof:
- 'unexpected end of file'
condition: zbuf and eof
falsepositives:
- Any truncated or malformed compressed stream (gzip and brotli)
- Empty bodies with a compressed content-encoding
level: medium
tags:
- cve.2026-111497
- stp.2atitle: Node brotli decompression failure — EOF message near Z_BUF_ERROR code (CVE-2026-111497)
id: 999a07f6-5360-4d8b-b08a-fd48e8a7bca8
name: cve-2026-111497-node-eof-near-zbuf
status: experimental
description: >
Temporal correlation of the two line-split halves of a node zlib/brotli
decompression failure. Fires on ANY truncated/malformed brotli or gzip
stream (the single-line JSON-logger form is rule 71830d89). TRIAGE:
requires br-transfer context before escalation. Group by workload
identity; timespan covers one error serialization. GROUP-BY FIELD:
ContainerId comes from the log envelope (docker/k8s/journald metadata),
not the message — map it in your pipeline; the base rules are keyword rules.
date: 2026-10-25
modified: 2026-10-25
correlation:
type: temporal
rules:
- d5178d3d-344a-4713-bbbc-fcf5f1a1a18c
- e384e932-1273-4d90-8189-4c0660136ed6
group-by:
- ContainerId
timespan: 2s
falsepositives:
- Any truncated or malformed compressed stream handled by the same workload
level: medium
tags:
- cve.2026-111497
- stp.2atitle: Brotli malformed-stream probe — BLOCK_SWITCH rejection (CVE-2026-111497)
id: d399f74f-9849-4f38-91f8-801a95da0a3e
name: cve-2026-111497-brotli-block-switch-probe
status: experimental
description: >
Detects the BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH condition — the fixed
brotli decoder's hard rejection of an invalid block-switch stream. On
patched builds this is malformed-input telemetry for the CVE-2026-111497
probe/rejection path; it does NOT establish malicious intent by itself
(any invalid block-switch stream produces it). In our fixture corpus it
fires only on the full-drain geometry (23,068,706-byte stream) and on no
benign fixture. Applies to patched builds: unpatched builds answer the
same input with generic errors (Z_BUF_ERROR/EOF on node one-shot,
BLOCK_LENGTH_2 streaming) and never emit this constant.
date: 2026-10-25
logsource:
category: application
product: nodejs
detection:
keywords:
- '*ERROR_FORMAT_BLOCK_SWITCH*'
condition: keywords
falsepositives:
- Other invalid block-switch streams unrelated to this CVE
- Security scanners probing brotli handling
level: high
tags:
- cve.2026-111497
- stp.3atitle: Node zlib unexpected-EOF error message (CVE-2026-111497 correlation component)
id: d5178d3d-344a-4713-bbbc-fcf5f1a1a18c
name: cve-2026-111497-node-eof-message
related:
- id: 71830d89-a843-422c-afca-3f622f4636a4
type: derived
status: experimental
description: >
The err.message line of a node zlib/brotli decompression failure. GENERIC:
every truncated gzip/brotli stream produces it. Not a standalone detector —
exists only as a component of the temporal correlation with the
Z_BUF_ERROR code line (both land in separate log lines in production:
console.error/Express print the message ~13 lines before the code field,
and docker/k8s/journald ingest per line). Correlate on the workload
identity within a short window.
date: 2026-10-25
logsource:
category: application
product: nodejs
detection:
keywords:
- 'unexpected end of file'
condition: keywords
falsepositives:
- Any truncated or malformed compressed stream (gzip and brotli)
- Any other library surfacing this generic message
level: informational
tags:
- cve.2026-111497
- stp.2atitle: Node zlib Z_BUF_ERROR code line (CVE-2026-111497 correlation component)
id: e384e932-1273-4d90-8189-4c0660136ed6
name: cve-2026-111497-node-zbuf-code
related:
- id: 71830d89-a843-422c-afca-3f622f4636a4
type: derived
status: experimental
description: >
The errno/code line of a node zlib/brotli decompression failure
(code: 'Z_BUF_ERROR', errno: -5). GENERIC: truncated gzip produces the
same pair. Not a standalone detector — component of the temporal
correlation with the unexpected-EOF message line.
date: 2026-10-25
logsource:
category: application
product: nodejs
detection:
keywords:
- 'Z_BUF_ERROR'
condition: keywords
falsepositives:
- Any truncated or malformed compressed stream (gzip and brotli)
- gzip/zlib failures unrelated to brotli
level: informational
tags:
- cve.2026-111497
- stp.2a# CVE-2026-111497 (Node2Shell / Broccoli) — Suricata rules
# Sources: Aikido/Sysdig mitigation guidance; our lab A/B (2026-10-25).
# Statuses (the guide's three-dimension model): all rules below are
# rule-correctness-verified on pcap replay; detection-performance numbers are
# in the guide; NONE are operationally verified (no deployed telemetry).
#
# FP sources for the header matches: legitimate clients that send or accept
# br bodies (mobile apps, GraphQL uploaders, optimized meshes) — run
# alert-only first and baseline.
# Inbound tripwire (2026114971 rev 3): request body Content-Encoding is the
# br TOKEN (not x-br/br-custom/brotli). Verified HTTP/1.1 and HTTP/2.
# The engine only sees what the proxy forwards; deploy at the terminating
# layer. Alert-only first; scope any block to external ingress endpoints.
alert http any any -> $HOME_NET any (msg:"CVE-2026-111497 br request body (mitigation tripwire)"; \
flow:established,to_server; http.request_header; \
pcre:"/^content-encoding\x3a(?:[^\r\n]*[\s,])?br(?:[\s,\x3b]|$)/i"; \
reference:cve,2026-111497; classtype:attempted-admin; \
sid:2026114971; rev:3;)
# Egress anomaly pair (2026114973 + 2026114972 rev 4): the CLIENT-SIDE attack
# path — an internal client fetches from a server that answers with br
# although the client never advertised it. DIRECTION MATTERS: 73 tags requests
# FROM $HOME_NET TO $EXTERNAL_NET; 72 alerts on responses the other way.
# (rev 3 and earlier had the directions inverted — an internal-server shape —
# and replayed clean only because both pcap endpoints sat inside the default
# HOME_NET. Test with ASYMMETRIC HOME_NET: server on a public IP.)
# Granularity: flowbits are flow-scoped — HTTP/1.1 keep-alive and HTTP/2
# multiplexing can carry the bit across transactions; isolated flows only.
# 73 semantics (negation unit-tested 15/15 against the RFC 9110 truth table): TAG when
# no Accept-Encoding line advertises the br TOKEN — absent header and empty
# value TAG (documented crude case: RFC 9110 permits any coding when the
# header is absent — an FP source); `*` and fractional q-weights count as
# advertising (approximation); `br;q=0` TAGS (explicitly refused); x-br /
# br-custom / brotli TAG (not the br token).
# NOTE: urllib3/requests append ",br" to their default Accept-Encoding when
# Brotli is importable — vulnerable Python clients advertise br and are
# INVISIBLE to this rule. Coverage niche: cleartext fetches and clients that
# do not advertise br (undici fetch advertises br on HTTPS; cleartext SSRF to
# an http:// URL is the realistic gap — verify against the undici version in
# the target estate).
# Performance: pcre-only, no fast_pattern — every to-server request pays a
# regex evaluation; scope the deployment or accept the cost.
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2026-111497 stage: client did not advertise br"; \
flow:established,to_server; http.header.raw; \
pcre:"/\A(?![\s\S]*^accept-encoding[ \t]*:[ \t]*(?:[^\r\n]*,[ \t]*)?(?:\*(?![a-z0-9-])|br(?![a-z0-9-]))(?![ \t]*\x3b[ \t]*q[ \t]*=[ \t]*0(?:[.,]0+)?[ \t]*(?:[,\x3b\r\n]|$)))[\s\S]*\z/ims"; \
flowbits:set,cve111497.no_br_advertised; flowbits:noalert; \
reference:cve,2026-111497; sid:2026114973; rev:4;)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CVE-2026-111497 br response to non-br client (egress anomaly)"; \
flow:established,to_client; http.response_header; \
pcre:"/^content-encoding\x3a(?:[^\r\n]*[\s,])?br(?:[\s,\x3b]|$)/i"; \
flowbits:isset,cve111497.no_br_advertised; \
reference:cve,2026-111497; classtype:bad-unknown; \
sid:2026114972; rev:4;)
# ModSecurity v3 engine configuration — TEST HARNESS ONLY.
# WARNING: do NOT paste into a production response-body context; SecRuleEngine On
# enables blocking globally. In production, keep SecRuleEngine
# DetectionOnly until the alert-only baseline (guide §4) completes.
SecRuleEngine On
SecRequestBodyAccess On
SecResponseBodyAccess Off
SecRequestBodyLimit 52428800
SecRequestBodyNoFilesLimit 52428800
# CVE-2026-111497 br request-body tripwire — token-precise POSITIVE match.
# Verified against libmodsecurity 3.0.14 (7/7 fixtures via the deny twin):
# fires on br/BR/br;q=0/gzip,br; silent on gzip/x-br/absent.
# NEVER negate the operator: a !@rx draft denies requests WITHOUT br and
# passes the actual attack. Deploy pass,log (alert-only) first.
SecRule REQUEST_HEADERS:Content-Encoding "@rx (?i)(^|[,\s;])br([,\s;]|$)" \
"id:2026114975,phase:1,pass,log,msg:'CVE-2026-111497 br request body'"
# TEST HARNESS / POST-BASELINE ONLY. Same match as rule-2026114975.conf but
# disruptive, so the v3 API raises an intervention the harness can assert.
# Deploy only after the alert-only baseline, and only on protected endpoints.
SecRule REQUEST_HEADERS:Content-Encoding "@rx (?i)(^|[,\s;])br([,\s;]|$)" \
"id:2026114975,phase:1,deny,status:415,log,msg:'CVE-2026-111497 br request body'"
/* E7: ModSecurity v3 functional harness — drives the real libmodsecurity
* engine with the CVE-2026-111497 rule and a set of test transactions.
* Build: g++ -std=c++17 e7_modsec.cpp -I<inc> -L<lib> -lmodsecurity -o e7_modsec
* Run: LD_LIBRARY_PATH=<lib> ./e7_modsec rule-2026114975.deny-twin.conf
* Fixtures are inline below. The harness prepends the engine directives
* itself, so pass the RULE file, not engine.conf. Against the pass,log rule
* every expected match reports FAIL (no intervention) — use the deny twin.
* v4: edited for release (cstring include, prepended directives actually
* loaded); recompile and re-run before citing 7/7.
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <cstring>
#include <modsecurity/modsecurity.h>
#include <modsecurity/rules_set.h>
int main(int argc, char** argv) {
if (argc < 2) { std::cerr << "usage: e7_modsec <rule-file>\n"; return 2; }
modsecurity::ModSecurity modsec;
modsec.setConnectorInformation("e7-harness");
modsecurity::RulesSet rules;
std::ifstream rf(argv[1]);
std::stringstream rulesbuf;
rulesbuf << "SecRuleEngine On\nSecRequestBodyAccess On\nSecResponseBodyAccess Off\n"
<< "SecRequestBodyLimit 52428800\nSecRequestBodyNoFilesLimit 52428800\n"
<< rf.rdbuf();
if (!rf) { std::cerr << "cannot open " << argv[1] << "\n"; return 2; }
int loadError = rules.load(rulesbuf.str().c_str());
if (loadError < 0) { std::cerr << "rules load error\n" << rules.getParserError() << "\n"; return 2; }
// fixtures: name -> (header value, expect_block)
struct Fixture { const char* name; const char* enc; bool expectMatch; };
std::vector<Fixture> fixtures = {
{"br-body", "br", true},
{"gzip-body", "gzip", false},
{"no-encoding", NULL, false},
{"x-br-body", "x-br", false},
{"br-q0 (q-value governs responses; body still br)", "br;q=0", true},
{"multi-br (layered: gzip over br)", "gzip, br", true},
{"BR-upper", "BR", true},
};
int pass = 0, total = 0;
for (auto& fx : fixtures) {
modsecurity::Transaction txn(&modsec, &rules, NULL);
std::string uri = "/" + std::string(fx.name);
std::string httpver = "1.1";
std::string host = "target.local";
std::string method = "POST";
txn.processConnection("203.0.113.50", 12345, "10.0.0.5", 80);
txn.processURI(uri.c_str(), method.c_str(), httpver.c_str());
if (fx.enc) {
txn.addRequestHeader("Content-Encoding", std::string(fx.enc));
}
txn.addRequestHeader("Host", "target.local");
txn.processRequestHeaders();
const char* body = "\x1b\x2d\x00\x00 test-body";
txn.appendRequestBody((const unsigned char*)body, strlen(body));
txn.processRequestBody();
modsecurity::ModSecurityIntervention it;
it.status = 200;
it.disruptive = 0;
int hasIt = txn.intervention(&it);
bool fired = (hasIt == 1) && (it.status == 415 || it.disruptive);
total++;
bool ok = (fired == fx.expectMatch);
if (ok) pass++;
std::cout << fx.name << ": fired=" << (fired ? "YES" : "no")
<< " expected=" << (fx.expectMatch ? "YES" : "no")
<< (ok ? " [PASS]" : " [FAIL]") << "\n";
}
std::cout << "E7 RESULT: " << pass << "/" << total << " pass\n";
return (pass == total) ? 0 : 1;
}# CVE-2026-111497 — falco runtime rules. PATTERN-ONLY: never fired against
# this CVE and NOT compiled for this release (needs a kernel-instrumented
# host). Load AFTER the default falco_rules.yaml: uses its spawned_process,
# outbound and never_true macros. proc.is_exe_from_memfd needs Falco >= 0.35.
# Validate with `falco -V <file>` before deploying.
# Runtime/parent list corrected for Node/Python backends (systemd, pm2,
# container init — NOT apache/nginx; see guide §2).
- macro: cve111497_web_runtime
condition: (proc.name in (node, bun, gunicorn, uvicorn) or proc.name startswith python)
- macro: cve111497_web_parent
condition: (proc.pname in (node, bun, gunicorn, uvicorn, pm2) or proc.pname startswith python)
# Baseline allowlists — replace never_true with your expected children /
# destinations. Until populated, rules 1 and 3 are noisy by design (§2).
- macro: cve111497_expected_child
condition: (never_true)
- macro: cve111497_expected_egress
condition: (never_true)
# 1. Shell spawned by a web runtime. child_process.exec() and
# subprocess(shell=True) spawn /bin/sh legitimately: baseline first.
- rule: CVE-2026-111497 web runtime spawned shell
desc: node/bun/python web worker spawned a shell — investigate with workload context (guide §2, §5); not by itself proof of exploitation
condition: spawned_process and cve111497_web_parent and proc.name in (sh, bash, dash, zsh, ash, busybox) and not cve111497_expected_child
output: "CVE-2026-111497 shell from web runtime: %proc.name (parent %proc.pname) cmdline=%proc.cmdline user=%user.name container=%container.id"
priority: WARNING
tags: [cve_2026_111497, process, shell]
# 2. memfd-backed execution in a web-runtime process tree (standalone signal)
- rule: CVE-2026-111497 memfd execution in web runtime
desc: executable loaded from a memfd by or under a node/bun/python workload — in-memory execution indicator
condition: spawned_process and proc.is_exe_from_memfd=true and (cve111497_web_parent or cve111497_web_runtime)
output: "CVE-2026-111497 memfd execution: %proc.cmdline exe=%proc.exepath (parent %proc.pname container=%container.id)"
priority: CRITICAL
tags: [cve_2026_111497, process, memfd]
# 3. Egress from a web runtime. The default `outbound` macro already excludes
# loopback and RFC1918; "first-seen" requires the allowlist above.
- rule: CVE-2026-111497 outbound connection from web runtime
desc: outbound connection from a node/bun/python workload not in the egress allowlist — triage against baseline
condition: outbound and cve111497_web_runtime and not cve111497_expected_egress
output: "CVE-2026-111497 outbound: %proc.name connected to %fd.name (container=%container.id)"
priority: NOTICE
tags: [cve_2026_111497, network]Assertion unit: one assertion = (fixture × rule). 22 fixtures total: 14 variant/benign payload fixtures + 3 split A/B receipt files + 5 production-format stderr captures. The status table's per-rule pos/neg counts refer to the 17 COMBINED-mode fixtures listed below; the 5 production-format fixtures are asserted separately with line-split semantics. Total: 137/137 assertions pass.
| # | Fixture | Bytes | class |
|---|---|---|---|
| 1 | cmd-drain-t24.br (primary) | 23,068,706 | trigger |
| 2 | cmd-drain-c65536.br | 90,146 | trigger (shrunk count) |
| 3 | cmd-drain-c1048576.br | 1,441,826 | trigger (shrunk count) |
| 4 | lab-trigger.br | 25 | trigger |
| 5 | lab-trigger-t24.br | 49 | trigger |
| 6 | abenoshift.br | 26 | trigger |
| 7 | lit-flood-over.br | 14 | trigger |
| 8 | valid-text.br | 60 | BENIGN |
| 9 | truncated-valid.br | 36 | BENIGN (truncated) |
| 10 | truncated-drain.br | 11,534,353 | BENIGN (truncated) |
| 11 | random-1k.br | 1,024 | BENIGN (random) |
| 12 | empty.br | 0 | BENIGN (empty) |
| 13 | text.gz | 145 | BENIGN (gzip) |
| 14 | random-1k-as-br.br | 1,024 | BENIGN (random) |
| 15 | ab-node121-oneshot.txt | receipt | split A/B |
| 16 | py120-stream-flushok.txt | receipt | split A/B |
| 17 | py121-flush-unhealthy.txt | receipt | split A/B |
Node 24.22.0 one-shot receipt per payload fixture: 1 Z_BUF_ERROR/EOF;
2/3/5/6/7 BLOCK_LENGTH_2/CL_SPACE/DICTIONARY/BLOCK_LENGTH_1;
4 Z_BUF_ERROR/EOF; 8 decompressed OK; 9/10/12 Z_BUF_ERROR/EOF;
11 EXUBERANT_NIBBLE; 13 SIMPLE_HUFFMAN_ALPHABET; 14 RESERVED.
| # | Capture | lines | Z_BUF_ERROR line | EOF-message line |
|---|---|---|---|---|
| P1 | express_empty-br.stderr | 10 | yes | yes |
| P2 | express_truncated-br.stderr | 10 | yes | yes |
| P3 | express_gzip-as-br.stderr | 10 | no (SIMPLE_HUFFMAN_ALPHABET) | no |
| P4 | console_truncated-valid-br.stderr | 14 | yes (line 13) | yes (line 1) |
| P5 | console_existing-trigger.stderr | 14 | yes (line 13) | yes (line 1) |
On P1–P5 the single-event rule 71830d89 never fires (both strings are never in one event); the component pair fires on P1/P2/P4/P5 and the correlation follows; P3 is a clean negative for all node rules.
Key precision facts (per-rule, combined-mode fixtures):
- brotli-block-switch-probe: 2 pos / 15 neg — zero benign FP; only the full-drain geometry produces it.
- python-decoder-unhealthy: 1 pos / 16 neg — zero benign FP; flush-stage on patched 1.2.1 (reproduced 2x).
- node-zbuf-eof: 5 pos / 12 neg — 3 positives ARE benign truncations -> TRIAGE by construction.
- python-decoder-failed: 14 pos / 3 neg — generic, version-blind -> TRIAGE.
Gate results (2026-10-25): the HTTP/2 replay — 2026114971 fires on real-HPACK h2 POST, benign h2 silent. ModSecurity v3 (libmodsecurity 3.0.14
- C++ harness) — 7/7: fires on br/BR/br;q=0/gzip,br, silent on gzip/x-br/ absent; caught a shipped-rule inversion (!@rx). Falco — infeasible in container (needs kernel driver); pattern-only stands. Asymmetric-HOME_NET egress replays — direction-corrected rules fire/silent as specified.
# PROVENANCE: verbatim output lines transcribed from our A/B runs
# (captured from ab_test.js / ab_python_streaming.py / ab_python.py, 2026-10-25).
# Each line is the exact console receipt of the labeled build.
[node v24.22.0 — VULNERABLE — one-shot]
RESULT: exception Z_BUF_ERROR :: unexpected end of file
SURVIVED: yes
[node v24.22.1 — PATCHED — one-shot]
RESULT: exception ERR__ERROR_FORMAT_BLOCK_SWITCH :: Decompression failed
SURVIVED: yes
[python Brotli 1.2.0 — VULNERABLE — one-shot]
RESULT: exception error brotli: decoder failed
[python Brotli 1.2.0 — VULNERABLE — streaming]
after full feed: result = no-exception
can_accept_more_data = True <- True on a COMPLETE stream = the bug
is_finished = False
flush: ok
[python Brotli 1.2.1 — PATCHED — streaming]
after full feed: result = exception: error brotli: decoder failed
stderr: brotli.error: brotli: decoder is unhealthy
(CORRECTION 2026-10-25: the original transcription of this section said
"no-exception"; the reproducible behavior, re-run twice, is process()
failing generically and the FLUSH raising the poisoned-state error.
Lab test log not distributed.)