CVE-2025-7321
Executive Summary
CVE-2025-7321 is a critical memory corruption vulnerability in the IrfanView CADImage Plugin when parsing specially crafted DWG files. The flaw stems from insufficient 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 that triggers the plugin. With a CVSS score of 7.8, this vulnerability poses a high risk to systems using IrfanView with the CADImage Plugin, especially in environments where untrusted DWG files are processed. No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch.
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 risk is primarily in supply chains where DWG files are exchanged (e.g., engineering, architecture, manufacturing). Organizations should treat any untrusted DWG file as a potential vector.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Local (L) – requires user to open a file.
- Attack Complexity (AC): Low (L) – no special conditions beyond file opening.
- Privileges Required (PR): None (N) – no authentication needed.
- User Interaction (UI): Required (R) – victim must open the file.
- Scope (S): Unchanged (U) – exploitation stays within the plugin process.
- Confidentiality (C): High (H) – full data access possible.
- Integrity (I): High (H) – arbitrary code execution.
- Availability (A): High (H) – potential for denial of service or full compromise.
Threat Level: High. Exploitation requires minimal user interaction and can lead to full system compromise under the user’s privileges.
Deep Dive & Mechanics
The vulnerability resides in the CADImage Plugin’s DWG parsing routine. DWG files contain binary data structures (e.g., headers, entities, layers) that are read sequentially. The plugin fails to validate the size or offset of certain fields, allowing an attacker to craft a DWG file with malformed data that triggers a buffer overflow or use-after-free condition.
Technical Flow:
- The plugin reads the DWG file header and identifies object types.
- For a specific object (e.g., a polyline or block), it allocates a buffer based on a field in the file.
- The attacker supplies a manipulated length value that is larger than the actual allocated buffer.
- When the plugin copies data into this buffer, it overflows adjacent memory, corrupting function pointers or return addresses.
- The attacker can then redirect execution to shellcode embedded in the DWG file.
Root Cause: Lack of bounds checking on user-supplied length fields during DWG parsing.
Vulnerable vs. Patched Code
Since no patch is available, we compare the vulnerable code pattern to a hypothetical secure implementation.
Vulnerable Code (C-like pseudocode):
void parse_dwg_object(FILE *fp) {
uint32_t obj_len;
fread(&obj_len, 4, 1, fp); // read length from file
char *buffer = malloc(obj_len); // allocate based on attacker-controlled length
fread(buffer, obj_len, 1, fp); // copy data – no validation
// process buffer...
}
Patched Code (Hypothetical):
void parse_dwg_object(FILE *fp) {
uint32_t obj_len;
fread(&obj_len, 4, 1, fp);
if (obj_len > MAX_SAFE_SIZE) { // add bounds check
return; // reject oversized object
}
char *buffer = malloc(obj_len);
if (buffer == NULL) {
return; // handle allocation failure
}
fread(buffer, obj_len, 1, fp);
// process buffer...
}
The patch adds a maximum size check and proper error handling.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- IrfanView with CADImage Plugin installed (any version).
- A Windows VM for testing.
Steps:
- Craft Malicious DWG: Use a fuzzer (e.g., boofuzz) to generate a DWG file with an oversized length field in a specific object header.
- Embed Shellcode: Place shellcode (e.g., reverse shell) in the DWG file after the overflow trigger.
- Deliver: Send the file via email or host on a website.
- Trigger: Victim opens the file in IrfanView. The plugin parses the DWG, overflows, and executes shellcode.
Example Exploit Skeleton (Python):
import struct
def craft_malicious_dwg():
# Minimal DWG header
dwg = b'\x41\x43\x31\x30' # AC1018 header
# Malformed object with overflow
obj_len = 0xFFFFFFFF # large length
dwg += struct.pack('<I', obj_len)
dwg += b'\x90' * 1000 # NOP sled
dwg += b'\xcc' * 200 # INT3 breakpoints for testing
return dwg
with open('malicious.dwg', 'wb') as f:
f.write(craft_malicious_dwg())
Note: No public exploit exists; this is a conceptual example.
Blue Team (Defensive)
Detection:
- Monitor for IrfanView crashes (Event ID 1000 in Windows Application logs).
- Use file reputation services to block unknown DWG files.
- Deploy endpoint detection rules (see Detection Engineering).
Mitigation:
- Disable the CADImage Plugin if not needed.
- Use a sandbox to open untrusted DWG files.
- Apply strict file access controls.
Indicators of Compromise (IOCs)
- File Hashes: (None public; generate upon discovery)
- Network: Outbound connections from IrfanView process (e.g., reverse shell).
- Process:
i_view32.exeori_view64.exewith high memory usage or crashes. - Registry: Unusual modifications to IrfanView plugin paths.
- File Artifacts: Malicious DWG files with anomalous object lengths.
Detection Engineering
YARA Rule
rule CVE_2025_7321_DWG_Memory_Corruption {
meta:
description = "Detects malicious DWG files exploiting CVE-2025-7321"
author = "Valters IT"
date = "2025-04-10"
reference = "ZDI-CAN-26421"
strings:
$dwg_header = { 41 43 31 30 } // AC1018 or similar
$large_len = { FF FF FF FF } // suspicious length
condition:
$dwg_header at 0 and $large_len
}
Sigma Rule
title: IrfanView CADImage Plugin Crash or Exploitation
id: cve-2025-7321-sigma
status: experimental
description: Detects potential exploitation of CVE-2025-7321 via process crashes or anomalous behavior
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: 'i_view32.exe'
CommandLine|contains: '.dwg'
condition: selection
falsepositives:
- Legitimate DWG file opening
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-7321 Potential IrfanView RCE"; 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: Disable the CADImage Plugin in IrfanView (Options > PlugIns > uncheck CADImage).
- Workaround: Use an alternative DWG viewer (e.g., LibreCAD, DWG TrueView) until a patch is released.
- Long-term: Monitor vendor for updates; apply patch when available.
- User Training: Educate users not to open DWG files from untrusted sources.
- Network Controls: Block DWG file downloads via email/web proxies if not business-required.
Valters IT – DevSecOps & Cyber Threat Intelligence
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.