1.0low
Wasmtime has a use-after-free bug after cloning `wasmtime::Linker`
- Severity
- 1.0low CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.12% (higher than 2% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-hfr4-7c6c-48w2PYSEC-2026-151RUSTSEC-2026-0090
Description
Wasmtime is a runtime for WebAssembly. In 43.0.0, cloning a wasmtime::Linker is unsound and can result in use-after-free bugs. This bug is not controllable by guest Wasm programs. It can only be triggered by a specific sequence of embedder API calls made by the host. Specifically, the following steps must occur to trigger the bug clone a wasmtime::Linker, drop the original linker instance, use the new, cloned linker instance, resulting in a use-after-free. This vulnerability is fixed in 43.0.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| bytecodealliance wasmtime | >= 43.0.0, < 43.0.1, 43.0.0 | CVE List, NVD |
| wasmtime (crates.io) | from 43.0.0 before 43.0.1 | GitHub Advisory Database, RustSec Advisory Database |
| wasmtime (PyPI) | up to 43.0.0 | PyPA Advisory Database |
All scores
| GitHub_M | 1.0low CVSS:4.0 | CVSS:4.0/AV:P/AC:H/AT:P/PR:H/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
| GitHub | low CVSS:4.0 | CVSS:4.0/AV:P/AC:H/AT:P/PR:H/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
| RustSec Advisory Database | Not scored CVSS:4.0 | CVSS:4.0/AV:P/AC:H/AT:P/PR:H/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N |
| NVD | 5.0medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 5.0medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Wasmtime is a runtime for WebAssembly. In 43.0.0, cloning a wasmtime::Linker is unsound and can result in use-after-free bugs. This bug is not controllable by guest Wasm programs. It can only be triggered by a specific sequence of embedder API calls made by the host. Specifically, the following steps must occur to trigger the bug clone a wasmtime::Linker, drop the original linker instance, use the new, cloned linker instance, resulting in a use-after-free. This vulnerability is fixed in 43.0.1.
GitHub Advisory Database
Impact
In version 43.0.0 of the wasmtime crate, cloning a wasmtime::Linker is unsound and can result in use-after-free bugs.
This bug is not controllable by guest Wasm programs. It can only be triggered by a specific sequence of embedder API calls made by the host.
The typical symptom of this use-after-free bug is a segfault. It does not enable heap corruption or data leakage.
If you are using the wasmtime CLI, rather than the embedding API, you are not affected. If you are using the embedding API but are not calling wasmtime::Linker's Clone implementation, you are not affected.
Specifically, the following steps must occur to trigger the bug:
- Clone a
wasmtime::Linker - Drop the original linker instance
- Use the new, cloned linker instance, resulting in a use-after-free
Patches
This bug has been patched in Wasmtime version 43.0.1
Workarounds
Wasmtime embedders are highly encouraged to upgrade their wasmtime crate dependency.
If upgrading is not an option, or as a temporary workaround before upgrading, you can avoid this bug by not cloning wasmtime::Linker and instead creating a new, empty wasmtime::Linker and manually reregistering the host APIs from the original linker:
use wasmtime::{Linker, Result, Store};
fn clone_linker<T>(linker: &Linker<T>, store: &mut Store<T>) -> Result<Linker<T>> {
let mut cloned = Linker::new();
for (module, name, item) in linker.iter(store) {
cloned.define(module, name, item)?;
}
Ok(cloned)
}
References
This bug was introduced during an internal refactoring that was part of our efforts to robustly handle allocation failure in Wasmtime. This refactoring introduced an string-interning pool which had an unsound TryClone1 implementation.
- The
StringPoolwas introduced in https://github.com/bytecodealliance/wasmtime/pull/12536, at which time the bug inTryClone for StringPoolwas already present, although this code path was not yet used anywhere. wasmtime::Linkerwas refactored to internally useStringPoolin https://github.com/bytecodealliance/wasmtime/pull/12537, at which time the buggy code path became accessible.- This bug was originally reported to the Wasmtime maintainers as https://github.com/bytecodealliance/wasmtime/pull/12906
Footnotes
-
The
TryClonetrait is our version of the Rust standard library'sClonetrait that allows for returningOutOfMemoryerrors. ↩
RustSec Advisory Database
This is an entry in the RustSec database for the Wasmtime security advisory located at https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hfr4-7c6c-48w2 For more information see the GitHub-hosted security advisory.
NVD (es)
Wasmtime es un entorno de ejecución para WebAssembly. En la versión 43.0.0, clonar un wasmtime::Linker no es seguro y puede resultar en errores de uso después de liberación. Este error no es controlable por programas Wasm invitados. Solo puede ser activado por una secuencia específica de llamadas a la API del incrustador realizadas por el anfitrión. Específicamente, los siguientes pasos deben ocurrir para activar el error: clonar un wasmtime::Linker, descartar la instancia original del enlazador, usar la nueva instancia del enlazador clonada, lo que resulta en un uso después de liberación. Esta vulnerabilidad está corregida en la versión 43.0.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34983 changed 2026-04-13 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hfr4-7c6c-48w2 changed 2026-09-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2026-0090 changed 2026-10-12 | CC0-1.0 |
| NVD | CVE-2026-34983 changed 2026-10-26 | Public domain |
| PyPA Advisory Database | PYSEC-2026-151 changed 2026-05-21 | CC-BY-4.0 |