CVE-2025-31913
Executive Summary
CVE-2025-31913 is a critical Local File Inclusion (LFI) vulnerability in the ApusTheme Ogami WordPress theme, affecting versions up to and including 1.53. The vulnerability 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, source code, and potentially credentials. The CVSS score of 8.1 reflects the high impact on confidentiality with low attack complexity and no required privileges. As of this report, no official patch has been released, and no public proof-of-concept code is available.
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 a WordPress theme distributed through the ApusTheme marketplace and potentially other channels. Since WordPress themes are often bundled with plugins and child themes, the supply chain risk extends to any site using the Ogami theme. Users should verify the integrity of their theme files and monitor for updates from ApusTheme. The lack of a patch increases the urgency for manual mitigation.
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 (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – Vulnerability does not affect other components.
- Confidentiality Impact: High (C:H) – Full file read capability.
- Integrity Impact: None (I:N) – No file modification.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Critical for unpatched installations. The low EPSS score (0.0%) suggests limited active exploitation, but the ease of exploitation and high impact make it a priority for remediation.
Deep Dive & Mechanics
The vulnerability exists in the Ogami theme's PHP code, likely in a function that handles file inclusion without proper sanitization. The theme may use user-supplied input (e.g., via GET/POST parameters, cookies, or file paths) to construct an include/require statement. An attacker can manipulate this input to traverse directories and include arbitrary files, such as /etc/passwd, wp-config.php, or other sensitive files.
Root Cause: The theme fails to validate or sanitize the filename parameter before passing it to PHP functions like include(), require(), include_once(), or require_once(). This allows path traversal sequences (e.g., ../../) to escape the intended directory.
Attack Vector: An unauthenticated attacker sends a crafted HTTP request to a vulnerable endpoint, such as:
GET /wp-content/themes/ogami/some-page.php?file=../../../etc/passwd HTTP/1.1
The server then includes the specified file, outputting its contents in the response.
Impact: Successful exploitation leads to disclosure of:
- WordPress configuration (database credentials, salts)
- Server configuration files
- Source code of other themes/plugins
- Log files containing sensitive data
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code pattern is hypothesized based on common LFI vulnerabilities in WordPress themes.
Vulnerable Code (Hypothetical):
<?php
// vulnerable.php
$file = $_GET['file'];
include("includes/" . $file);
?>
Patched Code (Hypothetical):
<?php
// patched.php
$allowed_files = array('header.php', 'footer.php', 'sidebar.php');
$file = basename($_GET['file']);
if (in_array($file, $allowed_files)) {
include("includes/" . $file);
} else {
// Handle error
}
?>
Key Differences:
- Input Validation: Patched code uses a whitelist of allowed files.
- Path Traversal Prevention:
basename()strips directory traversal sequences. - Error Handling: Patched code rejects invalid requests.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- A WordPress site running Ogami theme version <= 1.53.
- Knowledge of a vulnerable endpoint (e.g., a page that accepts a
fileparameter).
Exploitation Steps:
- Identify the vulnerable parameter by analyzing the theme's source code or using fuzzing.
- Craft a request to read sensitive files:
GET /wp-content/themes/ogami/template-parts/content.php?file=../../../wp-config.php HTTP/1.1 Host: target.com - If successful, the response will contain the contents of
wp-config.php. - Use path traversal to read other files:
/etc/passwdfor user enumeration/proc/self/environfor environment variables/var/log/apache2/access.logfor log poisoning
Automation with curl:
curl -s "http://target.com/wp-content/themes/ogami/template-parts/content.php?file=../../../wp-config.php"
Blue Team (Defensive)
Detection:
- Monitor web server logs for suspicious GET parameters containing
../orfile=patterns. - Use WAF rules to block path traversal sequences.
- Implement file integrity monitoring for critical files.
Hunting:
- Search for requests to theme files with unusual parameters.
- Look for responses containing sensitive data like
DB_PASSWORDordefine(.
Mitigation:
- Disable the vulnerable functionality until a patch is available.
- Apply virtual patching via WAF.
- Restrict file permissions to limit exposure.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests containing
../in parameters (e.g.,file=../../../etc/passwd) - Requests to theme files with unexpected parameters (e.g.,
content.php?file=) - Responses containing sensitive file contents (e.g.,
DB_PASSWORD,root:x:0:0)
File System IOCs:
- Unauthorized access to
/etc/passwd,wp-config.php, or other sensitive files. - Modified log files indicating exploitation attempts.
Log Artifacts:
- Apache/Nginx access logs showing path traversal patterns.
- PHP error logs with warnings about failed includes.
Detection Engineering
YARA Rule
rule CVE_2025_31913_LFI_Ogami {
meta:
description = "Detects LFI attempts targeting ApusTheme Ogami theme"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-31913"
strings:
$path_traversal = /\.\.\/|\.\.\\|%2e%2e%2f|%2e%2e%5c/
$ogami_theme = /ogami/i
$file_param = /[?&]file=/
condition:
$ogami_theme and $file_param and $path_traversal
}
Sigma Rule
title: CVE-2025-31913 LFI Attempt on Ogami Theme
id: 8a7b3c2d-1e5f-4a6b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects path traversal attempts targeting the ApusTheme Ogami WordPress theme
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-uri-query|contains:
- 'file=../'
- 'file=..\\'
- 'file=%2e%2e%2f'
- 'file=%2e%2e%5c'
cs-uri-stem|contains:
- '/wp-content/themes/ogami/'
condition: selection
falsepositives:
- Legitimate use of relative paths in theme files (rare)
level: high
Suricata Rule
alert http any any -> any any (
msg:"CVE-2025-31913 - LFI Attempt on Ogami Theme";
flow:to_server,established;
content:"/wp-content/themes/ogami/"; http_uri;
content:"file="; http_uri;
pcre:"/file=[^&]*\.\.\//i";
classtype:attempted-recon;
sid:1000001;
rev:1;
reference:cve,2025-31913;
)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable functionality: If possible, remove or disable the theme component that handles file inclusion.
- Apply virtual patching: Use a Web Application Firewall (WAF) to block requests containing path traversal patterns.
- Restrict file permissions: Ensure sensitive files (e.g.,
wp-config.php) are not readable by the web server user.
Long-term Fix:
- Update the theme: Monitor ApusTheme for a patched version and apply it immediately.
- Code review: If you have access to the source code, implement proper input validation and whitelisting.
- Replace the theme: Consider switching to a more secure alternative if no patch is forthcoming.
Workaround:
- Add the following rule to
.htaccess(Apache) to block path traversal:RewriteEngine On RewriteCond %{QUERY_STRING} (file|include|require)=.*\.\..* [NC] RewriteRule .* - [F,L]
Monitoring:
- Enable detailed logging for web requests.
- Set up alerts for suspicious patterns.
- Regularly review logs for signs of exploitation.
Report generated by Valters IT DevSecOps & CTI Framework
Signature: 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.