CVE-2025-7310
Executive Summary
CVE-2025-7310 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 the plugin, especially in environments where untrusted DWG files are processed. No public exploit or patch is currently available, but the risk is elevated due to the lack of vendor response.
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 packages. It affects a proprietary Windows plugin for IrfanView, a popular image viewer. The plugin is distributed via the vendor’s website and third-party software repositories. Users should verify the integrity of downloaded plugin files and consider using alternative software until a patch is released.
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. Exploitation could lead to full system compromise, data theft, or ransomware deployment. The lack of a patch and public exploit increases the urgency for mitigation.
Deep Dive & Mechanics
The vulnerability resides in the CADImage Plugin’s DWG file parser. DWG files contain binary data structures for CAD drawings. The plugin fails to properly validate the size or offset of certain fields during parsing, leading to a buffer overflow or use-after-free condition. An attacker can craft a DWG file with maliciously crafted records that trigger memory corruption when the plugin attempts to read or write beyond allocated buffers.
Root Cause: Insufficient bounds checking on user-supplied data within the DWG parsing routine. Specifically, the plugin does not verify that the length of a data block matches the expected size before copying it into a fixed-size buffer.
Attack Vector: The attacker delivers the malicious DWG file via email, download, or a compromised website. When the victim opens the file with IrfanView (or the plugin is invoked), the corruption occurs, allowing the attacker to overwrite critical memory structures and hijack execution flow.
Vulnerable vs. Patched Code
Since no patch is available, a code comparison is not possible. However, based on the vulnerability description, the vulnerable code likely resembles:
// Vulnerable pseudo-code
void parse_dwg_record(char *buffer, size_t size) {
char local_buf[256];
memcpy(local_buf, buffer, size); // No size check
}
A patched version would include validation:
// Patched pseudo-code
void parse_dwg_record(char *buffer, size_t size) {
char local_buf[256];
if (size > sizeof(local_buf)) {
// Handle error
return;
}
memcpy(local_buf, buffer, size);
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- IrfanView with CADImage Plugin installed (any version)
- A Windows VM for testing
- Python 3 with
structmodule for crafting DWG files
Steps:
- Craft a Malicious DWG File: Use a fuzzer or manual binary editing to create a DWG file with oversized data in a record field. Example Python script to generate a malformed DWG:
import struct
def create_malicious_dwg(filename):
# Minimal DWG header (simplified)
header = b'\x41\x43\x31\x30\x32\x31' # Magic bytes
# Craft a record with oversized length
record_type = struct.pack('<H', 0x1E) # Example record type
record_length = struct.pack('<H', 0xFFFF) # Overflow length
payload = b'A' * 0x1000 # Overflow data
malicious_data = header + record_type + record_length + payload
with open(filename, 'wb') as f:
f.write(malicious_data)
create_malicious_dwg('exploit.dwg')
- Deliver the File: Send the file via email or host it on a website.
- Trigger Exploitation: The victim opens the file with IrfanView. The memory corruption occurs, and if the attacker has crafted the payload correctly, arbitrary code execution is achieved.
Note: No public exploit code is available; this is a conceptual example.
Blue Team (Defensive)
Detection:
- Monitor for unusual IrfanView crashes or memory errors.
- Use endpoint detection and response (EDR) tools to detect anomalous process behavior.
- Block DWG files from untrusted sources at the email gateway or web proxy.
Hunting:
- Search for IrfanView processes that crash with access violations.
- Look for DWG files with abnormal sizes or structures in logs.
Indicators of Compromise (IOCs)
- File Hashes: (No specific hashes available; generic IOCs below)
- Network: Connections to attacker-controlled IPs after exploitation.
- Process: IrfanView.exe crashing with exception code 0xC0000005 (access violation).
- Registry: Unusual persistence mechanisms added by the attacker.
- File System: Malicious DWG files with oversized records or unusual headers.
Detection Engineering
YARA Rule
rule CVE_2025_7310_DWG_Malicious {
meta:
description = "Detects malicious DWG files exploiting CVE-2025-7310"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-7310"
strings:
$magic = { 41 43 31 30 32 31 } // DWG magic bytes
$overflow = { FF FF } // Potential oversized length field
condition:
$magic at 0 and $overflow
}
Sigma Rule
title: CVE-2025-7310 IrfanView CADImage Plugin Memory Corruption
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects exploitation attempts of CVE-2025-7310 via process crashes or malicious DWG files
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\IrfanView.exe'
CommandLine|contains: '.dwg'
condition: selection
falsepositives:
- Legitimate DWG file processing
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-7310 IrfanView DWG Exploit Attempt"; flow:to_server,established; content:"|41 43 31 30 32 31|"; offset:0; depth:6; content:"|FF FF|"; within:10; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the CADImage Plugin in IrfanView until a patch is released.
- Block DWG files at email gateways and web proxies.
- Educate users not to open DWG files from untrusted sources.
Long-term:
- Monitor vendor channels for a patch.
- Consider using alternative software for viewing DWG files (e.g., Autodesk DWG TrueView).
- Implement application whitelisting to prevent unauthorized executables.
Workaround: If the plugin is essential, use a sandboxed environment (e.g., Windows Sandbox) to open untrusted DWG files.
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.