Skip to main content
Menu
Advisories

wasmtime-wasi-http: Empty Body Writes can result in Unbound Heap Usage with HTTP/2

GHSA-F8MM-GGR3-89WHPublished Updated GitHub

Description

A malicious wasi-http guest can cause unbounded host memory growth/exhaustion by performing a large number of zero-length writes on an outgoing HTTP body that is sent over HTTP/2 via hyper. Empty writes are not rejected and are queued as HTTP/2 DATA frames in host memory. Because zero-length frames consume neither HTTP/2 flow-control window nor hyper's send-buffer byte budget, nothing throttles the guest, and the queue only drains as a remote peer reads. A guest paired with a slow or stalled peer can grow host memory without bound.

The unbound memory allocations themselves occur due to an interaction between hyper and h2 for empty writes which decouples network backpressure from the backpressure mechanisms present on wasmtime-wasi-http's write paths. As such, only embedders using wasi-http backed by hyper are known to be vulnerable; this does include the wasmtime CLI's wasmtime serve implementation.

Embeddings of wasmtime may allow for an attacker able to deploy a wasi-http guest to cause a DoS via excess host resource usage (CWE-400) leading to heap exhaustion.

Affected versions

References

GitHub · bytecodealliance/wasmtime