Skip to main content
Menu
Advisories

wasi-http: Request with long url before query parameter crashes host

GHSA-W36R-2HCH-9XP9Published Updated GitHub

Description

A guest sending a request with ? occurring after byte 65535 in the url string can cause a panic in the host. This occurs because wasmtime-wasi-http's dependency on http was at a low enough bound to encounter http issue 855: the byte index of ? is stored as a u16 which can overflow. If indexing at the wrapped value results in an invalid character offset then the http crate will panic when trying to split at that offset. The fix to this issue is to require a more recent http crate version which includes the fix.

Guests can use the WASI http set-path-with-query to a string of any length and wasmtime-wasi-http will pass it unmodified to the http crate, so this is a guest-controlled panic in the host. It affects versions of wasmtime >= 46 with the WASIp3 interface and >= 48 with the WASIp2 interface. Earlier versions aren't affected because the panic in http happen in a thread and wasn't re-raised in the host.

Patches

Patches are present in main and in 48.0.6 and 49.0.3.

Workarounds

No known workarounds.

Affected versions

References

GitHub · bytecodealliance/wasmtime