WebAssembly sandbox blocked file access but left memory and CPU unbounded
A security review of afmpeg, a Go library using FFmpeg compiled to WebAssembly, found that while the sandbox correctly isolated file system and network access, it placed no limits on memory usage or execution time. A crafted media file declaring extreme video dimensions could push the WebAssembly guest to consume up to 4 GB of host memory, potentially triggering an out-of-memory kill on the host process. Separately, a pathological decode loop with no timeout could lock the runtime indefinitely, acting as a silent wedge rather than an outright crash. The developer addressed both issues in a single commit, setting a default 512 MB memory ceiling and a one-hour execution timeout, each overridable by the caller. The fix also establishes a policy that sandbox protections are enabled by default, so users who never consult hardening documentation still receive the safeguards.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in