CVE-2025-67988
Executive Summary
CVE-2025-67988 is a critical PHP Local File Inclusion (LFI) vulnerability in the CozyStay WordPress theme developed by LoftOcean. The flaw resides in 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, database credentials, configuration files) and potentially remote code execution if combined with file upload capabilities. The vulnerability affects all versions of CozyStay prior to 1.9.1. No official patch has been released, and no public exploit code is available at this time.
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 as a theme component. It does not affect the core WordPress software, Apache, or Nginx. The risk is amplified for sites using outdated versions of the CozyStay theme, as no patch is currently available. Users should consider disabling or replacing the theme until a fix is released.
CVSS Breakdown & Threat Level
- CVSS Score: 8.1 (High)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- 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 and low attack complexity make this a serious threat for unpatched installations.
Deep Dive & Mechanics
The vulnerability is a PHP Local File Inclusion (LFI) caused by insufficient sanitization of user-supplied input used in a PHP include or require statement. In the CozyStay theme, a parameter (likely page, template, or similar) is passed to a function that constructs a file path without proper validation. An attacker can manipulate this parameter to traverse directories and include arbitrary files from the server.
Example vulnerable code pattern:
$file = $_GET['template'];
include( 'templates/' . $file . '.php' );
An attacker could supply ../../../../etc/passwd%00 to include /etc/passwd (null byte injection may be required in older PHP versions). In modern PHP, null byte injection is mitigated, but path traversal still works if the extension is not appended.
Root Cause: The theme does not validate or sanitize the filename parameter, allowing directory traversal sequences (../) and absolute paths.
Vulnerable vs. Patched Code
Vulnerable Code (pre-1.9.1):
// In a theme file (e.g., page.php or functions.php)
$template = $_GET['template'];
include( get_template_directory() . '/templates/' . $template . '.php' );
Patched Code (1.9.1+):
// Patched version uses a whitelist or basename() with realpath()
$allowed_templates = array('default', 'fullwidth', 'sidebar');
$template = basename( $_GET['template'] );
if ( in_array( $template, $allowed_templates ) ) {
include( get_template_directory() . '/templates/' . $template . '.php' );
} else {
// Fallback to default
include( get_template_directory() . '/templates/default.php' );
}
The patch restricts inclusion to a predefined whitelist and uses basename() to strip directory traversal.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Target running WordPress with CozyStay theme version < 1.9.1.
- No authentication required.
Exploit Steps:
- Identify the vulnerable parameter (e.g.,
template,page,file). - Craft a request to include a sensitive file:
GET /?template=../../../../etc/passwd HTTP/1.1 Host: target.com - If the theme appends
.php, use a null byte (if PHP < 5.3.4) or try double encoding:GET /?template=../../../../etc/passwd%00 HTTP/1.1 - Alternatively, use a PHP wrapper to read source code:
GET /?template=php://filter/convert.base64-encode/resource=../../../../etc/passwd HTTP/1.1
Expected Output: The contents of /etc/passwd or other files will be displayed in the response.
Blue Team (Defense & Detection)
Detection:
- Monitor web server logs for directory traversal patterns (
../,%2e%2e%2f,..%2f). - Look for requests to the theme's vulnerable endpoint with unusual parameters.
- Use WAF rules to block path traversal sequences.
Hunting:
- Search for requests containing
template=,page=, orfile=parameters with../or base64-encoded strings. - Check for inclusion of
/etc/passwd,/proc/self/environ, or other sensitive files.
Lab Setup:
- Install WordPress with CozyStay theme version 1.8.0.
- Enable logging in Apache/Nginx.
- Use a tool like Burp Suite or curl to send malicious requests.
Indicators of Compromise (IOCs)
- File Paths:
/etc/passwd,/etc/shadow,/proc/self/environ,/wp-config.php - URL Patterns:
?template=../../../../etc/passwd,?page=php://filter/... - Log Entries: HTTP 200 responses to requests containing
../in query parameters. - Network: Outbound connections from the web server to attacker-controlled hosts (if RCE achieved).
Detection Engineering
YARA Rule
rule CVE_2025_67988_LFI_CozyStay {
meta:
description = "Detects LFI attempts targeting CozyStay theme"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-67988"
strings:
$traversal1 = "../"
$traversal2 = "..\\"
$traversal3 = "%2e%2e%2f"
$traversal4 = "%2e%2e%5c"
$sensitive1 = "/etc/passwd"
$sensitive2 = "/wp-config.php"
$param1 = "template="
$param2 = "page="
condition:
any of ($param*) and any of ($traversal*) or any of ($sensitive*)
}
Sigma Rule
title: CVE-2025-67988 CozyStay LFI Detection
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects directory traversal attempts in CozyStay theme
author: Valters IT
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- 'template=../'
- 'page=../'
- 'template=%2e%2e%2f'
- 'page=%2e%2e%2f'
condition: selection
falsepositives:
- Legitimate use of similar parameters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-67988 CozyStay LFI Attempt"; flow:to_server,established; content:"GET"; http_method; content:"template="; http_uri; content:"../"; distance:0; within:10; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable or remove the CozyStay theme if running version < 1.9.1.
- Patch: Upgrade to version 1.9.1 or later once available. Since no patch is released, consider switching to an alternative theme.
- WAF Rules: Block requests containing
../,%2e%2e%2f, orphp://in query parameters. - File Permissions: Ensure sensitive files (e.g.,
/etc/passwd,/wp-config.php) are not readable by the web server user. - PHP Configuration: Set
allow_url_include = Offandopen_basedirto restrict file inclusion. - Monitoring: Enable detailed logging and alert on directory traversal patterns.
Valters IT – Securing digital frontiers, one CVE at a time.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.