CVE-2026-58494 — Vulnerability in wasmtime-wasi — CVE Details
Wasmtime: WASI hard links bypass wasmtime-wasi's FilePerms for destination
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.17%). 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-58494 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.
Summary
Summary
Wasmtime's WASI filesystem implementation lets a guest with a read-only source file capability overwrite that file by hard-linking it into another preopen that allows file writes. An attacker who can run a WASI guest can bypass WasiCtxBuilder per-preopen FilePerms and modify host files that were exposed as FilePerms::READ.
This attack is possible through the wasip1, wasip2, and wasip3 interfaces to the WASI filesystem.
This attack is also possible through an indirection of renaming a hardlink into another preopen.
Details
WasiCtxBuilder::preopened_dir documents file_perms as the maximum permissions usable for files in that preopen. However, hard-link creation and renaming only checked directory mutation for permission, and not whether the file permissions matched.
This makes an attack possible where:
- a read-only file
targetexists in a preopen with only FilePerms::READ - a hardlink named
alias, with destination to thetarget, is created in a preopen with FilePerms::READ | FilePerms::WRITE - the attacker opens the file
aliasfor writing, in which they can overwritetarget
The same attack is possible by way of renaming:
- a read-only file
targetexists in a preopen with only FilePerms::READ - a hardlink named
alias, with destination to thetarget, is created in that same preopen - the
aliasfile is renamed into a preopen with FilePerms::READ | FilePerms::WRITE - the attacker opens the file
aliasfor writing, in which they can overwritetarget
Symbolic links are not a vector for this attack because the wasi-filesystem interfaces already enforces that the destination for a symlink is under the same preopen. We do not believe there are any other vectors to this attack because there are no other wasi filesystem interfaces that take multiple borrows of a descriptor resource for e.g. the source and destination in different descriptors.
Remediation
The definition of Dir::link_at and Dir::rename_at in wasmtime-wasi's src/filesystem.rs now have an additional permissions check that ensures the source and destination values for the directory permissions perms and the file permissions file_perms are identical.
if self.perms != new_dir.perms || self.file_perms != new_dir.file_perms {
return Err(ErrorCode::NotPermitted);
}
Impact
Only wasmtime-wasi embeddings that use a combination of DirPerms::MUTATE with FilePerms::READ, as well as using a second preopen with higher permissions (FilePerms::WRITE as well), are affected by this bug, e.g. those that use in the WasiCtxBuilder:
builder.preopened_dir("readwrite", "readwrite", DirPerms::READ | DirPerms::MUTATE, FilePerms::READ | FilePerms::WRITE);
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 October 16, 2026 (41 days ago).
- Last revised October 16, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p wasmtime-wasi --precise 46.0.1
cargo update -p wasmtime-wasi --precise 45.0.3
cargo update -p wasmtime-wasi --precise 36.0.12
cargo update -p wasmtime-wasi --precise 24.0.11
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (4)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| wasmtime-wasi crates.io · Affected: All versions | 46.0.1 |
| wasmtime-wasi crates.io · Affected: All versions | 45.0.3 |
| wasmtime-wasi crates.io · Affected: All versions | 36.0.12 |
| wasmtime-wasi crates.io · Affected: All versions | 24.0.11 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-281
- CWE-863Incorrect AuthorizationMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.5 score means for each attack dimension.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
References
- https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-4ch3-9j33-3pmjWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-58494ADVISORY
- https://github.com/bytecodealliance/wasmtime/pull/13725WEB
- https://github.com/bytecodealliance/wasmtime/commit/5ddfd5f1ef28f2041fa07d237ad0336e167b0e0cWEB
- https://github.com/bytecodealliance/wasmtime/commit/7db94cdcf0c79cb3dfde884b534b653f2dd83367WEB
- https://github.com/bytecodealliance/wasmtime/commit/8a250aac0962ca1364b5f16525720e9d0b39edcdWEB
- https://github.com/bytecodealliance/wasmtime/commit/d3ceb56ec35f39e02496eeb4e2d9c7f4fb964d9eWEB
- https://github.com/bytecodealliance/wasmtimePACKAGE
- https://github.com/bytecodealliance/wasmtime/releases/tag/v24.0.11WEB
- https://github.com/bytecodealliance/wasmtime/releases/tag/v36.0.12WEB
- https://github.com/bytecodealliance/wasmtime/releases/tag/v45.0.3WEB
- https://github.com/bytecodealliance/wasmtime/releases/tag/v46.0.1WEB
- https://rustsec.org/advisories/RUSTSEC-2026-0188.htmlWEB
Frequently Asked Questions
- What is CVE-2026-58494?
- Wasmtime: WASI hard links bypass wasmtime-wasi's FilePerms for destination. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.5/10).
- How do I check if my project is affected by CVE-2026-58494?
- CVE-2026-58494 affects wasmtime-wasi. It has a 0.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-58494 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 3.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
Related CVEs
- CVE-2026-47261HIGH
WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction
- CVE-2026-118688HIGH
Filesystem sandbox escape when renaming symlinks with trailing slashes
- CVE-2026-47261HIGH
wasmtime-wasi: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction
- CVE-2026-115387MEDIUM
Guest can panic host through filesystem datetime overflow
- CVE-2026-115385MEDIUM
Guest can panic host through filesystem timestamp before the epoch on wasip3
- CVE-2026-126410MEDIUM
wasip3 UDP `send` can deliver a datagram to an address only allowed for receiving
- CVE-2026-35374MEDIUM
split: TOCTOU output-open allows truncating a swapped file
- CVE-2026-54786LOW
Wasmtime has a leak in WASIp1 `fd_renumber` implementation