CVE-2024-5507
Executive Summary
CVE-2024-5507 is a stack-based buffer overflow vulnerability in Luxion KeyShot Viewer, specifically during the parsing of KSP files. The flaw allows remote attackers to execute arbitrary code in the context of the current process, requiring user interaction (e.g., opening a malicious KSP file or visiting a malicious page). With a CVSS score of 7.8 (High), this vulnerability poses a significant risk to users of KeyShot Viewer, especially in environments where untrusted KSP files are processed. No public exploit code or patch is currently available, but the vulnerability is confirmed by ZDI (ZDI-CAN-22266). The EPSS score is 0.0%, indicating low exploitation likelihood at this time, but the risk remains due to the lack of 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
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Base Score: 7.8 (High)
- Attack Vector: Local (requires user to open a malicious file)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: High. Although no active exploitation has been reported, the vulnerability allows full code execution with minimal complexity. The lack of a patch increases the risk for unpatched installations.
Deep Dive & Mechanics
The vulnerability resides in the parsing logic of KSP files within Luxion KeyShot Viewer. KSP files are project files used by KeyShot for 3D rendering and visualization. The specific flaw is a stack-based buffer overflow (CWE-121) triggered when the application copies user-supplied data from a KSP file into a fixed-size stack buffer without proper length validation.
Technical Details:
- Root Cause: The application fails to validate the length of data read from a KSP file field before copying it to a stack buffer using a function like
strcpyormemcpy. - Trigger: An attacker crafts a KSP file with an oversized field (e.g., a long string in a metadata or geometry field). When KeyShot Viewer parses this field, it overflows the stack buffer, overwriting the return address and other critical stack data.
- Impact: Successful exploitation allows arbitrary code execution in the context of the KeyShot Viewer process. This can lead to full system compromise, including data theft, malware installation, or lateral movement.
Attack Vector:
- Delivery: The attacker must convince the user to open a malicious KSP file (e.g., via email, download, or web page).
- Execution: Once opened, the overflow occurs during parsing, giving the attacker control of the instruction pointer.
Vulnerable vs. Patched Code
Since no patch is available, a direct comparison is not possible. However, based on the vulnerability description, the vulnerable code likely resembles:
// Vulnerable code (pseudocode)
void parse_ksp_field(char *field_data) {
char buffer[256];
strcpy(buffer, field_data); // No length check
// ... process buffer
}
A patched version would include bounds checking:
// Patched code (pseudocode)
void parse_ksp_field(char *field_data, size_t field_len) {
char buffer[256];
if (field_len >= sizeof(buffer)) {
// Handle error or truncate
return;
}
strncpy(buffer, field_data, sizeof(buffer) - 1);
buffer[sizeof(buffer) - 1] = '\0';
// ... process buffer
}
Exploitation & Lab Setup
Red Team
Exploitation Steps:
- Craft Malicious KSP File: Use a hex editor or custom script to create a KSP file with an oversized field (e.g., a long string in a metadata tag). The overflow should overwrite the return address with a controlled value.
- Bypass Protections: If ASLR/DEP are enabled, use ROP chains or heap spraying to achieve code execution. Since this is a stack overflow, classic ROP techniques apply.
- Deliver Payload: Embed shellcode or a DLL loader in the KSP file. The payload should execute a reverse shell or download additional malware.
- Trigger: Send the malicious KSP file to the target via phishing email or malicious website.
Example Payload Structure (Conceptual):
[KSP Header]
[Oversized Field: "A"*256 + ROP Chain + Shellcode]
[KSP Footer]
Note: No public exploit code is available; this is a theoretical approach.
Blue Team
Detection & Mitigation:
- Monitor Process Behavior: Use EDR to detect KeyShot Viewer crashes or unusual memory access patterns (e.g., stack corruption).
- File Scanning: Scan all incoming KSP files for oversized fields or anomalous structures using YARA rules (see Detection Engineering).
- User Awareness: Train users not to open KSP files from untrusted sources.
- Sandboxing: Run KeyShot Viewer in a sandboxed environment to limit impact.
Indicators of Compromise (IOCs)
- File Hashes (Malicious KSP): None publicly available; generate dynamically.
- Network Indicators: Outbound connections from KeyShot Viewer to unknown IPs (e.g., for reverse shell).
- Process Anomalies: KeyShot Viewer process crashing with stack corruption errors.
- Registry/File System: Unusual files written to %TEMP% or %APPDATA% by KeyShot Viewer.
Detection Engineering
YARA Rule
rule CVE_2024_5507_KeyShot_KSP_Overflow {
meta:
description = "Detects malicious KSP files exploiting CVE-2024-5507 stack overflow"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-5507"
strings:
$ksp_header = "KSP" ascii wide nocase
$long_field = /.{512,}/ // Field longer than 512 bytes (potential overflow)
condition:
$ksp_header at 0 and #long_field > 0
}
Sigma Rule
title: CVE-2024-5507 KeyShot Viewer KSP File Stack Overflow
id: 8a3f2c1e-5d7b-4a9c-8e6f-2b1d3c4a5e6f
status: experimental
description: Detects KeyShot Viewer crashes or suspicious behavior related to KSP file parsing
author: Valters IT
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\keyshot_viewer.exe'
CommandLine|contains: '.ksp'
condition: selection
falsepositives:
- Legitimate large KSP files
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-5507 KeyShot Viewer KSP File Download"; flow:to_server,established; file_data; content:"KSP"; within:4; byte_test:4,>,512,0,relative; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable or restrict the use of Luxion KeyShot Viewer until a patch is available.
- Workaround: Use a file reputation service to block KSP files from untrusted sources.
- Long-term: Monitor vendor updates for a patch. Consider using a sandbox or virtual machine for opening KSP files.
- Compensating Controls: Enable ASLR, DEP, and EMET (if available) to increase exploitation difficulty.
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.