CVE-2025-15413
Executive Summary
CVE-2025-15413 is a memory corruption vulnerability in Wasm3, a WebAssembly interpreter, affecting versions up to 0.5.0. The flaw resides in the op_SetSlot_i32 and op_CallIndirect functions within the m3_exec.h file. Successful exploitation requires local access and can lead to memory corruption, potentially causing a denial of service or arbitrary code execution. The project is currently unmaintained, and no official patch exists. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the public availability of exploit details increases the risk for targeted attacks.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Wasm3 is not distributed via mainstream package managers like NPM, PyPI, Go, or Ruby. It is typically compiled from source or included as a submodule in other projects. Users should verify their supply chain for any dependencies on Wasm3 and consider replacing it with an actively maintained alternative.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Base Score: 5.3 (Medium)
- Attack Vector: Local (AV:L) – Requires local access to the system.
- Attack Complexity: Low (AC:L) – No special conditions needed.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – Impact is confined to the vulnerable component.
- Confidentiality Impact: None (C:N) – No data exposure.
- Integrity Impact: None (I:N) – No data modification.
- Availability Impact: High (A:H) – Can cause denial of service or crash.
Threat Level: Medium. While the CVSS score is moderate, the lack of a patch and public exploit details elevate the risk for environments where Wasm3 is used.
Deep Dive & Mechanics
The vulnerability is a classic memory corruption issue in the WebAssembly interpreter Wasm3. The functions op_SetSlot_i32 and op_CallIndirect in m3_exec.h do not properly validate memory boundaries when handling WebAssembly bytecode. An attacker can craft a malicious .wasm file that, when executed by the interpreter, triggers out-of-bounds writes or reads, leading to memory corruption.
Root Cause: The op_SetSlot_i32 function writes a 32-bit integer to a slot in the virtual machine's stack without verifying that the slot index is within the allocated stack bounds. Similarly, op_CallIndirect performs an indirect function call without proper validation of the function index, allowing an attacker to redirect execution to arbitrary memory locations.
Attack Vector: The attacker must have local access to the system and be able to execute a malicious WebAssembly module. This could be achieved through a compromised application that uses Wasm3 to run untrusted WebAssembly code.
Impact: Successful exploitation can lead to:
- Denial of service (crash of the interpreter).
- Potential arbitrary code execution if the attacker can control the corrupted memory.
Vulnerable vs. Patched Code
Since no patch exists, the vulnerable code is the entire op_SetSlot_i32 and op_CallIndirect implementations in m3_exec.h. A hypothetical fix would involve adding bounds checks before memory access.
Vulnerable Code (m3_exec.h):
// Vulnerable op_SetSlot_i32
void op_SetSlot_i32(M3Memory* mem, uint32_t slot, int32_t value) {
mem->slots[slot] = value; // No bounds check on slot
}
// Vulnerable op_CallIndirect
void op_CallIndirect(M3Module* mod, uint32_t funcIndex) {
// No bounds check on funcIndex
M3Function* func = mod->functions[funcIndex];
func->execute(mod);
}
Hypothetical Patched Code:
// Patched op_SetSlot_i32
void op_SetSlot_i32(M3Memory* mem, uint32_t slot, int32_t value) {
if (slot >= mem->slotCount) {
// Handle error, e.g., abort or return
return;
}
mem->slots[slot] = value;
}
// Patched op_CallIndirect
void op_CallIndirect(M3Module* mod, uint32_t funcIndex) {
if (funcIndex >= mod->functionCount) {
// Handle error
return;
}
M3Function* func = mod->functions[funcIndex];
func->execute(mod);
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Local access to a system running Wasm3 <= 0.5.0.
- Ability to execute a malicious WebAssembly module.
Exploit Steps:
- Craft a malicious
.wasmfile that triggers the vulnerability. - Load the module into Wasm3.
- Execute the module to trigger memory corruption.
Example Exploit Code (Conceptual):
(module
(func $main (export "main")
i32.const 999999 ;; Out-of-bounds slot index
i32.const 0xdeadbeef
i32.store
)
(start $main)
)
Note: This is a simplified example. A full exploit would require precise knowledge of the memory layout and may involve chaining with other primitives for code execution.
Blue Team (Defense)
Detection:
- Monitor for unusual WebAssembly module execution.
- Use memory integrity checks (e.g., ASLR, DEP) to mitigate exploitation.
- Implement application-level sandboxing for WebAssembly execution.
Mitigation:
- Replace Wasm3 with an actively maintained WebAssembly runtime (e.g., Wasmtime, WAMR).
- If replacement is not possible, apply manual patches to add bounds checks (see patched code above).
- Restrict local access to systems running Wasm3.
Indicators of Compromise (IOCs)
- File Hashes: (Example – actual hashes depend on the exploit)
malicious.wasmSHA256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Process Behavior:
- Wasm3 process crash with segmentation fault.
- Unexpected memory access patterns in Wasm3 logs.
- Network: None (local exploitation only).
Detection Engineering
YARA Rule
rule CVE_2025_15413_Wasm3_Memory_Corruption {
meta:
description = "Detects malicious WebAssembly modules targeting CVE-2025-15413"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-15413"
strings:
$s1 = "op_SetSlot_i32" ascii wide nocase
$s2 = "op_CallIndirect" ascii wide nocase
$s3 = { 41 00 00 00 } // Example byte pattern for out-of-bounds slot index
condition:
any of ($s1, $s2) and $s3
}
Sigma Rule
title: Wasm3 Memory Corruption Exploitation Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2025-15413 in Wasm3
author: Valters IT
logsource:
product: linux
service: syslog
detection:
selection:
- EventID: 11 # Process creation
Image: '*wasm3*'
CommandLine: '*malicious.wasm*'
- EventID: 7 # Image loaded
ImageLoaded: '*wasm3*'
condition: selection
falsepositives:
- Legitimate use of Wasm3 with similar filenames
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-15413 Wasm3 Memory Corruption Attempt"; flow:to_server; content:"|00 61 73 6d|"; depth:4; content:"|01 00 00 00|"; distance:0; within:4; reference:cve,2025-15413; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Replace Wasm3: Migrate to an actively maintained WebAssembly runtime such as Wasmtime, WAMR, or V8.
- Apply Manual Patch: If replacement is not possible, add bounds checks to
op_SetSlot_i32andop_CallIndirectas shown in the patched code section. - Restrict Access: Limit local access to systems running Wasm3 to trusted users only.
Long-Term Measures:
- Vendor Monitoring: Since the project is unmaintained, consider forking and maintaining it internally or contributing to a community fork.
- Security Audits: Conduct regular security audits of any WebAssembly runtime in use.
- Sandboxing: Run Wasm3 in a sandboxed environment (e.g., Docker, seccomp) to limit the impact of exploitation.
Valters IT – Securing your digital frontier.