CVE-2024-5506
Executive Summary
CVE-2024-5506 is a critical out-of-bounds write vulnerability in Luxion KeyShot Viewer, specifically during the parsing of KSP files. The flaw allows remote code execution in the context of the current process, requiring user interaction (opening a malicious KSP file or visiting a malicious page). With a CVSS score of 7.8, the vulnerability is severe but has a low EPSS score (0.0%), indicating limited active exploitation. No public exploit code or patch is currently available, making detection and mitigation crucial.
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 does not affect NPM, PyPI, Go, or Ruby packages. It is a standalone desktop application (Luxion KeyShot Viewer) and does not involve open-source package ecosystems.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Local (L) – Requires user to open a file or visit a page.
- Attack Complexity (AC): Low (L) – No special conditions needed.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): Required (R) – Victim must open the malicious file.
- Scope (S): Unchanged (U) – Exploit stays within the same security authority.
- Confidentiality (C): High (H) – Full data access possible.
- Integrity (I): High (H) – Code execution allows data modification.
- Availability (A): High (H) – Can crash or control the process.
Threat Level: High – Remote code execution with low complexity, though user interaction is required.
Deep Dive & Mechanics
The vulnerability resides in the KSP file parsing routine of Luxion KeyShot Viewer. KSP files are proprietary scene/project files used by KeyShot. The parser fails to validate user-supplied data, leading to a write past the end of an allocated buffer (out-of-bounds write). This memory corruption can be leveraged by an attacker to overwrite critical data structures, such as function pointers or return addresses, enabling arbitrary code execution.
Root Cause: Lack of bounds checking when copying data from the KSP file into a fixed-size buffer. The parser trusts the file’s metadata (e.g., length fields) without verifying they fit within the allocated memory.
Attack Vector: An attacker crafts a malicious KSP file with oversized data in a specific field. When the victim opens the file, the parser writes beyond the buffer, corrupting adjacent memory. The attacker can then control the execution flow to run shellcode.
Vulnerable vs. Patched Code
Since no patch is available, we can only describe the vulnerable pattern:
Vulnerable Code (Conceptual C++):
void ParseKSPField(char* buffer, size_t bufferSize, FILE* file) {
uint32_t dataSize;
fread(&dataSize, sizeof(dataSize), 1, file); // Read size from file
// No check: dataSize could be larger than bufferSize
fread(buffer, 1, dataSize, file); // Out-of-bounds write
}
Patched Code (Hypothetical):
void ParseKSPField(char* buffer, size_t bufferSize, FILE* file) {
uint32_t dataSize;
fread(&dataSize, sizeof(dataSize), 1, file);
if (dataSize > bufferSize) {
// Handle error, reject file
return;
}
fread(buffer, 1, dataSize, file);
}
Exploitation & Lab Setup
Red Team (Exploitation)
No public exploit code is available. However, a typical exploitation approach would involve:
- Crafting a Malicious KSP File: Use a hex editor to modify a legitimate KSP file, increasing a length field to exceed the buffer size.
- Overwriting a Function Pointer: Identify a vtable or callback pointer in the heap/stack that can be overwritten to redirect execution to shellcode.
- Delivering the Payload: Host the file on a website or send via email. The victim must open it with KeyShot Viewer.
Example (Conceptual Python script to generate a malformed KSP):
import struct
# Minimal KSP header (simplified)
header = b'KSP\x00'
# Craft a field with oversized size
field_size = 0x1000 # Larger than buffer
field_data = b'A' * field_size
payload = header + struct.pack('<I', field_size) + field_data
with open('malicious.ksp', 'wb') as f:
f.write(payload)
Blue Team (Defense)
- User Awareness: Train users not to open KSP files from untrusted sources.
- Application Sandboxing: Run KeyShot Viewer in a sandboxed environment (e.g., Windows Sandbox, Firejail) to limit damage.
- Memory Protection: Enable ASLR, DEP, and CFG (Control Flow Guard) on Windows to make exploitation harder.
- Monitor File Access: Use Sysmon or EDR to detect KeyShot Viewer opening unusual files.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): None available (no known samples).
- Network Indicators: None (exploitation is local file-based).
- Process Behavior: KeyShot Viewer (keyshot_viewer.exe) crashes or exhibits abnormal memory writes.
- Registry/File System: Temporary files in %TEMP% with suspicious names (e.g., .tmp files created by the viewer).
Detection Engineering
YARA Rule
rule CVE_2024_5506_KSP_OutOfBounds {
meta:
description = "Detects malformed KSP files exploiting CVE-2024-5506"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-5506"
strings:
$ksp_magic = "KSP\x00"
$large_size = { [0-3] [0-3] [0-3] [0-3] } // Placeholder for size field
condition:
$ksp_magic at 0 and uint32(4) > 0x1000 // Size field > 4096 bytes
}
Sigma Rule
title: CVE-2024-5506 - Luxion KeyShot Viewer KSP File Parsing Exploit
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects attempts to exploit out-of-bounds write in KeyShot Viewer via KSP files
author: Valters IT
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\keyshot_viewer.exe'
CommandLine|contains: '.ksp'
condition: selection
falsepositives:
- Legitimate KSP file openings
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-5506 - Potential KSP file download"; flow:to_client,established; file.name:/.*\.ksp/i; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable or uninstall Luxion KeyShot Viewer until a patch is released.
- Alternative: Use a different 3D viewer that does not parse KSP files.
- Workaround: If the software must be used, restrict execution via AppLocker or Software Restriction Policies to only allow trusted KSP files.
- Monitor: Watch for vendor updates at Luxion’s official site.
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.