GHSA-hfr4-7c6c-48w2

Suggest an improvement
Source
https://github.com/advisories/GHSA-hfr4-7c6c-48w2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-hfr4-7c6c-48w2/GHSA-hfr4-7c6c-48w2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-hfr4-7c6c-48w2
Aliases
Downstream
Published
2026-04-09T20:23:44Z
Modified
2026-09-10T03:51:01Z
Severity
  • 1.0 (Low) CVSS_V4 - 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 CVSS Calculator
Summary
Wasmtime has use-after-free bug after cloning `wasmtime::Linker`
Details

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 TryClone[^try-clone] implementation.

[^try-clone]: The TryClone trait is our version of the Rust standard library's Clone trait that allows for returning OutOfMemory errors.

Database specific
{
    "cwe_ids": [
        "CWE-416"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-09T20:23:44Z",
    "nvd_published_at": "2026-04-09T19:16:24Z",
    "severity": "LOW"
}
References

Affected packages

crates.io / wasmtime

Package

Name
wasmtime
View open source insights on deps.dev
Purl
pkg:cargo/wasmtime

Affected ranges

Type
SEMVER
Events
Introduced
43.0.0
Fixed
43.0.1

Affected versions

43.*
43.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-hfr4-7c6c-48w2/GHSA-hfr4-7c6c-48w2.json"