Skip to main content

CVE-2026-58494 — Vulnerability in wasmtime-wasi — CVE Details

MEDIUM

Wasmtime: WASI hard links bypass wasmtime-wasi's FilePerms for destination

Published October 16, 2026Updated October 16, 2026Source: OSV

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.

Check my Cargo.lock

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 target exists in a preopen with only FilePerms::READ
  • a hardlink named alias, with destination to the target, is created in a preopen with FilePerms::READ | FilePerms::WRITE
  • the attacker opens the file alias for writing, in which they can overwrite target

The same attack is possible by way of renaming:

  • a read-only file target exists in a preopen with only FilePerms::READ
  • a hardlink named alias, with destination to the target, is created in that same preopen
  • the alias file is renamed into a preopen with FilePerms::READ | FilePerms::WRITE
  • the attacker opens the file alias for writing, in which they can overwrite target

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 wasmtime-wasi to 46.0.1 or later
cargo update -p wasmtime-wasi --precise 46.0.1
Cargo
Update wasmtime-wasi to 45.0.3 or later
cargo update -p wasmtime-wasi --precise 45.0.3
Cargo
Update wasmtime-wasi to 36.0.12 or later
cargo update -p wasmtime-wasi --precise 36.0.12
Cargo
Update wasmtime-wasi to 24.0.11 or later
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).

PackageFixed In
wasmtime-wasi crates.io · Affected: All versions46.0.1
wasmtime-wasi crates.io · Affected: All versions45.0.3
wasmtime-wasi crates.io · Affected: All versions36.0.12
wasmtime-wasi crates.io · Affected: All versions24.0.11

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.5 score means for each attack dimension.

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
None
Integrity
High
Availability
None

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N

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

CVSS Score
6.5

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.17%
EPSS percentile: 3.8

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

GHSA-4ch3-9j33-3pmj
RUSTSEC-2026-0188

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock