Impact
The vulnerability is in Wasmtime’s WASI path_open and open_at interfaces. When a preopened directory is granted DirPerms::MUTATE and FilePerms::READ but not FilePerms::WRITE, an attacker can open a file using the OpenFlags::TRUNCATE flag and the implementation fails to mark the operation as a write because the WRITE bit is not set on the open_mode flag. This bypasses the later access‑control check that enforces FilePerms::WRITE. As a result, modules can truncate or overwrite files that should be read‑only, constituting an Access Control weakness (CWE‑284) and allowing integrity violations of preopened files.
Affected Systems
Bytecode Alliance Wasmtime runtimes built before v24.0.9, v36.0.10, or v44.0.2 are vulnerable when an embedding configures a preopened directory with DirPerms::MUTATE and FilePerms::READ. Embeddings that combine these permissions, such as the standard wasmtime-wasi library, are affected; the wasmtime-cli, which always uses FilePerms::all for its preopens, is not affected. The flaw was fixed in the releases cited in the advisories.
Risk and Exploitability
The CVSS score of 7.5 indicates medium‑to‑high severity. The EPSS score is below 1%, implying low exploitation likelihood. It is not listed in the CISA KEV catalog. Based on the description, the likely attack vector is a malicious WebAssembly module that requests a file open with the TRUNCATE flag; if the host’s preopen grants DirPerms::MUTATE and FilePerms::READ but not FilePerms::WRITE, the module can open the target file and truncate it. The flaw does not introduce denial‑of‑service or arbitrary code execution beyond the file modification context.
OpenCVE Enrichment
Github GHSA