CVE-2025-54015
Executive Summary
CVE-2025-54015 is a PHP Local File Inclusion (LFI) vulnerability discovered in the HT Contact Form 7 WordPress plugin, developed by HT Plugins. The flaw resides in the improper control of a filename used in a PHP include or require statement, allowing an unauthenticated attacker to include arbitrary local files from the server. This can lead to sensitive information disclosure, such as reading the wp-config.php file containing database credentials, or potentially enabling further server-side attacks if combined with file upload capabilities.
The vulnerability affects all versions of the plugin from n/a through 2.0.0. As of this report, no official patch has been released, and no public proof-of-concept (PoC) code is available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the risk remains significant for unpatched WordPress installations.
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 plugin ecosystem. The plugin is distributed via the official WordPress Plugin Directory and can be installed directly from the WordPress admin dashboard. Users are advised to check for updates or remove the plugin if no patch is available.
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: 6.6 (Medium)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – The vulnerable component and the impacted component are the same.
- Confidentiality Impact: High (C:H) – Sensitive files can be read.
- Integrity Impact: None (I:N) – No file modification is possible.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Medium. While the CVSS score is 6.6, the lack of a patch and the potential for information disclosure elevate the risk for unpatched sites.
Deep Dive & Mechanics
The vulnerability is a classic PHP Local File Inclusion (LFI) caused by insufficient sanitization of a filename parameter used in a PHP include or require statement. In the HT Contact Form 7 plugin, a parameter (likely template or similar) is passed to a PHP function that constructs a file path without proper validation. An attacker can manipulate this parameter to include arbitrary files from the server, such as /etc/passwd or wp-config.php.
The attack typically works by sending a crafted HTTP request to a vulnerable endpoint, e.g.:
GET /wp-content/plugins/ht-contactform/includes/class-ht-contactform.php?template=../../../../wp-config.php
The plugin then includes the specified file, outputting its contents to the attacker.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is presumed to be similar to:
// Vulnerable code (hypothetical)
$template = $_GET['template'];
include( plugin_dir_path( __FILE__ ) . 'templates/' . $template . '.php' );
A patched version would implement strict validation:
// Patched code (hypothetical)
$allowed_templates = array('form', 'confirmation', 'error');
$template = $_GET['template'];
if (in_array($template, $allowed_templates)) {
include( plugin_dir_path( __FILE__ ) . 'templates/' . $template . '.php' );
} else {
// Handle error
}
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install a local WordPress instance (e.g., using Docker or XAMPP).
- Install HT Contact Form 7 plugin version 2.0.0.
- Identify the vulnerable parameter (e.g.,
template).
Exploitation Steps:
- Send a crafted HTTP request to include a sensitive file:
curl "http://target/wp-content/plugins/ht-contactform/includes/class-ht-contactform.php?template=../../../../wp-config" - The response will contain the contents of
wp-config.php, revealing database credentials.
Note: No public exploit code is available; the above is a hypothetical example based on common LFI patterns.
Blue Team (Defensive)
Detection:
- Monitor web server logs for suspicious
../sequences in GET parameters. - Look for requests to plugin files with unexpected parameters.
Mitigation:
- Disable or remove the plugin until a patch is released.
- Implement a Web Application Firewall (WAF) rule to block path traversal patterns.
- Restrict file inclusion via PHP configuration (e.g.,
open_basedir).
Indicators of Compromise (IOCs)
- File Paths:
/wp-content/plugins/ht-contactform/includes/class-ht-contactform.php - URL Patterns:
?template=../../../../etc/passwdor similar path traversal sequences. - Log Entries: HTTP 200 responses to requests containing
../in thetemplateparameter. - Network Traffic: Outbound connections from the server to attacker-controlled IPs (if combined with RFI).
Detection Engineering
YARA Rule
rule CVE_2025_54015_LFI_HT_ContactForm {
meta:
description = "Detects attempts to exploit LFI in HT Contact Form 7 plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-54015"
strings:
$s1 = "ht-contactform" nocase
$s2 = "template=" nocase
$s3 = "../" nocase
condition:
all of ($s1, $s2, $s3)
}
Sigma Rule
title: CVE-2025-54015 - HT Contact Form 7 LFI Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects path traversal attempts in HT Contact Form 7 plugin
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "template=../../"
- "template=..\\..\\"
condition: selection
falsepositives:
- Legitimate use of template parameter with valid paths
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-54015 - HT Contact Form 7 LFI Attempt"; flow:to_server,established; content:"/wp-content/plugins/ht-contactform/"; http_uri; content:"template="; http_uri; content:"../"; http_uri; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Action: Disable or remove the HT Contact Form 7 plugin until a patch is released.
- WAF Rules: Deploy a Web Application Firewall rule to block requests containing
../in thetemplateparameter. - PHP Configuration: Set
open_basedirto restrict file access to the WordPress directory. - Monitoring: Enable detailed logging for web server and monitor for suspicious requests.
- Update: Regularly check the WordPress Plugin Directory for updates to the plugin.
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.