Threat Advisory

wasmtime-wasi Vulnerability Bypasses FilePerms Write Restriction

Threat: Vulnerability
Targeted Region: Global
Targeted Sector: Technology & IT
Criticality: High
[subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-47261 with a CVSS score of 7.5 is a privilege‑escalation flaw in the Rust wasmtime‑wasi library that enables a malicious WebAssembly module to bypass the intended write restriction on preopened directories. The vulnerability affects wasmtime‑wasi versions ≥ 37.0.0 < 44.0.2, ≥ 25.0.0 < 36.0.10, and any version < 24.0.9. When a host configures a directory with DirPerms::MUTATE and only FilePerms::READ, the library’s Dir::open_at implementation incorrectly treats the OpenFlags::TRUNCATE flag without setting the internal write mode, allowing the module to invoke the WASI descriptor.open‑at or path_open APIs with the TRUNCATE flag and obtain a writable handle despite lacking FilePerms::WRITE. An attacker only needs to supply a crafted WebAssembly payload that runs in the victim’s Wasmtime runtime and can reach the affected preopened directory; no network access or additional privileges are required. Successful exploitation grants the attacker the ability to overwrite or truncate arbitrary files within the preopened path, potentially leading to data loss, corruption of configuration files, or insertion of malicious code that can be executed by downstream services. Exploitation is possible only when the host uses the vulnerable combination of DirPerms::MUTATE with FilePerms::READ for a preopened directory.[/subscribe_to_unlock_form]

EXECUTIVE SUMMARY:

CVE-2026-47261 with a CVSS score of 7.5 is a privilege‑escalation flaw in the Rust wasmtime‑wasi library that enables a malicious WebAssembly module to bypass the intended write restriction on preopened directories. The vulnerability affects wasmtime‑wasi versions ≥ 37.0.0 < 44.0.2, ≥ 25.0.0 < 36.0.10, and any version < 24.0.9. When a host configures a directory with DirPerms::MUTATE and only FilePerms::READ, the library’s Dir::open_at implementation incorrectly treats the OpenFlags::TRUNCATE flag without setting the internal write mode, allowing the module to invoke the WASI descriptor.open‑at or path_open APIs with the TRUNCATE flag and obtain a writable handle despite lacking FilePerms::WRITE. An attacker only needs to supply a crafted WebAssembly payload that runs in the victim’s Wasmtime runtime and can reach the affected preopened directory; no network access or additional privileges are required. Successful exploitation grants the attacker the ability to overwrite or truncate arbitrary files within the preopened path, potentially leading to data loss, corruption of configuration files, or insertion of malicious code that can be executed by downstream services. Exploitation is possible only when the host uses the vulnerable combination of DirPerms::MUTATE with FilePerms::READ for a preopened directory.[emaillocker id="1283"]

RECOMMENDATION:

  • We recommend you to update wasmtime-wasi to version 44.0.2 or 36.0.10 or 24.0.9.

REFERENCES:

The following reports contain further technical details:
https://github.com/advisories/GHSA-2r75-cxrj-cmph

[/emaillocker]
crossmenu