CVE-2023-50234
Executive Summary
CVE-2023-50234 is a stack-based buffer overflow vulnerability in Hancom Office Cell, a component of the Hancom Office suite used for spreadsheet processing. The flaw resides in the parsing of XLS files, where insufficient validation of user-supplied data length leads to a buffer overflow on the stack. An attacker can exploit this by convincing a user to open a malicious XLS file or visit a crafted web page, resulting in remote code execution in the context of the current process. With a CVSS score of 7.8, this vulnerability poses a significant risk to end-user systems, especially in environments where Hancom Office is deployed. No public proof-of-concept or patch is currently available, but the vulnerability has been disclosed via the Zero Day Initiative (ZDI-CAN-20386).
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)
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack Vector: Local (requires user interaction 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. Exploitation requires user interaction, but the impact is complete compromise of the affected system. The lack of a patch increases the risk for unpatched installations.
Deep Dive & Mechanics
The vulnerability is a classic stack-based buffer overflow (CWE-121) in the XLS file parser of Hancom Office Cell. When parsing a specially crafted XLS file, the parser copies user-supplied data into a fixed-size stack buffer without proper length validation. By providing an overly long value in a specific field (likely a cell value, formula, or record), an attacker can overwrite the return address and other stack data.
Technical Details:
- Root Cause: The
memcpyor similar function is used to copy data from the XLS file into a stack buffer of size N, but the length of the source data is not checked against N. - Exploitation: The attacker crafts an XLS file with a malicious record that contains a long string. When the parser processes this record, it overflows the stack buffer, overwriting the saved return address. The attacker can then redirect execution to a ROP chain or shellcode.
- Process Context: The exploit runs in the context of the current user process (Hancom Office Cell), so it inherits the user's privileges.
Attack Vector:
- The victim must open the malicious XLS file (e.g., via email attachment, download, or web page).
- No additional privileges are required beyond user-level access.
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 pattern is:
// Vulnerable code (hypothetical)
void parse_xls_record(char *data, int len) {
char buffer[256];
// No length check
memcpy(buffer, data, len); // Stack overflow if len > 256
}
A patched version would include bounds checking:
// Patched code (hypothetical)
void parse_xls_record(char *data, int len) {
char buffer[256];
if (len > sizeof(buffer)) {
// Handle error
return;
}
memcpy(buffer, data, len);
}
Exploitation & Lab Setup
Red Team
Objective: Achieve remote code execution on a target running Hancom Office Cell.
Prerequisites:
- Hancom Office Cell installed (any version).
- Victim must open the malicious XLS file.
Steps:
- Craft Malicious XLS File: Use a tool like
msfvenomor a custom Python script to create an XLS file with an oversized field in a record (e.g., a cell value or formula). The overflow should overwrite the return address with a pointer to shellcode. - Deliver Payload: Send the file via email, social engineering, or host it on a malicious website.
- Trigger Exploit: When the victim opens the file, the overflow triggers, executing the shellcode.
Example Python Script (Conceptual):
import struct
# Shellcode (e.g., calc.exe for testing)
shellcode = b"\x90" * 100 + b"\xcc" * 4 # Replace with actual shellcode
# Craft XLS record with overflow
buffer_size = 256
overflow_data = b"A" * (buffer_size + 8) # Fill buffer and overwrite return address
overflow_data += struct.pack("<I", 0x41414141) # Overwritten return address (placeholder)
overflow_data += shellcode
# Write to file (simplified)
with open("malicious.xls", "wb") as f:
f.write(overflow_data)
Note: This is a conceptual example. Actual exploitation requires precise knowledge of the stack layout and ASLR/DEP bypass techniques.
Blue Team
Detection & Response:
- Monitor for Hancom Office crashes: Unexpected crashes of
cell.exeor related processes may indicate exploitation attempts. - Analyze XLS files: Use static analysis tools to detect oversized records or anomalous structures.
- Endpoint Detection: Deploy EDR rules to detect stack-based buffer overflow patterns (e.g.,
memcpywith large size). - User Awareness: Train users not to open untrusted XLS files.
Indicators of Compromise (IOCs)
- File Hashes: (None publicly available; generate upon discovery)
- Network Indicators: Outbound connections from
cell.exeto unknown IPs (if shellcode connects back). - Process Anomalies:
cell.exespawning child processes (e.g.,cmd.exe,powershell.exe). - Registry Changes: Unauthorized modifications to startup keys.
- File System: Creation of new executable files in temporary directories.
Detection Engineering
YARA Rule
rule CVE_2023_50234_Hancom_XLS_Overflow {
meta:
description = "Detects malicious XLS files exploiting CVE-2023-50234"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-50234"
strings:
$xls_magic = { D0 CF 11 E0 A1 B1 1A E1 } // OLE2 magic
$long_record = /[\x00-\xff]{300,}/ // Record longer than 300 bytes
condition:
$xls_magic at 0 and #long_record > 0
}
Sigma Rule
title: Hancom Office Cell Stack Buffer Overflow Exploitation
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential exploitation of CVE-2023-50234 via process crash or anomalous behavior
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\cell.exe'
CommandLine|contains: '*.xls'
condition: selection
falsepositives:
- Legitimate large XLS files
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2023-50234 Hancom XLS Exploit Attempt"; flow:to_server; content:"|D0 CF 11 E0 A1 B1 1A E1|"; depth:8; content:"|00 00 00 00|"; distance:0; within:4; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
- No Patch Available: As of this report, Hancom has not released a patch. Monitor vendor updates.
- Mitigation:
- Disable automatic opening of XLS files from untrusted sources.
- Use application sandboxing or virtualization for Hancom Office.
- Implement endpoint protection with exploit prevention capabilities (e.g., ASLR, DEP, CFG).
- Restrict execution of
cell.exevia AppLocker or similar.
- Workaround: Convert XLS files to a safer format (e.g., CSV) before opening.
Valters IT
Securing Digital Frontiers
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.