CVE-2023-40502
Executive Summary
CVE-2023-40502 is a critical directory traversal vulnerability in LG Simple Editor, specifically within the cropImage command. The flaw allows an unauthenticated remote attacker to delete arbitrary files on the target system by supplying a crafted path that escapes the intended directory. Because the application runs with SYSTEM privileges, an attacker can delete critical system files, leading to denial of service or potential privilege escalation. No authentication is required, and no public exploit code or patch is currently available. The vulnerability was reported via ZDI (ZDI-CAN-19951) and has a CVSS score of 8.2, indicating high severity.
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:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- Base Score: 8.2 (High)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: High
- Availability Impact: High
The threat level is high due to the ease of exploitation (no authentication, low complexity) and the potential for destructive file deletion at the SYSTEM level.
Deep Dive & Mechanics
The vulnerability resides in the cropImage functionality of LG Simple Editor. The application fails to properly validate user-supplied paths before using them in file operations. An attacker can inject directory traversal sequences (e.g., ../) to escape the intended image directory and target arbitrary files on the filesystem.
Root Cause:
The cropImage endpoint accepts a file path parameter without sanitizing or canonicalizing it. The application then passes this path directly to file deletion APIs (e.g., DeleteFile on Windows). Because the service runs as SYSTEM, any file on the system can be deleted.
Attack Flow:
- Attacker sends a crafted HTTP request to the
cropImageendpoint. - The request includes a path parameter like
../../Windows/System32/config/SAM. - The application processes the path and deletes the specified file.
- The attacker can repeat this to delete multiple files, causing system instability or denial of service.
Impact:
- Deletion of critical system files (e.g., boot configuration, registry hives, drivers).
- Potential for privilege escalation if security-critical files are removed.
- Complete denial of service if essential OS components are deleted.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
string filePath = Request.QueryString["path"];
File.Delete(filePath); // No validation
Patched Code (Conceptual):
string filePath = Request.QueryString["path"];
string safePath = Path.GetFullPath(Path.Combine(baseDirectory, filePath));
if (!safePath.StartsWith(baseDirectory)) {
throw new SecurityException("Invalid path");
}
File.Delete(safePath);
The patched version uses Path.GetFullPath to resolve the absolute path and then checks that it starts with the allowed base directory, preventing traversal.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Target running LG Simple Editor with the vulnerable
cropImageendpoint. - Network access to the service (typically port 80 or 443).
Exploitation Steps:
- Identify the vulnerable endpoint:
POST /cropImageor similar. - Craft a request with a traversal path:
POST /cropImage HTTP/1.1 Host: target.com Content-Type: application/x-www-form-urlencoded path=../../Windows/System32/config/SAM - Send the request. The file will be deleted.
- Repeat for other critical files (e.g.,
boot.ini,ntldr,winlogon.exe).
Note: No public exploit code is available; this is a conceptual demonstration.
Blue Team
Detection:
- Monitor for unusual file deletion events (Event ID 4663 on Windows).
- Look for HTTP requests containing
../or..\in thepathparameter. - Alert on deletion of system-critical files (e.g.,
SAM,SYSTEM,SECURITY).
Mitigation:
- Apply input validation and path canonicalization.
- Run the service with least privileges (not SYSTEM).
- Use a Web Application Firewall (WAF) to block traversal patterns.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/cropImagewithpathparameter containing../or..\. - File System: Unexpected deletion of files in
C:\Windows\System32\config\,C:\Windows\System32\drivers\, etc. - Logs: Windows Security Event ID 4663 with
Deleteaccess on sensitive files. - Process:
LGSimpleEditor.exe(or similar) makingDeleteFilecalls on unexpected paths.
Detection Engineering
YARA Rule
rule CVE_2023_40502_LG_SimpleEditor_Traversal {
meta:
description = "Detects directory traversal attempts in LG Simple Editor cropImage requests"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-40502"
strings:
$traversal1 = "../" ascii wide nocase
$traversal2 = "..\\" ascii wide nocase
$endpoint = "cropImage" ascii wide nocase
condition:
$endpoint and ($traversal1 or $traversal2)
}
Sigma Rule
title: LG Simple Editor Directory Traversal Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects HTTP requests to LG Simple Editor cropImage with path traversal patterns
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: iis
detection:
selection:
cs-uri-query|contains:
- 'cropImage'
- '../'
- '..\\'
condition: selection
falsepositives:
- Legitimate use of relative paths in other contexts (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-40502 LG Simple Editor Directory Traversal"; flow:to_server,established; content:"cropImage"; http_uri; nocase; content:"../"; http_uri; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or remove the
cropImagefunctionality if not required. - Restrict network access to the LG Simple Editor service (firewall rules).
- Run the service under a low-privileged account instead of SYSTEM.
Long-Term Fix:
- Apply input validation and path canonicalization (see patched code example).
- Monitor vendor LG for an official patch.
- Implement a WAF to block directory traversal patterns.
Workaround:
- Use file system permissions to prevent the service account from deleting critical files.
Valters IT
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.