CVE-2025-59558
Executive Summary
CVE-2025-59558 is a critical PHP Local File Inclusion (LFI) vulnerability affecting the Billey WordPress theme by ThemeMove, versions prior to 2.1.6. The flaw stems from improper control of filenames in include/require statements, allowing an unauthenticated attacker to include arbitrary local files from the server. This can lead to sensitive information disclosure, including configuration files, credentials, and source code. The vulnerability is classified under CWE-98 (Improper Control of Filename for Include/Require Statement in PHP Program) and carries a CVSS score of 8.1 (High). No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch. Given the WordPress ecosystem context, this vulnerability poses a significant risk to sites running the Billey theme.
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 specific to the Billey WordPress theme, a commercial product distributed via ThemeMove. As a WordPress theme, it is part of the WordPress ecosystem and is typically installed via the WordPress admin panel or manually uploaded. There is no associated NPM, PyPI, Go, or Ruby package. The risk is limited to direct installations of the theme; however, compromised theme updates or malicious forks could propagate the vulnerability.
CVSS Breakdown & Threat Level
- CVSS Score: 8.1 (High)
- 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: High (C:H)
- Integrity Impact: None (I:N)
- Availability Impact: None (A:N)
The high confidentiality impact reflects the ability to read arbitrary files, including wp-config.php (database credentials), /etc/passwd, and other sensitive data. The low attack complexity and no required privileges make this easily exploitable by remote attackers.
Deep Dive & Mechanics
The vulnerability exists in the Billey theme's PHP code, specifically in functions that handle file inclusion without proper sanitization. The theme likely uses a parameter (e.g., page, template, or file) to dynamically include PHP files. An attacker can manipulate this parameter to traverse directories and include arbitrary files.
Example vulnerable code pattern:
<?php
$file = $_GET['file'];
include($file . '.php');
?>
By sending a request like:
http://target.com/?file=../../../etc/passwd%00
The attacker can include /etc/passwd (null byte injection may work in older PHP versions) or use path traversal to read sensitive files.
The theme's version 2.1.6 likely introduced proper input validation, such as whitelisting allowed files or using realpath() to restrict inclusion to a specific directory.
Vulnerable vs. Patched Code
Vulnerable Code (pre-2.1.6):
<?php
// No input validation
$template = $_GET['template'];
include( get_template_directory() . '/templates/' . $template . '.php' );
?>
Patched Code (2.1.6+):
<?php
$allowed_templates = array('home', 'about', 'contact');
$template = $_GET['template'];
if (in_array($template, $allowed_templates)) {
include( get_template_directory() . '/templates/' . $template . '.php' );
} else {
// Default template
include( get_template_directory() . '/templates/home.php' );
}
?>
The patched version uses a whitelist to restrict inclusion to predefined templates, preventing path traversal.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install WordPress with the Billey theme (version < 2.1.6) on a local server (e.g., XAMPP, Docker).
- Ensure the vulnerable parameter (e.g.,
template) is exposed in a URL.
Exploitation Steps:
- Identify the vulnerable parameter by analyzing the theme's source code or using fuzzing.
- Craft a request to read
/etc/passwd:http://target.com/?template=../../../etc/passwd%00 - If null byte injection fails, try:
(Note: PHP 5.3+ may require the file to exist withhttp://target.com/?template=../../../etc/passwd.phpextension; use path truncation or other techniques.)
Example using cURL:
curl -v "http://target.com/?template=../../../etc/passwd%00"
Expected Output: The contents of /etc/passwd will be displayed if successful.
Blue Team
Detection:
- Monitor web server logs for suspicious
templateparameters containing../or%00. - Use WAF rules to block path traversal patterns.
Hunting:
- Search for requests with
template=followed by directory traversal sequences. - Check for unusual file inclusion attempts in PHP error logs.
Indicators of Compromise (IOCs)
- URL Patterns:
?template=../../../etc/passwd,?template=../../wp-config.php - Log Entries:
GET /?template=../../../etc/passwd HTTP/1.1with 200 response - File Access: Unauthorized reads of
/etc/passwd,wp-config.php, or other sensitive files - Network Traffic: Outbound connections from the server to attacker-controlled hosts (if combined with RFI)
Detection Engineering
YARA Rule
rule CVE_2025_59558_LFI_Detection {
meta:
description = "Detects attempts to exploit CVE-2025-59558 LFI in Billey theme"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-59558"
strings:
$traversal = /template=\.\.\/\.\.\/\.\.\// nocase
$nullbyte = /template=.*%00/ nocase
$sensitive = /template=.*(etc\/passwd|wp-config\.php|\.\.\/)/ nocase
condition:
any of them
}
Sigma Rule
title: CVE-2025-59558 Billey Theme LFI Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests attempting to exploit LFI in Billey WordPress theme
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'template=../'
- 'template=..%2f'
- 'template=%2e%2e%2f'
condition: selection
falsepositives:
- Legitimate use of template parameter with valid paths (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-59558 Billey Theme LFI Attempt"; flow:to_server,established; content:"GET"; http_method; content:"template="; http_uri; content:"../"; within:100; reference:cve,2025-59558; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Update the theme: Upgrade to Billey version 2.1.6 or later if available. If not, consider switching to an alternative theme.
- Apply virtual patching: Use a Web Application Firewall (WAF) to block requests containing
template=with path traversal sequences. - Disable the vulnerable functionality: If possible, remove or comment out the vulnerable include code in the theme files.
Long-term Measures:
- Implement input validation and whitelisting for all file inclusion parameters.
- Use
realpath()to resolve and restrict file paths. - Regularly audit third-party themes and plugins for vulnerabilities.
- Enable PHP
open_basedirrestrictions to limit file access.
Workaround:
- Add the following rule to
.htaccess(Apache) to block malicious requests:
RewriteEngine On
RewriteCond %{QUERY_STRING} template=\.\./ [NC,OR]
RewriteCond %{QUERY_STRING} template=.*%00 [NC]
RewriteRule ^ - [F,L]
Valters IT
Securing Digital Frontiers
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.