Skip to main content
Menu
Advisories

Guest can panic host through filesystem timestamp before the epoch on wasip3

GHSA-MR2V-56J5-CMFCPublished Updated GitHub

Description

Impact

The wasmtime-wasi crate's implementation of WASIp3 on Unix hosts contained a bug where a guest could abort the host process by specifying a filesystem timestamp before the Unix epoch. The root cause is that the conversion of a guest-supplied timestamp to a system-specific representation erroneously asserted that the timestamp was after the Unix epoch.

Specifically the WASIp3 set-times and set-times-at methods on wasi:filesystem/types.descriptor take new-timestamp arguments whose timestamp variant contains an instant with a signed seconds field, and wasi:clocks documents negative seconds as times before the epoch.

The implementation of WASIp1 and WASIp2 is not affected by this issue because pre-epoch timestamps cannot be represented. This additionally does not affect Windows as the system-specific conversion code handled this case correctly. WASIp3 was first default-supported in Wasmtime 46.0.0. This additionally only affects WASIp3 implementations which give a preopened descriptor to the guest with mutable access. Read-only views of the filesystem are unaffected.

Patches

The fix is present in main and patch releases are made for 48.0.4 and 49.0.2.

Workarounds

There are no known workarounds for this issue and updating is recmomended.

Affected versions

References

GitHub · bytecodealliance/wasmtime