fitzgen opened PR #15317 from fitzgen:main-backport-a81c82ebe3 to bytecodealliance:main:
AsyncWriteStream::writequeued every buffer it was handed, including empty ones. A zero-length write consumes nocheck_writebudget, so the budget did not bound how many of them could be queued: each call pushed oneBytesslot onto the worker'sVecDeque(and that deque never shrinks). A guest issuingoutput-stream.writewith an empty list in a loop could therefore grow host memory without bound, especially while the background writer was parked on a backpressured destination.Treat an empty write as a no-op. The background worker already did nothing with an empty buffer, so this is not observable to the guest. With empty writes dropped, every queued entry holds at least one byte of budget, so the queue length is bounded by the write budget.
GHSA-5m8g-xhq4-4h93
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
fitzgen removed the review request for wasmtime-wasi-reviewers from PR #15317.
fitzgen requested wasmtime-wasi-reviewers for a review on PR #15317.
fitzgen requested dicej for a review on PR #15317.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton has enabled auto merge for PR #15317.
alexcrichton added PR #15317 wasi: don't queue zero-length writes to AsyncWriteStream to the merge queue.
:check: alexcrichton merged PR #15317.
alexcrichton removed PR #15317 wasi: don't queue zero-length writes to AsyncWriteStream from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC