CVE-2025-64345
JSON

1.8low

Wasmtime provides unsound API access to a WebAssembly shared linear memory

Severity
1.8low CVSS:3.1 by GitHub_M
Exploit likelihood
0.12% (higher than 1% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-hc7m-r6v8-hg9qRUSTSEC-2025-0118

Description

Wasmtime is a runtime for WebAssembly. Prior to version 38.0.4, 37.0.3, 36.0.3, and 24.0.5, Wasmtime's Rust embedder API contains an unsound interaction where a WebAssembly shared linear memory could be viewed as a type which provides safe access to the host (Rust) to the contents of the linear memory. This is not sound for shared linear memories, which could be modified in parallel, and this could lead to a data race in the host. Patch releases have been issued for all supported versions of Wasmtime, notably: 24.0.5, 36.0.3, 37.0.3, and 38.0.4. These releases reject creation of shared memories via `Memory::new` and shared memories are now excluded from core dumps. As a workaround, eembeddings affected by this issue should use `SharedMemory::new` instead of `Memory::new` to create shared memories. Affected embeddings should also disable core dumps if they are unable to upgrade. Note that core dumps are disabled by default but the wasm threads proposal (and shared memory) is enabled by default.

Affected

Product or packageVersionsReported by
bytecodealliance wasmtime>= 38.0.1, < 38.0.4, >= 37.0.0, < 37.0.3, >= 26.0.0, < 36.0.3, < 24.0.5CVE List
wasmtime (crates.io)from 38.0.0 before 38.0.4, from 37.0.0 before 37.0.3, from 26.0.0 before 36.0.3, before 24.0.5, from 0.0.0-0 before 24.0.5, from 25.0.0 before 36.0.3GitHub Advisory Database, RustSec Advisory Database

All scores

GitHub_M1.8low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:N
GitHub1.8low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:N
RustSec Advisory Database1.8low CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:N

Classification

CWE-362

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Wasmtime is a runtime for WebAssembly. Prior to version 38.0.4, 37.0.3, 36.0.3, and 24.0.5, Wasmtime's Rust embedder API contains an unsound interaction where a WebAssembly shared linear memory could be viewed as a type which provides safe access to the host (Rust) to the contents of the linear memory. This is not sound for shared linear memories, which could be modified in parallel, and this could lead to a data race in the host. Patch releases have been issued for all supported versions of Wasmtime, notably: 24.0.5, 36.0.3, 37.0.3, and 38.0.4. These releases reject creation of shared memories via `Memory::new` and shared memories are now excluded from core dumps. As a workaround, eembeddings affected by this issue should use `SharedMemory::new` instead of `Memory::new` to create shared memories. Affected embeddings should also disable core dumps if they are unable to upgrade. Note that core dumps are disabled by default but the wasm threads proposal (and shared memory) is enabled by default.

GitHub Advisory Database
Impact

Wasmtime's Rust embedder API contains an unsound interaction where a WebAssembly shared linear memory could be viewed as a type which provides safe access to the host (Rust) to the contents of the linear memory. This is not sound for shared linear memories, which could be modified in parallel, and this could lead to a data race in the host.

Wasmtime has a wasmtime::Memory type which represents linear memories in a WebAssembly module. Wasmtime also has wasmtime::SharedMemory, however, which represents shared linear memories introduced in the WebAssembly threads proposal. The API of SharedMemory does not provide accessors which return &[u8] in Rust, for example, as that's not a sound type signature when other threads could be modifying memory. The wasmtime::Memory type, however, does provide this API as it's intended to be used with non-shared memories where static knowledge is available that no concurrent or parallel reads or writes are happening. This means that it's not sound to represent a shared linear memory with wasmtime::Memory and it must instead be represented with wasmtime::SharedMemory.

There were two different, erroneous, methods of creating a wasmtime::Memory which represents a shared memory however:

  1. The wasmtime::Memory::new constructor takes a MemoryType which could be shared. This function did not properly reject shared memory types and require usage of SharedMemory::new instead.
  2. Capturing a core dump with WebAssembly would expose all linear memories a wasmtime::Memory. This means that a core dump would perform an unsynchronized read of shared linear memory, possibly leading to data races.

This is a bug in Wasmtime's safe Rust API. It should not be possible to cause unsoundness with Wasmtime's embedding API if unsafe is not used. Embeddings which do not use the wasm threads proposal nor created shared memories nor actually share shared memories across threads are unaffected. Only if shared memories are created across threads might an embedding be affected.

Patches

Patch releases have been issued for all supported versions of Wasmtime, notably: 24.0.5, 36.0.3, 37.0.3, and 38.0.4. These releases reject creation of shared memories via Memory::new and shared memories are now excluded from core dumps.

Workarounds

Embeddings affected by this issue should use SharedMemory::new instead of Memory::new to create shared memories. Affected embeddings should also disable core dumps if they are unable to upgrade. Note that core dumps are disabled by default but the wasm threads proposal (and shared memory) is enabled by default. It's recommended to upgrade to a patched version of Wasmtime, however.

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-hc7m-r6v8-hg9q For more information see the GitHub-hosted security advisory.

NVD (es)

Wasmtime es un entorno de ejecución para WebAssembly. Versiones anteriores a la 38.0.4, 37.0.3, 36.0.3 y 24.0.5, la API del incrustador Rust de Wasmtime contiene una interacción insegura donde una memoria lineal compartida de WebAssembly podría ser vista como un tipo que proporciona acceso seguro al host (Rust) a los contenidos de la memoria lineal. Esto no es seguro para memorias lineales compartidas, las cuales podrían ser modificadas en paralelo, y esto podría llevar a una condición de carrera de datos en el host. Se han emitido lanzamientos de parches para todas las versiones compatibles de Wasmtime, en particular: 24.0.5, 36.0.3, 37.0.3 y 38.0.4. Estas versiones rechazan la creación de memorias compartidas a través de 'Memory::new' y las memorias compartidas ahora están excluidas de los volcados de memoria. Como solución alternativa, las incrustaciones afectadas por este problema deberían usar 'SharedMemory::new' en lugar de 'Memory::new' para crear memorias compartidas. Las incrustaciones afectadas también deberían deshabilitar los volcados de memoria si no pueden actualizar. Tenga en cuenta que los volcados de memoria están deshabilitados por defecto, pero la propuesta de hilos wasm (y la memoria compartida) está habilitada por defecto.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-64345 changed 2025-11-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-hc7m-r6v8-hg9q changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2025-0118 changed 2026-10-12CC0-1.0
NVDCVE-2025-64345 changed 2026-10-18Public domain