CVE-2025-7318
Executive Summary
CVE-2025-7318 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 that triggers the plugin. The vulnerability has a CVSS score of 7.8 (High) and is currently unpatched. No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating low exploitation activity in the wild. However, given the severity and the lack of a patch, organizations using IrfanView with the CADImage Plugin should treat this as a high-priority risk.
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 desktop application (IrfanView) and its third-party plugin (CADImage Plugin). The risk is primarily to end-user workstations where IrfanView is installed for viewing CAD files.
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 (AV): Local (L) – The attacker must deliver the malicious file to the target system.
- Attack Complexity (AC): Low (L) – No special conditions required.
- 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 vulnerable component.
- 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 system compromise.
Threat Level: High. Although no active exploitation has been observed, the vulnerability is easily exploitable with user interaction and can lead to full system compromise.
Deep Dive & Mechanics
The vulnerability resides in the CADImage Plugin (CADImage.dll) used by IrfanView to parse DWG files. DWG is a binary file format used by AutoCAD. The plugin fails to properly validate the size or structure of certain data fields within the DWG file, leading to a memory corruption (likely a buffer overflow or use-after-free) when parsing.
Technical Details:
- Root Cause: Lack of bounds checking on user-supplied data during DWG parsing.
- Trigger: Opening a malicious DWG file (or visiting a page that loads it via the plugin).
- Impact: Memory corruption allows an attacker to overwrite critical data structures (e.g., function pointers, return addresses) and achieve arbitrary code execution.
- Process Context: The exploit runs in the context of the IrfanView process, which typically has the same privileges as the logged-in user.
Attack Flow:
- Attacker crafts a malicious DWG file with specially crafted data fields.
- Attacker delivers the file via email, download, or malicious website.
- Victim opens the file with IrfanView (or a browser that uses the plugin).
- The plugin parses the DWG, triggering the memory corruption.
- Attacker-controlled code executes, potentially installing malware, exfiltrating data, or taking over the system.
Vulnerable vs. Patched Code
Since no patch is available, a direct code comparison is not possible. However, based on the vulnerability description, the vulnerable code likely resembles:
// Vulnerable pseudo-code
void ParseDWGData(char *buffer, int size) {
char local_buffer[256];
// No bounds check on size
memcpy(local_buffer, buffer, size); // Potential overflow
}
A patched version would include proper validation:
// Patched pseudo-code
void ParseDWGData(char *buffer, int size) {
char local_buffer[256];
if (size > sizeof(local_buffer)) {
// Handle error
return;
}
memcpy(local_buffer, buffer, size);
}
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- IrfanView with CADImage Plugin installed.
- A Windows VM for testing.
- A debugger (e.g., x64dbg) and a fuzzer (e.g., boofuzz) for crafting the malicious DWG.
Steps:
- Fuzzing: Use a DWG fuzzer to identify crash-inducing inputs.
- Crash Analysis: Attach a debugger to IrfanView and open the crashing DWG to identify the overwritten offset.
- Exploit Development: Craft a DWG file that overwrites a return address or SEH handler with a controlled value.
- Shellcode: Use a standard Windows shellcode (e.g., reverse shell) and ensure it is position-independent.
- Delivery: Host the malicious DWG on a website or send via email.
Example (Conceptual):
# Python script to generate a malicious DWG (simplified)
import struct
# Craft a DWG header and payload
payload = b"A" * 256 # Padding
payload += struct.pack("<I", 0x90909090) # NOP sled
payload += shellcode # Actual shellcode
with open("malicious.dwg", "wb") as f:
f.write(payload)
Blue Team (Defensive)
Detection:
- Monitor for IrfanView crashes (Event ID 1000 in Windows Application logs).
- Use file reputation services to block known malicious DWG files.
- Deploy endpoint detection and response (EDR) to detect memory corruption anomalies.
Prevention:
- Disable the CADImage Plugin if not needed.
- Use application whitelisting to prevent IrfanView from executing untrusted code.
- Implement user awareness training to avoid opening suspicious DWG files.
Indicators of Compromise (IOCs)
- File Hashes: (None publicly available; generate upon discovery)
- Network Indicators: Outbound connections from IrfanView process to unknown IPs.
- Process Behavior: IrfanView.exe spawning child processes (e.g., cmd.exe, powershell.exe).
- Registry Changes: Unusual modifications to
HKCU\Software\IrfanView. - File System: Creation of new executable files in %TEMP% or %APPDATA%.
Detection Engineering
YARA Rule
rule CVE_2025_7318_DWG_Malicious {
meta:
description = "Detects malicious DWG files targeting CVE-2025-7318"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-7318"
strings:
$dwg_header = { 41 43 31 30 } // "AC10" (DWG header)
$suspicious_payload = /[A-Za-z0-9\/+]{100,}/ // Base64-like long strings
condition:
$dwg_header at 0 and #suspicious_payload > 3
}
Sigma Rule
title: CVE-2025-7318 IrfanView CADImage Plugin Memory Corruption
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects potential exploitation of CVE-2025-7318 via IrfanView crashes
author: Valters IT
date: 2025-04-10
logsource:
product: windows
service: application
detection:
selection:
EventID: 1000
ApplicationName: 'IrfanView.exe'
FaultModuleName: 'CADImage.dll'
condition: selection
falsepositives:
- Legitimate crashes due to corrupted files
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"CVE-2025-7318 Potential DWG Malware Download"; flow:to_server,established; content:"|41 43 31 30|"; distance:0; within:4; fileext:"dwg"; 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 Education: Warn users not to open DWG files from untrusted sources.
- Network Filtering: Block DWG file downloads at the perimeter if not business-required.
Long-Term:
- Monitor the vendor for a patch and apply it immediately when released.
- Consider using alternative CAD viewers that are actively maintained.
- Implement application control to restrict IrfanView execution.
Workaround: If the plugin is essential, use a sandbox or virtual machine to open DWG files.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.