WebAssembly allocator shim corrupts memory on allocation failure
Exact source revision recorded 26 Oct 2026 14:35:44 UTC. It does not establish the source's current position. Latest evidence.
osv · RUSTSEC-2026-0410
PublishedOn wasm32, zstd-sys provides `malloc` and `free` to the C library through a shim over Rust's allocator. The shim did not check for allocation failure: it wrote its size header to address 0 and returned address 4, which the C library used as a valid buffer. `free(NULL)` also read below address 0. Whenever the instance cannot grow its memory by what a frame asks for, a small crafted frame (a 9-byte header declaring a 128 MiB window is enough) made decompression write decoded data over the bottom of the module's linear memory, instead of failing. The corruption stays within the wasm sandbox. The flaw was corrected by returning NULL on allocation failure or size overflow, and by making `free(NULL)` a no-op.
- Source published
- 16 Oct 2026 12:00:00 UTC
- Source modified
- 26 Oct 2026 14:00:05 UTC
- Observed here
- 26 Oct 2026 14:35:44 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
This view projects the publisher's source fields for reading; the original JSON retains additional fields and CVE enrichment containers. Attribution: osv · OSV · upstream source license applies. Source text is retained; field grouping and change labels are provided by ChangeIntel.