CVE-2026-47261 — wasmtime-wasi
HIGHCVE-2026-47261 is a high-severity (CVSS 7.5) CWE-284 vulnerability in wasmtime-wasi. A fix is available for wasmtime-wasi — see the affected versions and patch details below.
Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-47261.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2026-47261 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 379,842 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
wasmtime-wasi🦀wasmtime-wasi🦀wasmtime-wasiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | wasmtime-wasi | ≥ 37.0.0&&< 44.0.2 | 44.0.2cargo update -p wasmtime-wasi --precise 44.0.2 |
| 🦀crates.io | wasmtime-wasi | ≥ 25.0.0&&< 36.0.10 | 36.0.10cargo update -p wasmtime-wasi --precise 36.0.10 |
| 🦀crates.io | wasmtime-wasi | all versions | 24.0.9cargo update -p wasmtime-wasi --precise 24.0.9 |
Affected Products
wasmtimebytecodeallianceDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for wasmtime-wasi, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update wasmtime-wasi to 44.0.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-47261 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Conditions for Exploitation: Successful exploitation relies on a highly specific configuration of wasmtime-wasi embeddings. The vulnerability only triggers if a filesystem preopen explicitly combines directory mutation permissions (DirPerms::MUTATE) with read-only file permissions (FilePerms::READ). Impact…
To mitigate this issue, ensure that `wasmtime-wasi` embeddings are not configured with a combination of `DirPerms::MUTATE` and `FilePerms::READ` for filesystem preopens. Review `WasiCtxBuilder` configurations to avoid this vulnerable permission combination, which allows an attacker to bypass access controls and truncate files that should otherwise be read-only.Source: Red Hat security advisory for CVE-2026-47261 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-47261 in your dependencies?
Find it across crates.io, including transitive dependencies.