CVE-2025-64364
Executive Summary
CVE-2025-64364 is a critical PHP Local File Inclusion (LFI) vulnerability in the Masterstudy WordPress theme by StylemixThemes. The flaw resides in improper control of filenames used in PHP include/require statements, allowing an unauthenticated attacker to read arbitrary files from the server. This can lead to exposure of sensitive configuration files, database credentials, and source code. The vulnerability affects all versions of Masterstudy prior to 4.8.126. No patch has been released by the vendor, and no public exploit code is available at this time. The CVSS score is 7.5 (High), with a network attack vector and no authentication required.
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 WordPress ecosystem and the Masterstudy theme. It is not a supply chain issue in the traditional sense (e.g., NPM, PyPI, Go, Ruby), but it does represent a risk for WordPress site owners who have installed the theme. The lack of a patch means that affected sites must rely on alternative mitigations such as Web Application Firewall (WAF) rules or disabling the vulnerable functionality.
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 vulnerability does not affect other components.
- Confidentiality (C): High (H) – Full file read capability.
- Integrity (I): None (N) – No file modification possible.
- Availability (A): None (N) – No denial of service.
Threat Level: High. The vulnerability is easy to exploit and can lead to complete disclosure of sensitive server data.
Deep Dive & Mechanics
The Masterstudy theme uses PHP include or require statements to load template files or other resources. The filename parameter is not properly sanitized, allowing an attacker to inject path traversal sequences (e.g., ../../) to include arbitrary files from the server. This is a classic PHP Local File Inclusion (LFI) vulnerability.
The vulnerable code likely appears in a function that handles template loading, such as:
include( get_template_directory() . '/templates/' . $_GET['template'] . '.php' );
An attacker can manipulate the template parameter to include files outside the intended directory, such as /etc/passwd or wp-config.php.
Vulnerable vs. Patched Code
Vulnerable Code (Masterstudy < 4.8.126):
function load_template_part($part) {
include( get_template_directory() . '/parts/' . $part . '.php' );
}
Patched Code (Hypothetical, based on best practices):
function load_template_part($part) {
$allowed_parts = array('header', 'footer', 'sidebar');
if (in_array($part, $allowed_parts)) {
include( get_template_directory() . '/parts/' . $part . '.php' );
} else {
// Handle error
}
}
The patched version uses a whitelist of allowed filenames, preventing path traversal.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install WordPress with Masterstudy theme version 4.8.125.
- Ensure the vulnerable endpoint is accessible (e.g., via a custom page template or AJAX handler).
Exploitation Steps:
- Identify the vulnerable parameter (e.g.,
template,file,include). - Craft a request to read
/etc/passwd:GET /?template=../../../../../../etc/passwd HTTP/1.1 Host: target-site.com - If successful, the response will contain the contents of
/etc/passwd.
Proof of Concept (PoC):
curl -v "http://target-site.com/?template=../../../../../../etc/passwd"
Blue Team
Detection:
- Monitor for path traversal patterns in HTTP requests (e.g.,
../,..\\,%2e%2e%2f). - Alert on requests to the vulnerable endpoint with suspicious parameters.
Mitigation:
- Implement a Web Application Firewall (WAF) rule to block path traversal attempts.
- Disable the vulnerable functionality if not needed.
- Apply virtual patching via a WAF or reverse proxy.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP GET requests containing
../or..\\in query parameters. - Requests to
/?template=../../../../etc/passwdor similar. - Unusual file paths in HTTP responses (e.g.,
/etc/passwdcontent).
- HTTP GET requests containing
File System IOCs:
- Unexpected files in web server logs (e.g.,
/var/log/apache2/access.logcontaining path traversal attempts). - Presence of files like
/tmp/exploit.txtif the attacker attempts to write files.
- Unexpected files in web server logs (e.g.,
Log IOCs:
- Web server access logs showing repeated
../patterns. - PHP error logs indicating failed
includeattempts.
- Web server access logs showing repeated
Detection Engineering
YARA Rule
rule CVE_2025_64364_LFI_Detection {
meta:
description = "Detects path traversal attempts targeting Masterstudy theme LFI"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-64364"
strings:
$path_traversal = /(\.\.\/|\.\.\\){2,}/
$vulnerable_param = /[?&](template|file|include)=/
condition:
$vulnerable_param and $path_traversal
}
Sigma Rule
title: Masterstudy Theme LFI Attempt
id: 8f4b3c2a-1e5d-4f7b-9a0c-3d6e8f2b1a4c
status: experimental
description: Detects HTTP requests with path traversal patterns targeting Masterstudy theme
author: Valters IT
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '../'
- '..\\'
- '%2e%2e%2f'
- '%2e%2e%5c'
condition: selection
falsepositives:
- Legitimate use of relative paths in some plugins
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-64364 Masterstudy LFI Attempt"; flow:to_server,established; content:"GET"; http_method; content:"../"; http_uri; content:"template="; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the vulnerable functionality – If the theme allows disabling template loading via a setting, do so.
- Apply a WAF rule – Block requests containing
../or..\\in query parameters. - Upgrade – If a patched version becomes available, upgrade immediately.
Long-term Actions:
- Code Review – Audit the Masterstudy theme for similar vulnerabilities.
- Input Validation – Implement strict whitelisting for all file inclusion parameters.
- Monitor – Continuously monitor logs for exploitation attempts.
Workaround:
- Use a reverse proxy (e.g., Nginx) to block path traversal patterns:
location ~ \.php$ { if ($args ~* "\.\.") { return 403; } }
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.