CVE-2026-47261: CWE-284: Improper Access Control in bytecodealliance wasmtime
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.
AI Analysis
Technical Summary
Wasmtime versions prior to 24.0.9, 36.0.10, and 44.0.2 contain an improper access control vulnerability (CWE-284) in the handling of filesystem preopens. When a preopen is configured with DirPerms::all() and FilePerms::READ but without FilePerms::WRITE, the access control can be bypassed by opening a file with the OpenFlags::TRUNCATE flag via wasip2 descriptor.open-at or wasip1 path_open interfaces. The root cause is that the code handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at) did not set the open_mode to include OpenMode::WRITE, which is used to check permissions. This omission allows opening files with truncation despite lacking write permissions. The fix adds the missing open_mode |= OpenMode::WRITE assignment, causing affected calls to fail with permission errors. Only wasmtime-wasi embeddings combining DirPerms::MUTATE with FilePerms::READ are vulnerable; wasmtime-cli is not affected as it sets FilePerms::all() for preopens. The vulnerability is fixed in versions 24.0.9, 36.0.10, and 44.0.2.
Potential Impact
This vulnerability allows an attacker to bypass intended filesystem access controls and perform file truncation operations without proper write permissions in affected wasmtime-wasi embeddings. This can lead to unauthorized modification of files, impacting integrity. The CVSS 3.1 score is 7.5 (high severity), reflecting network attack vector, low attack complexity, no privileges required, no user interaction, unchanged scope, no confidentiality impact, high integrity impact, and no availability impact.
Mitigation Recommendations
A fix is available in wasmtime versions 24.0.9, 36.0.10, and 44.0.2. Users should upgrade to one of these versions or later to remediate this vulnerability. The wasmtime-cli tool is not affected by this issue. Patch status is confirmed by the vendor advisory. No additional mitigations are indicated.
CVE-2026-47261: CWE-284: Improper Access Control in bytecodealliance wasmtime
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.
CVSS v3.1
Score 7.5high
Affected software
pkg:cargo/github/bytecodealliance/wasmtimeRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Wasmtime versions prior to 24.0.9, 36.0.10, and 44.0.2 contain an improper access control vulnerability (CWE-284) in the handling of filesystem preopens. When a preopen is configured with DirPerms::all() and FilePerms::READ but without FilePerms::WRITE, the access control can be bypassed by opening a file with the OpenFlags::TRUNCATE flag via wasip2 descriptor.open-at or wasip1 path_open interfaces. The root cause is that the code handling OpenFlags::TRUNCATE in crates/wasi/src/filesystem.rs (Dir::open_at) did not set the open_mode to include OpenMode::WRITE, which is used to check permissions. This omission allows opening files with truncation despite lacking write permissions. The fix adds the missing open_mode |= OpenMode::WRITE assignment, causing affected calls to fail with permission errors. Only wasmtime-wasi embeddings combining DirPerms::MUTATE with FilePerms::READ are vulnerable; wasmtime-cli is not affected as it sets FilePerms::all() for preopens. The vulnerability is fixed in versions 24.0.9, 36.0.10, and 44.0.2.
Potential Impact
This vulnerability allows an attacker to bypass intended filesystem access controls and perform file truncation operations without proper write permissions in affected wasmtime-wasi embeddings. This can lead to unauthorized modification of files, impacting integrity. The CVSS 3.1 score is 7.5 (high severity), reflecting network attack vector, low attack complexity, no privileges required, no user interaction, unchanged scope, no confidentiality impact, high integrity impact, and no availability impact.
Mitigation Recommendations
A fix is available in wasmtime versions 24.0.9, 36.0.10, and 44.0.2. Users should upgrade to one of these versions or later to remediate this vulnerability. The wasmtime-cli tool is not affected by this issue. Patch status is confirmed by the vendor advisory. No additional mitigations are indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-18T23:03:37.229Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a3061600b89be688893d81a
Added to database: 06/15/2026, 20:32:32 UTC
Last enriched: 06/16/2026, 07:47:27 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 74
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.