Impact
The vulnerability in Wasmtime’s WebAssembly System Interface (WASI) permits a malicious module to open a file with the TRUNCATE flag, bypassing the host’s FilePerms::WRITE restriction when DirPerms::MUTATE and FilePerms::READ are used. The bug stems from not setting the WRITE mode in the open_mode flag, causing the access control check to pass. This allows an attacker to truncate or overwrite files that should remain read‑only, potentially compromising configuration files or other critical data. The flaw is an Access Control weakness (CWE‑284).
Affected Systems
Affected products are Wasmtime runtimes from Bytecode Alliance prior to versions 24.0.9, 36.0.10, and 44.0.2. Only Wasmtime embeddings that combine DirPerms::MUTATE with FilePerms::READ are vulnerable; the wasmtime‑cli is not affected because it always uses FilePerms::all. The vulnerability has been fixed in the mentioned releases. If you use an older Wasmtime or an affected embedding, the issue remains.
Risk and Exploitability
The CVSS score of 7.5 indicates a medium‑to‑high severity. The EPSS score below 1% implies low likelihood of real‑world exploitation at the moment. The vulnerability is not listed in CISA’s KEV catalog. Based on the description, the likely attack vector is a malicious WebAssembly module that requests a file open with PATH_OPEN or OPEN_AT and uses the TRUNCATE flag; if the host confines access with FilePerms::READ and DirPerms::MUTATE, the module can manipulate the file contents. Since Wasmtime can run untrusted code in applications, this flaw could allow local privilege escalation for processes running Wasmtime or exfiltration of modified data. Regular patching mitigates the risk.
OpenCVE Enrichment
Github GHSA