Skip to main content

CVE-2026-47261 — Vulnerability in wasmtime-wasi — CVE Details

HIGH

wasmtime-wasi: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction

Published June 5, 2026Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.50%). Schedule for your next planned update.

Does your project use an affected wasmtime-wasi version?

Paste your Cargo.lock to check it for CVE-2026-47261 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Cargo.lock

Summary

Summary

In wasmtime-wasi, when a filesystem preopen is given DirPerms::all() and FilePerms::READ without FilePerms::WRITE, this wasmtime-wasi enforced access control mechanism can be bypassed by using the wasip2 descriptor.open-at or wasip1 path_open interfaces by opening a file with OpenFlags::TRUNCATE oflag only, for example:

dir_descriptor.open_at(
   PathFlags::empty(),
   FILENAME,
   OpenFlags::TRUNCATE,
   DescriptorFlags::READ,
)
wasip1::path_open(
    dir_fd,
    0,
    FILENAME,
    wasip1::OFLAGS_TRUNC,
    wasip1::RIGHTS_FD_READ,
    0,
    0
)

The root cause is that the clause that considered OpenFlags::TRUNCATE did not set open_mode |= OpenMode::WRITE;, used later in that function for the access control check against FilePerms for whether opening that file is permitted. With the bug corrected, these calls to open-at and path_open fail with error-code.not-permitted and ERRNO_PERM respectively.

The bug in crates/wasi/src/filesystem.rs, Dir::open_at, lines 967–969:

if oflags.contains(OpenFlags::TRUNCATE) {
    opts.truncate(true).write(true);
}

and the single line fix is:

if oflags.contains(OpenFlags::TRUNCATE) {
    opts.truncate(true).write(true);
    open_mode |= OpenMode::WRITE;
}

Only wasmtime-wasi embeddings that use a combination of DirPerms::MUTATE with FilePerms::READ are affected by this bug, e.g. those that use in the WasiCtxBuilder:

builder.preopened_dir("readonly", "readonly", DirPerms::READ | DirPerms::MUTATE, FilePerms::READ);

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.

Advisory Timeline

  • First published June 5, 2026 (174 days ago).
  • Last revised September 10, 2026 — 97 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update wasmtime-wasi to 44.0.2 or later
cargo update -p wasmtime-wasi --precise 44.0.2
Cargo
Update wasmtime-wasi to 24.0.9 or later
cargo update -p wasmtime-wasi --precise 24.0.9
Cargo
Update wasmtime-wasi to 36.0.10 or later
cargo update -p wasmtime-wasi --precise 36.0.10

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
wasmtime-wasi crates.io · Affected: All versions44.0.2
wasmtime-wasi crates.io · Affected: All versions24.0.9
wasmtime-wasi crates.io · Affected: All versions36.0.10

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Frequently Asked Questions

What is CVE-2026-47261?
wasmtime-wasi: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2026-47261?
CVE-2026-47261 affects wasmtime-wasi. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-47261 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.50%
EPSS percentile: 35.8

This is a below-median EPSS score — only 35.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-2r75-cxrj-cmph
RUSTSEC-2026-0149

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock