CVE-2025-8151
Executive Summary
CVE-2025-8151 is a Path Traversal vulnerability in the HT Mega – Absolute Addons For Elementor WordPress plugin, affecting all versions up to and including 2.9.1. The flaw resides in the save_block_css function, allowing authenticated attackers with Author-level access or higher to create and delete CSS files in arbitrary directories on a Windows environment. This can lead to unauthorized file manipulation, potentially enabling further attacks such as code injection or denial of service. The CVSS score is 4.3 (Medium), and the EPSS probability is 0.0%, indicating low exploitation likelihood currently. No public proof-of-concept or patch details are 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 affects a WordPress plugin distributed via the official WordPress plugin repository. Users should verify the integrity of their plugin files and monitor for updates from the vendor. No known supply chain compromise has been reported.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
- Base Score: 4.3 (Medium)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (Author-level)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: Low (file creation/deletion)
- Availability Impact: Low (file deletion can cause denial of service)
The threat level is considered Medium due to the requirement for authenticated access and the limited impact on confidentiality. However, the ability to write files to arbitrary directories could be chained with other vulnerabilities for greater effect.
Deep Dive & Mechanics
The vulnerability exists in the save_block_css function of the HT Mega plugin. This function is responsible for saving CSS files generated by Elementor blocks. The flaw arises from insufficient validation of the file path parameter, allowing an attacker to traverse directories using ../ sequences.
Root Cause: The function does not sanitize or restrict the directory path when creating or deleting CSS files. On Windows systems, path traversal sequences are interpreted, enabling attackers to write files outside the intended upload directory.
Attack Flow:
- An authenticated user with Author-level privileges triggers the
save_block_cssfunction. - The attacker manipulates the file path parameter to include
../sequences. - The plugin creates or deletes CSS files in arbitrary directories (e.g.,
wp-content/plugins/,wp-admin/). - This can lead to overwriting legitimate plugin files, creating malicious PHP files (if combined with other vulnerabilities), or deleting critical CSS files causing site defacement.
Windows Specificity: The vulnerability is explicitly noted for Windows environments due to differences in path handling. Linux systems may not be affected because of stricter path resolution.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is analyzed based on the plugin's source. The save_block_css function likely contains:
// Vulnerable code (hypothetical)
function save_block_css($post_id, $css_content) {
$upload_dir = wp_upload_dir();
$file_path = $upload_dir['basedir'] . '/ht-mega-css/' . $post_id . '.css';
// No path sanitization
file_put_contents($file_path, $css_content);
}
A patched version would include:
// Patched code (hypothetical)
function save_block_css($post_id, $css_content) {
$upload_dir = wp_upload_dir();
$safe_post_id = basename($post_id); // Remove path traversal
$file_path = $upload_dir['basedir'] . '/ht-mega-css/' . $safe_post_id . '.css';
// Validate path is within allowed directory
if (strpos(realpath($file_path), realpath($upload_dir['basedir'])) !== 0) {
return false;
}
file_put_contents($file_path, $css_content);
}
Exploitation & Lab Setup
Red Team (Attacker)
Prerequisites:
- WordPress instance with HT Mega plugin <= 2.9.1
- Author-level account credentials
- Windows server environment
Exploitation Steps:
- Log in as an Author.
- Craft a request to the vulnerable endpoint (e.g., via Elementor editor AJAX).
- Manipulate the
post_idparameter to include path traversal:POST /wp-admin/admin-ajax.php action=ht_mega_save_block_css post_id=../../../wp-content/plugins/evil.css css_content=/* malicious CSS */ - The file
evil.cssis created in the plugins directory. - For deletion, use a similar request with a delete action.
Note: No public exploit code is available. This is a conceptual demonstration.
Blue Team (Defender)
Detection:
- Monitor for unusual file creation/deletion in
wp-content/directories. - Look for AJAX requests with path traversal patterns in parameters.
- Check for Author-level accounts performing administrative-like actions.
Hunting:
- Search for files with
.cssextension in unexpected directories. - Review logs for
ht_mega_save_block_cssaction with suspiciouspost_idvalues.
Indicators of Compromise (IOCs)
- File Paths: Unexpected CSS files in directories like
wp-content/plugins/,wp-admin/,wp-includes/ - Log Entries: AJAX requests containing
../inpost_idparameter - Network: POST requests to
/wp-admin/admin-ajax.phpwithaction=ht_mega_save_block_css - File Hashes: Unknown CSS files with unusual names (e.g.,
evil.css,backdoor.css)
Detection Engineering
YARA Rule
rule CVE_2025_8151_HT_Mega_Path_Traversal {
meta:
description = "Detects path traversal attempts in HT Mega plugin"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-8151"
strings:
$traversal = /\.\.\/[a-zA-Z0-9_\/]+\.css/
$action = "ht_mega_save_block_css"
condition:
$action and $traversal
}
Sigma Rule
title: CVE-2025-8151 HT Mega Path Traversal
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects path traversal attempts in HT Mega plugin
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=ht_mega_save_block_css'
cs-uri-query|re: '\.\.\/[a-zA-Z0-9_\/]+\.css'
condition: selection
falsepositives:
- Legitimate use of relative paths (unlikely)
level: high
Suricata Rule
alert http any any -> any any (
msg:"CVE-2025-8151 HT Mega Path Traversal Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=ht_mega_save_block_css"; http_client_body;
pcre:"/\.\.\/[a-zA-Z0-9_\/]+\.css/Ri";
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until a patch is released.
- Restrict Author-level permissions to prevent access to the vulnerable function.
- Implement a Web Application Firewall (WAF) rule to block path traversal patterns.
Long-term Fix:
- Apply vendor patch when available (monitor plugin updates).
- Upgrade to version 2.9.2 or later once released.
- Conduct a security audit of the plugin's file handling functions.
Workaround:
- Modify the plugin code to sanitize file paths using
basename()andrealpath(). - Use a security plugin to monitor file changes in critical directories.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert
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.