Description
Wasmtime is a runtime for WebAssembly. In versions prior to 24.0.9, 36.0.10, and 44.0.2, when a filesystem preopen is given DirPerms::all() and FilePerms::READ without FilePerms::WRITE, this access control mechanism can be bypassed via the wasip2 descriptor.open-at or wasip1 path_open interfaces by opening a file with only the OpenFlags::TRUNCATE oflag. The root cause is that the clause handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at, lines 967–969) did not set open_mode |= OpenMode::WRITE;, which is later used for the access control check against FilePerms to determine whether opening the file is permitted; the single-line fix adds that missing assignment, after which the affected calls correctly fail with error-code.not-permitted and ERRNO_PERM respectively. Only wasmtime-wasi embeddings that combine DirPerms::MUTATE with FilePerms::READ are affected by this bug. In particular, the Wasmtime project's wasmtime-cli's use of wasmtime-wasi is not affected, because it always sets FilePerms::all() for all preopens. This issue has been fixed in versions 24.0.9, 36.0.10 and44.0.2.
Published: 2026-06-15
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

Generated by OpenCVE AI on August 13, 2026 at 20:18 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to a fixed Wasmtime release (v24.0.9, v36.0.10, v44.0.2 or later).
  • Adjust the embedding configuration to avoid combining DirPerms::MUTATE with FilePerms::READ when setting preopens.
  • Restrict or remove support for the TRUNCATE flag from untrusted modules until a patch is available.

Generated by OpenCVE AI on August 13, 2026 at 20:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-2r75-cxrj-cmph wasmtime-wasi: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction
History

Tue, 16 Jun 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 16 Jun 2026 09:15:00 +0000

Type Values Removed Values Added
First Time appeared Bytecodealliance
Bytecodealliance wasmtime
Vendors & Products Bytecodealliance
Bytecodealliance wasmtime

Mon, 15 Jun 2026 20:30:00 +0000

Type Values Removed Values Added
Description Wasmtime is a runtime for WebAssembly. In versions prior to 24.0.9, 36.0.10, and 44.0.2, when a filesystem preopen is given DirPerms::all() and FilePerms::READ without FilePerms::WRITE, this access control mechanism can be bypassed via the wasip2 descriptor.open-at or wasip1 path_open interfaces by opening a file with only the OpenFlags::TRUNCATE oflag. The root cause is that the clause handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at, lines 967–969) did not set open_mode |= OpenMode::WRITE;, which is later used for the access control check against FilePerms to determine whether opening the file is permitted; the single-line fix adds that missing assignment, after which the affected calls correctly fail with error-code.not-permitted and ERRNO_PERM respectively. Only wasmtime-wasi embeddings that combine DirPerms::MUTATE with FilePerms::READ are affected by this bug. In particular, the Wasmtime project's wasmtime-cli's use of wasmtime-wasi is not affected, because it always sets FilePerms::all() for all preopens. This issue has been fixed in versions 24.0.9, 36.0.10 and44.0.2.
Title Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction
Weaknesses CWE-284
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N'}


Subscriptions

Bytecodealliance Wasmtime
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-06-16T12:46:04.260Z

Reserved: 2026-05-18T23:03:37.229Z

Link: CVE-2026-47261

cve-icon Vulnrichment

Updated: 2026-06-16T12:45:59.846Z

cve-icon NVD

Status : Analyzed

Published: 2026-06-15T21:17:11.153

Modified: 2026-06-17T16:42:08.350

Link: CVE-2026-47261

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T20:30:02Z

Weaknesses