CVE-2026-47261: wasmtime-wasi WASI Path_open(TRUNCATE) Bypasses `FilePerms::WRITE` Host Vulnerability

HIGH
Advisory Identifier: GHSA-2r75-cxrj-cmph
CVSS 7.5
CWE-284
Published
Advisory Summary

CVE-2026-47261 is a HIGH (CVSS 7.5) wasi path_open(truncate) bypasses `fileperms::write` host vulnerability (CWE-284: Improper Access Control) affecting wasmtime-wasi libraries in the crates.io ecosystem. The issue involves wasi path_open(truncate) bypasses `fileperms::write` host restriction. Remediation is available by upgrading affected packages to version 44.0.2, 36.0.10, 24.0.9.

CVE-2026-47261 at a Glance

CVE Identifier CVE-2026-47261
GHSA Identifier GHSA-2r75-cxrj-cmph
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-284: Improper Access Control
Affected Product wasmtime-wasi
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-47261

To remediate this vulnerability, upgrade all affected wasmtime-wasi dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

wasmtime-wasi fixed: 44.0.2
Upgrade wasmtime-wasi to 44.0.2
wasmtime-wasi fixed: 36.0.10
Upgrade wasmtime-wasi to 36.0.10
wasmtime-wasi fixed: 24.0.9
Upgrade wasmtime-wasi to 24.0.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for wasmtime-wasi

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-47261, inspect your project dependencies for wasmtime-wasi:

inspect dependencies for wasmtime-wasi

Analyze the terminal output to locate any version of wasmtime-wasi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 44.0.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In wasmtime-wasi, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-47261 Affected wasmtime-wasi Versions

3 component(s)
Fixed Versions:
44.0.236.0.1024.0.9
Product / Package Ecosystem Affected Versions Fixed Version
wasmtime-wasi
crates.io
≥ 37.0.0
< 44.0.2
44.0.2
wasmtime-wasi
crates.io
≥ 25.0.0
< 36.0.10
36.0.10
wasmtime-wasi
crates.io
< 24.0.9
24.0.9

References

Frequently Asked Questions

What is CVE-2026-47261?
CVE-2026-47261 is a security vulnerability in wasmtime-wasi involving WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction under CWE-284: Improper Access Control.
Which wasmtime-wasi versions are affected?
Affected versions include releases prior to 44.0.2, 36.0.10, 24.0.9 across affected packages: wasmtime-wasi.
What version fixes CVE-2026-47261?
Upgrading to 44.0.2, 36.0.10, 24.0.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is wasmtime-wasi affected?
Yes, wasmtime-wasi is affected in releases prior to 44.0.2, 36.0.10, 24.0.9. Upgrade your dependency to 44.0.2, 36.0.10, 24.0.9 or later.
What is the CVSS score of CVE-2026-47261?
CVE-2026-47261 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-47261?
CVE-2026-47261 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check crates.io dependencies for CVE-2026-47261?
Run the dependency tree command: 'inspect dependencies for wasmtime-wasi'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2r75-cxrj-cmph",
  "modified" : "2026-07-08T17:35:44Z",
  "published" : "2026-06-05T15:47:02Z",
  "aliases" : [ "CVE-2026-47261" ],
  "summary" : "wasmtime-wasi: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction",
  "details" : "## Summary\n\nIn `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:\n\n```rust\ndir_descriptor.open_at(\n   PathFlags::empty(),\n   FILENAME,\n   OpenFlags::TRUNCATE,\n   DescriptorFlags::READ,\n)\n```\n\n```rust\nwasip1::path_open(\n    dir_fd,\n    0,\n    FILENAME,\n    wasip1::OFLAGS_TRUNC,\n    wasip1::RIGHTS_FD_READ,\n    0,\n    0\n)\n```\n\nThe 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.\n\nThe bug in `crates/wasi/src/filesystem.rs`, `Dir::open_at`, lines 967–969:\n\n```rust\nif oflags.contains(OpenFlags::TRUNCATE) {\n    opts.truncate(true).write(true);\n}\n```\nand the single line fix is:\n```rust\nif oflags.contains(OpenFlags::TRUNCATE) {\n    opts.truncate(true).write(true);\n    open_mode |= OpenMode::WRITE;\n}\n```\n\nOnly 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`:\n```rust\nbuilder.preopened_dir(\"readonly\", \"readonly\", DirPerms::READ | DirPerms::MUTATE, FilePerms::READ);\n```\n\nIn particular, the Wasmtime project's `wasmtime-cli`'s use of wasmtime-wasi is not affected, because it always sets `FilePerms::all()` for all preopens.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmtime-wasi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "37.0.0"
      }, {
        "fixed" : "44.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmtime-wasi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "25.0.0"
      }, {
        "fixed" : "36.0.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "wasmtime-wasi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "24.0.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-2r75-cxrj-cmph"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-47261"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bytecodealliance/wasmtime"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/releases/tag/v24.0.9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/releases/tag/v36.0.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/releases/tag/v44.0.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bytecodealliance/wasmtime/releases/tag/v45.0.0"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0149.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-05T15:47:02Z",
    "nvd_published_at" : "2026-06-15T21:17:11Z"
  }
}