# CVE-2024-51745: Wasmtime doesn't fully sandbox all the Windows device filenames

> Untrusted WebAssembly programs can bypass filesystem sandboxing on Windows to access serial and parallel devices via superscript filenames.

- **Severity:** Low 2.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Nov 2024
- **Updated:** 5 Nov 2024
- **Also known as:** DEBIAN-CVE-2024-51745, GHSA-c2f5-jxjv-2hh8, JLSEC-2026-1348, RUSTSEC-2024-0438

## What is CVE-2024-51745?

CVE-2024-51745 is a low-severity vulnerability in bytecodealliance wasmtime, published on 5 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Wasmtime is a fast and secure runtime for WebAssembly. Wasmtime's filesystem sandbox implementation on Windows blocks access to special device filenames such as "COM1", "COM2", "LPT0", "LPT1", and so on, however it did not block access to the special device filenames which use superscript digits, such as "COM¹", "COM²", "LPT⁰", "LPT¹", and so on. Untrusted Wasm programs that are given access to any filesystem directory could bypass the sandbox and access devices through those special device filenames with superscript digits, and through them gain access peripheral devices connected to the computer, or network resources mapped to those devices. This can include modems, printers, network printers, and any other device connected to a serial or parallel port, including emulated USB serial ports. Patch releases for Wasmtime have been issued as 24.0.2, 25.0.3, and 26.0.1. Users of Wasmtime 23.0.x and prior are recommended to upgrade to one of these patched versions. There are no known workarounds for this issue. Affected Windows users are recommended to upgrade.

Weakness: CWE-67 (Improper Handling of Windows Device Names), CWE-184 (Incomplete List of Disallowed Inputs)

## Which versions are affected by CVE-2024-51745?

7 open source packages ship an affected version, including wasmtime. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `wasmtime` | crates.io | All versions | 24.0.2 |
| `wasmtime` | crates.io | All versions | 24.0.2 |
| `wasmtime` | crates.io | From 0.0.0-0 | 24.0.2, 25.0.3, 26.0.1 |
| `wasmtime` | crates.io | From 25.0.0 | 25.0.3 |
| `wasmtime` | crates.io | From 25.0.0 | 25.0.3 |
| `wasmtime` | crates.io | From 26.0.0 | 26.0.1 |
| `wasmtime` | crates.io | From 26.0.0 | 26.0.1 |

Products: Bytecodealliance Wasmtime.

## How do I fix CVE-2024-51745?

Upgrade wasmtime to a fixed version for your release line: 24.0.2, 25.0.3 or 26.0.1.

## Is CVE-2024-51745 being exploited?

There is no known exploitation of CVE-2024-51745 in the wild and no public exploit code.

## Other vulnerabilities in bytecodealliance wasmtime

- [CVE-2026-34971](https://insights.sbomify.com/CVE-2026-34971/): Wasmtime miscompiled guest heap access enables sandbox escape on aarch64 Cranelift (critical 9.0)
- [CVE-2026-34987](https://insights.sbomify.com/CVE-2026-34987/): Wasmtime with Winch compiler backend on aarch64 may allow a sandbox-escaping memory access (critical 9.0)
- [CVE-2022-39393](https://insights.sbomify.com/CVE-2022-39393/): Wasmtime vulnerable to data leakage between instances in the pooling allocator (high 8.6)
- [CVE-2022-24791](https://insights.sbomify.com/CVE-2022-24791/): Use after free in Wasmtime (high 8.1)
- [CVE-2026-47261](https://insights.sbomify.com/CVE-2026-47261/): Wasmtime: WASI path_open(TRUNCATE) bypasses `FilePerms::WRITE` host restriction (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-51745 and fix it if it is affected.

What it is: CVE-2024-51745 is a low-severity vulnerability in bytecodealliance wasmtime, published on 5 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-51745 in the wild and no public exploit code.

Affected packages and fixed versions:
- wasmtime (crates.io): affected all versions; fixed in 24.0.2
- wasmtime (crates.io): affected all versions; fixed in 24.0.2
- wasmtime (crates.io): affected from 0.0.0-0; fixed in 24.0.2, 25.0.3, 26.0.1
- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.3
- wasmtime (crates.io): affected from 25.0.0; fixed in 25.0.3
- wasmtime (crates.io): affected from 26.0.0; fixed in 26.0.1
- wasmtime (crates.io): affected from 26.0.0; fixed in 26.0.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-51745/ (Markdown: https://insights.sbomify.com/CVE-2024-51745/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-51745
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-51745
- OSV: https://osv.dev/vulnerability/CVE-2024-51745

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-51745/
Summaries are generated and may contain mistakes; the official description above is the record.
