VDB
Sign up
MEDIUM

GHSA-243v-98vx-264h

Wasmtime can panic when adding excessive fields to a `wasi:http/types.fields` instance

Details

### Impact

Wasmtime's implementation of the `wasi:http/types.fields` resource is susceptible to panics when too many fields are added to the set of headers. Wasmtime's implementation in the `wasmtime-wasi-http` crate is backed by a data structure which panics when it reaches excessive capacity and this condition was not handled gracefully in Wasmtime. Panicking in a WASI implementation is a Denial of Service vector for embedders and is treated as a security vulnerability in Wasmtime.

### Patches

Wasmtime 24.0.6, 36.0.6, 40.0.4, 41.0.4, and 42.0.0 patch this vulnerability and return a trap to the guest instead of panicking.

### Workarounds

There are no known workarounds at this time, embedders are encouraged to update to a patched version of Wasmtime.

### Resources

* [Limitations of `http::HeaderMap`](https://docs.rs/http/1.4.0/http/header/#limitations)

Are you affected?

Enter the version of the package you're using.

Affected packages

crates.io/wasmtime
Introduced in: 0Fixed in: 24.0.6

Upgrade wasmtime to 24.0.6 or newer (ecosystem crates.io).

crates.io/wasmtime
Introduced in: 25.0.0Fixed in: 36.0.6

Upgrade wasmtime to 36.0.6 or newer (ecosystem crates.io).

crates.io/wasmtime
Introduced in: 37.0.0Fixed in: 40.0.4

Upgrade wasmtime to 40.0.4 or newer (ecosystem crates.io).

References