"SIREN v3.0 — Four Gigabytes from Seventy-Eight Bytes: Precisely Weaponizing CVE-2026-32836 in dr_flac"
SIREN v3.0 — Four Gigabytes from Seventy-Eight Bytes
CVE-2026-32836 · CWE-789 · MEMORY EXHAUSTIONTL;DR
malloc(0xFFFFFFFF) — a ~4 GiB allocation — in any application using dr_flac ≤ 0.13.3 with a metadata callback. That's the cover-art extraction path used by music platforms, podcast ingesters, and multimodal AI pipelines. One upload, one OOM. No auth, no user interaction, and the file is a structurally valid FLAC.Section 1: Eating Crow (the v2.0 Correction)
When I shipped SIREN v2.0 in March, CVE-2026-32836 was fresh and only the summary line was public. I modeled it as "PADDING blocks containing fake nested headers causing O(n²) recursive parsing." It sounded plausible. It was wrong on every axis:
v3.0 exists to replace speculation with the verified finding from dr_libs issue #298 and the VulnCheck advisory. If you're running my v2 PoC against a patched parser and wondering why it does nothing — this is why.
Section 2: The Bug, Line by Line
drflac__read_and_decode_metadata(), PICTURE case, dr_flac.h v0.13.3:
The parser trusts a 32-bit length field enough to allocate from it before checking whether the block even contains that many bytes. blockSizeRemaining is capped at ~16 MB by the 3-byte FLAC block-size field, but the allocation doesn't care — mimeLength is a full uint32.
The same mistake repeats at line 6772 for descriptionLength. And the kicker: the same function already does it correctly for pictureDataSize at line 6824. This is an ordering inconsistency — the right pattern existed 20 lines away.
The gate
The PICTURE body is only parsed when onMeta != NULL (dr_flac.h:6728). drflac_open_memory() / drflac_open_file() without a callback skip it entirely. So the vulnerable population is exactly: everything that opens untrusted FLACs to look at their metadata — thumbnailers, cover-art scrapers, tag readers, multimodal ingest.
The edge case
mimeLength = 0xFFFFFFFF wraps the + 1 to zero and you get a harmless malloc(0). Use 0xFFFFFFFE: allocation size 0xFFFFFFFF, ≈ 4.00 GiB.
Section 3: The Weapon
The minimal reproducer fits in a tweet's worth of hex:
That's fLaC, a 34-byte STREAMINFO, then a last-block PICTURE header declaring a 32-byte body whose mimeLength field is 0xFFFFFFFE. The parser never gets to find out the body doesn't contain 4 GiB — it's already asked the heap for them.
The full SIREN v3.0 polyglot (372 bytes) keeps the v2 lineage — valid FLAC identity plus the adaptive SSML Vorbis carrier probing for Google/AWS/Azure/OpenAI TTS backends — and adds a dual-stage trigger: both mimeLength and descriptionLength set to 0xFFFFFFFE, ~8 GiB of allocation pressure from a single parse.
Section 4: Expected Outcomes (Verified Differential)
| Build | Input | Result |
|---|---|---|
| ≤ 0.13.3 + ASan | 78-byte file | libFuzzer/ASan: out-of-memory (malloc(4294967295)), origin frame dr_flac.h:6750 |
| ≤ 0.13.3 production | 78-byte file | ~4 GiB RSS spike per request; N concurrent uploads → OOM-killer → restart loop |
| ≤ 0.13.3 production | v3 polyglot | ~8 GiB per parse |
Patched (fefced4, 4f5a4cd, 663239a) | any | bounds check fires before malloc; open returns NULL; zero allocation |
The issue's GDB session is the cleanest causation proof I've seen in an advisory: breakpoint at 6750, overwrite mimeLength with 100 at runtime, resume — the line-6756 check fires (24 < 100) and the process exits normally. The allocation is the weapon; nothing else in the parse path is hostile.
Section 5: Abuse Model — Why This Is a TTS/AI-Pipeline Bug, Not Just a Library Bug
dr_libs ships as a single-header library. It gets vendored into binaries with no package-manager footprint, so dependency scanners don't see it. The realistic kill chain:
*_with_metadata() variant.For the SIREN threat model specifically: a multimodal AI pipeline that preprocesses audio uploads with metadata extraction is one curl command away from a downed ingest fleet.
Section 6: Detection & Mitigation
Patch: upgrade dr_libs past commit 663239a. The fix moves the blockSizeRemaining check before both allocations — matching the pictureDataSize pattern that was already correct.
If you can't patch today:
memory.max, ulimit -v, or Kubernetes memory limits turn a host-down event into a single-request failure.drflac__read_and_decode_metadata.Files
Everything is in the SIREN repo under v3/: the generator, both PoC files, the vulnerable-target harness (siren_v3_harness.c), full documentation, and the manifest.
CVE-2026-32836 credit: Ana Kapulica.
Comments
Post a Comment