ANT-2026-0GNNMNPS · wabt
heap-buffer-overflow critical
Severity Claude critical · Security research firm critical · Maintainer -
Discovered by Claude Mythos Preview
Anthropic's analysis, sealed at approval. Disclosure to the maintainer was performed by Ada Logics.
ANT-2026-0GNNMNPS: Heap-buffer-overflow in wabt
When wat2wasm is run with --enable-annotations on a WAT file containing a @custom annotation inside a function body (e.g. (module(func(@custom "a")))), BinaryWriter::WriteExpr looks up the annotation's name in an unordered_map. The string_view key is malformed — an invalid pointer or underflowed length — so the libstdc++ hash routine reads out of bounds. ASAN reports a deterministic SEGV on a READ at an unknown address, reproducing in 3/3 runs. The agent attributes the root cause to an integer underflow producing a bogus string_view length.
Target
Project: wabt
Location: wabt::BinaryWriter::WriteExpr in binary-writer.cc
Technical Details
ASAN: "SEGV on unknown address 0x603000010000 ... caused by a READ memory access". The SEGV fires inside std::_Hash_impl::hash while hashing a string_view key for an unordered_map lookup in BinaryWriter::WriteExpr. The string_view backing the @custom annotation's name has a corrupted pointer or length (the agent reports an integer underflow in the length field), so the hasher walks off valid memory. ASAN classified this as SEGV rather than heap-buffer-overflow, but both point to the same bad-string_view root cause.
Crash trace (truncated — full trace in attached crash.log):
The PoC file `poc.bin` contains 27 bytes of WAT text: `(module(func(@custom "a")))`. When processed by `wat2wasm-asan --enable-annotations`, it triggers a deterministic SEGV crash in all 3 runs.
ASAN reports: `ERROR: AddressSanitizer: SEGV on unknown address 0x603000010000 ... caused by a READ memory access`.
The symbolized stack trace confirms the crash is in wabt project code:
- Frame #0: `std::_Hash_impl::hash` (libstdc++)
- Frame #1-2: `std::hash<string_view>::operator()` — hashing a corrupted string_view
- Frame #3-5: `unordered_map::operator[]` in `binary-writer.cc`
- Frame #6: `wabt::BinaryWriter::WriteExpr` in `binary-writer.cc`
- Frame #7: `wabt::BinaryWriter::WriteExprList` in `binary-writer.cc`
- Frame #8: `wabt::BinaryWriter::WriteFunc` in `binary-writer.cc`
- Frame #9: `wabt::BinaryWriter::WriteModule` in `binary-writer.cc`
- Frame #10: `wabt::WriteBinaryModule`
- Frame #11: `ProgramMain`
- Frame #12: `main`
The crash occurs when `BinaryWriter::WriteExpr` looks up a `@custom` annotation's name in an `unordered_map<string_view, CodeMetadataSection>`, but the `string_view` has an invalid/corrupted pointer or length, causing ASAN to detect a SEGV during the hash computation. This is consistent with the agent's reported "heap-buffer-overflow (OOB read via integer underflow in string_view length)."
The slight score reduction from 1.0 is because the ASAN error type reported is SEGV rather than the claimed "heap-buffer-overflow," though both indicate invalid memory reads and the root cause (bad string_view) is consistent.
Reproduction
- Create a WAT file containing a @custom annotation inside a function body, e.g. (module(func(@custom "a")))
- Invoke wat2wasm --enable-annotations on the file
- BinaryWriter::WriteExpr hashes a corrupted string_view and crashes
[No reproducer or sanitizer output attached — request from security-cvd@anthropic.com if needed.]
Acknowledgement
This vulnerability was discovered by Claude, Anthropic's AI assistant, and triaged by the Anthropic security team in collaboration with Anthropic Research. Please direct questions to security-cvd@anthropic.com and reference ANT-2026-0GNNMNPS.
Reference: ANT-2026-0GNNMNPS
Anthropic CVD Policy: https://www.anthropic.com/coordinated-vulnerability-disclosure
Triage and disclosure were performed by Ada Logics.
- Verdict
- true positive
- Severity
- critical
Dates from discovery through public reveal.
- 2026-03-24 Reported to tracker
- 2026-05-08 Sent to maintainer
- 2026-06-17 Patch released
- 2026-08-17 Publicly revealed
SHA-3-512 hash:
30a1ea8f8f1c83f149bc34f805cf81885cd514e723f4304fb70b041f55d97ec82f955898d3e2b6a2bd10230046c90b5fcbd6c1b0c9a4f126645dd8cfe7d67a61
Committed 2026-05-08 09:19 PT
Revealed 2026-08-17 16:28 PT
Verify (download preimage.json)
Show preimage JSON
{
"ant_id": "ANT-2026-0GNNMNPS",
"bug_class": "Heap-buffer-overflow",
"claude_severity": "critical",
"commit_sha": null,
"created_at": "2026-03-24T18:28:36+00:00",
"description": "When wat2wasm is run with --enable-annotations on a WAT file containing a @custom annotation inside a function body (e.g. `(module(func(@custom \"a\")))`), BinaryWriter::WriteExpr looks up the annotation's name in an unordered_map<string_view, CodeMetadataSection>. The string_view key is malformed — an invalid pointer or underflowed length — so the libstdc++ hash routine reads out of bounds. ASAN reports a deterministic SEGV on a READ at an unknown address, reproducing in 3/3 runs. The agent attributes the root cause to an integer underflow producing a bogus string_view length.",
"discovered_at": null,
"location": "wabt::BinaryWriter::WriteExpr in binary-writer.cc",
"poc_sha256": null,
"preimage_version": 1,
"project": "wabt",
"reproduction": [
"1. Create a WAT file containing a @custom annotation inside a function body, e.g. (module(func(@custom \"a\")))",
"2. Invoke wat2wasm --enable-annotations on the file",
"3. BinaryWriter::WriteExpr hashes a corrupted string_view and crashes"
],
"technical_details": "ASAN: \"SEGV on unknown address 0x603000010000 ... caused by a READ memory access\". The SEGV fires inside std::_Hash_impl::hash while hashing a string_view key for an unordered_map lookup in BinaryWriter::WriteExpr. The string_view backing the @custom annotation's name has a corrupted pointer or length (the agent reports an integer underflow in the length field), so the hasher walks off valid memory. ASAN classified this as SEGV rather than heap-buffer-overflow, but both point to the same bad-string_view root cause.",
"title": "Heap-buffer-overflow in wabt",
"vendor_severity": "critical"
}