Loading...
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

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: ```rust dir_descriptor.open_at( PathFlags::empty(), FILENAME, OpenFlags::TRUNCATE, DescriptorFlags::READ, ) ``` ```rust 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: ```rust if oflags.contains(OpenFlags::TRUNCATE) { opts.truncate(true).write(true); } ``` and the single line fix is: ```rust 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`: ```rust 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 (129 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, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (3)

Affects 1 ecosystem: crates.io (1).

PackageEcosystemAffectedFixed In
wasmtime-wasi
crates.io
All versions44.0.2
wasmtime-wasi
crates.io
All versions24.0.9
wasmtime-wasi
crates.io
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. 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

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

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

Related CVEs

  • CVE-2026-93657
    HIGH

    hickory-resolver: Resolver::lookup() and Resolver::lookup_ip() APIs obscure DNSSEC validation failures

  • CVE-2026-18140
    HIGH

    aws-smithy-json: Uncontrolled recursion in the aws-smithy-json unknown-key skip path allows unauthenticated remote denial of service in smithy-rs generated servers

  • CVE-2026-58494
    MEDIUM

    WASI hard links and renames bypass wasmtime-wasi's FilePerms for destination

  • CVE-2026-54786
    LOW

    Wasmtime has a leak in WASIp1 `fd_renumber` implementation

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies