Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🦀
🦀 crates.io
Not in CISA KEV
MEDIUM severity

Wasmtime: WASI hard links bypass wasmtime-wasi's FilePerms for destinationGHSA-4ch3-9j33-3pmj

MEDIUMFix: bytecodealliance/wasmtime#13725

GHSA-4ch3-9j33-3pmj is a medium-severity (CVSS 6.5) CWE-281 vulnerability in wasmtime-wasi. A fix is available for wasmtime-wasi — see the affected versions and patch details below.

Also known asCVE-2026-58494RUSTSEC-2026-0188
Published
Updated
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Oct 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • 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 GHSA-4ch3-9j33-3pmj.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs6th percentile — riskier than 6% of all scored CVEsHighest risk
0.00%0.22%0.45%0.67%0.1%0.2%0.2%0.2%Aug 26Oct 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-4ch3-9j33-3pmj by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

4 pkgs affected
🦀wasmtime-wasi🦀wasmtime-wasi🦀wasmtime-wasi🦀wasmtime-wasi

Real-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

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.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
🦀crates.iowasmtime-wasiall versions24.0.11cargo update -p wasmtime-wasi --precise 24.0.11
🦀crates.iowasmtime-wasi≥ 25.0.0&&< 36.0.1236.0.12cargo update -p wasmtime-wasi --precise 36.0.12
🦀crates.iowasmtime-wasi≥ 37.0.0&&< 45.0.345.0.3cargo update -p wasmtime-wasi --precise 45.0.3
🦀crates.iowasmtime-wasi≥ 46.0.0&&< 46.0.146.0.1cargo update -p wasmtime-wasi --precise 46.0.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    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.

  2. Fix

    Update wasmtime-wasi to 24.0.11 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4ch3-9j33-3pmj is resolved across your whole dependency graph.

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

Frequently Asked Questions

## 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 `fil
O3 Security · Impact-Aware SCA

Is GHSA-4ch3-9j33-3pmj in your dependencies?

Find it across crates.io, including transitive dependencies.

Wasmtime: WASI hard links bypass wasmtime-wasi's…