CVE-2024-11950
Executive Summary
CVE-2024-11950 is a high-severity (CVSS 7.8) remote code execution vulnerability in XnSoft XnView Classic, a popular image viewer and converter. The flaw resides in the parsing of RWZ files, where an integer underflow occurs due to insufficient validation of user-supplied data. This underflow leads to a write operation before proper bounds checking, enabling an attacker to execute arbitrary code in the context of the current user. Exploitation requires user interaction, such as opening a malicious RWZ file or visiting a compromised webpage. No public exploit code or patch details are currently available, and the EPSS score is 0.0%, indicating low active exploitation likelihood at this time.
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: 7.8 (High)
- Attack Vector: Local (AV:L) – Requires user to open a file or visit a page.
- Attack Complexity: Low (AC:L) – No special conditions needed.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: Required (UI:R) – Victim must perform an action.
- Scope: Unchanged (S:U) – Vulnerability affects only the vulnerable component.
- Confidentiality Impact: High (C:H) – Full data access possible.
- Integrity Impact: High (I:H) – Code execution allows modification.
- Availability Impact: High (A:H) – Can crash or control the process.
Threat Level: High. While no active exploits are publicly known, the vulnerability is easily exploitable with user interaction and can lead to full system compromise in the user context.
Deep Dive & Mechanics
The vulnerability is an integer underflow (CWE-191) in the RWZ file parser of XnView Classic. RWZ is a compressed raster image format. When parsing a crafted RWZ file, the software fails to properly validate a size field or length value. This leads to an integer underflow, where a subtraction operation results in a very large positive number (due to unsigned integer wrapping). This large value is then used as a size for a memory write operation, causing a buffer overflow or out-of-bounds write. The attacker can control the data written, leading to arbitrary code execution.
Root Cause: Lack of validation of user-supplied data in the RWZ parsing routine. Specifically, the code likely does:
unsigned int size = read_from_file();
unsigned int new_size = size - some_value; // underflow if size < some_value
char *buffer = malloc(new_size);
read_data(buffer, new_size); // writes beyond allocated memory
Attack Vector: The attacker crafts a malicious RWZ file with manipulated size fields. When the victim opens the file in XnView Classic, the integer underflow triggers, and the attacker-controlled data overwrites critical memory structures (e.g., return addresses, function pointers).
Vulnerable vs. Patched Code
Since no patch is available, we can only hypothesize the vulnerable code pattern.
Vulnerable Code (Hypothetical):
void parse_rwz(unsigned char *data, size_t len) {
unsigned int chunk_size = *(unsigned int*)(data + 4);
unsigned int actual_size = chunk_size - 0x100; // integer underflow if chunk_size < 0x100
char *buffer = (char*)malloc(actual_size);
memcpy(buffer, data + 8, actual_size); // buffer overflow
}
Patched Code (Hypothetical):
void parse_rwz(unsigned char *data, size_t len) {
unsigned int chunk_size = *(unsigned int*)(data + 4);
if (chunk_size < 0x100) {
// error handling
return;
}
unsigned int actual_size = chunk_size - 0x100;
char *buffer = (char*)malloc(actual_size);
if (buffer == NULL) return;
memcpy(buffer, data + 8, actual_size);
}
The patch adds a bounds check to prevent the underflow.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- XnView Classic (any version before patch)
- A crafted RWZ file
Steps:
- Create a malicious RWZ file with a manipulated size field (e.g., set chunk_size to 0x50, causing underflow when subtracting 0x100).
- Host the file on a webpage or send via email.
- Victim opens the file in XnView Classic.
- The integer underflow triggers, leading to a buffer overflow.
- Overwrite a return address or SEH handler with a ROP chain or shellcode.
- Execute arbitrary code (e.g., calc.exe or reverse shell).
Example Crafting (Python):
import struct
# Craft RWZ header
header = b"RWZ\x00"
chunk_size = 0x50 # small value to cause underflow
header += struct.pack("<I", chunk_size)
# Payload to overwrite return address
payload = b"A" * 1000 # adjust offset
with open("malicious.rwz", "wb") as f:
f.write(header + payload)
Note: No public exploit code is available; this is a conceptual example.
Blue Team (Defense)
Detection:
- Monitor for XnView Classic crashes or abnormal memory access.
- Use application whitelisting to block untrusted RWZ files.
- Enable ASLR and DEP to mitigate exploitation.
Hunting:
- Search for RWZ files with suspicious size fields (e.g., chunk_size < 0x100).
- Analyze memory dumps for signs of heap corruption.
Indicators of Compromise (IOCs)
- File Hashes: (None available, but monitor for RWZ files with unusual sizes)
- Network: Outbound connections from XnView Classic process (if shellcode connects back)
- Process: XnView.exe spawning cmd.exe or powershell.exe
- Registry: Unusual persistence keys (e.g., Run keys)
- File System: Creation of unknown executables in temp directories
Example YARA Rule (for RWZ files):
rule CVE_2024_11950_RWZ_Underflow {
meta:
description = "Detects malicious RWZ files exploiting integer underflow"
author = "Valters IT"
date = "2025-04-10"
strings:
$rwz_header = "RWZ"
$small_size = { ?? ?? ?? 00 50 00 00 00 } // chunk_size < 0x100
condition:
$rwz_header at 0 and $small_size
}
Detection Engineering
YARA Rule
rule CVE_2024_11950_XnView_RWZ {
meta:
description = "Detects RWZ files with potential integer underflow"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2024-11950"
strings:
$rwz = "RWZ"
$underflow_size = { [0-3] [0-9a-f] [0-9a-f] [0-9a-f] 00 00 00 00 } // size < 0x100
condition:
$rwz at 0 and #underflow_size > 0
}
Sigma Rule
title: XnView Classic RWZ Integer Underflow Exploitation
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects potential exploitation of CVE-2024-11950 via process anomalies
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\XnView.exe'
CommandLine|contains: 'malicious.rwz'
condition: selection
falsepositives:
- Legitimate RWZ files with small sizes
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (msg:"CVE-2024-11950 XnView RWZ Download"; flow:to_server,established; content:"RWZ"; offset:0; depth:3; content:"|00 00 00 00|"; within:4; distance:3; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable RWZ file association in XnView Classic or block RWZ files at the perimeter.
- Use application control (e.g., AppLocker) to prevent XnView from executing untrusted files.
- Enable exploit protections (ASLR, DEP, CFG) on the system.
Long-term:
- Monitor vendor for patches (XnSoft). No patch is currently available.
- Consider migrating to an alternative image viewer that supports RWZ securely.
- Implement file scanning for suspicious RWZ files using YARA rules.
Workaround:
- Do not open RWZ files from untrusted sources.
- Use a sandboxed environment for viewing unknown 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.