CVE-2024-0766
Executive Summary
CVE-2024-0766 is a Missing Authorization vulnerability in the Envo's Elementor Templates & Widgets for WooCommerce WordPress plugin, affecting all versions up to and including 1.4.4. The flaw resides in the templates_ajax_request function, which lacks a capability check, allowing authenticated users with subscriber-level privileges or higher to create arbitrary templates. This can lead to unauthorized content injection, defacement, or the introduction of malicious elements into the site's template system.
As a WordPress ecosystem vulnerability, it does not affect the underlying web server (Apache/Nginx) but directly compromises the CMS's access control model. The CVSS score of 4.3 (Medium) reflects the low complexity and network-based attack vector, though the impact is limited to integrity (no confidentiality or availability impact). No public exploit code or proof-of-concept has been released, and the EPSS score is 0.0%, indicating low exploitation likelihood 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 plugin ecosystem. The plugin is distributed via the official WordPress Plugin Directory and third-party marketplaces like Envato. Users should verify the integrity of their plugin files and monitor for updates from the vendor. No package manager (NPM, PyPI, Go, Ruby) is involved.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The vulnerability is exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Attacker needs subscriber-level access.
- User Interaction (UI): None (N) – No user action needed.
- Scope (S): Unchanged (U) – The vulnerable component remains the same.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): Low (L) – Limited ability to modify template data.
- Availability (A): None (N) – No denial-of-service impact.
Threat Level: Medium. While the CVSS score is moderate, the ability for low-privileged users to create templates can be chained with other vulnerabilities (e.g., stored XSS in template content) to escalate impact.
Deep Dive & Mechanics
The vulnerability exists in the templates_ajax_request function, which handles AJAX requests for template creation. The function is registered via wp_ajax_ hooks but does not perform a current_user_can() check to verify the user has the required capability (e.g., edit_posts or manage_options). By default, WordPress AJAX actions are accessible to any authenticated user, so subscribers can trigger the function.
The function likely processes POST data to create or update template posts. Without authorization checks, an attacker can:
- Create new Elementor templates with arbitrary content.
- Modify existing templates if the function also handles updates.
- Inject malicious shortcodes, scripts, or HTML into templates that may be rendered on other pages.
The attack flow:
- Attacker logs in as a subscriber.
- Sends a crafted AJAX request to
/wp-admin/admin-ajax.phpwith actiontemplates_ajax_requestand required parameters. - The plugin creates a new template post without checking capabilities.
- The template is stored and can be used on any page, potentially affecting all site visitors.
Vulnerable vs. Patched Code
Vulnerable Code (<= 1.4.4):
add_action('wp_ajax_templates_ajax_request', 'templates_ajax_request');
function templates_ajax_request() {
// No capability check
$template_id = wp_insert_post(array(
'post_title' => sanitize_text_field($_POST['title']),
'post_type' => 'elementor_library',
'post_status' => 'publish'
));
// ... rest of the function
}
Patched Code (Hypothetical):
add_action('wp_ajax_templates_ajax_request', 'templates_ajax_request');
function templates_ajax_request() {
// Add capability check
if (!current_user_can('edit_posts')) {
wp_die('Unauthorized', 403);
}
$template_id = wp_insert_post(array(
'post_title' => sanitize_text_field($_POST['title']),
'post_type' => 'elementor_library',
'post_status' => 'publish'
));
// ... rest of the function
}
The fix requires adding a current_user_can() check (e.g., edit_posts or manage_options) before processing the request. Since no official patch exists, users must manually apply this change or disable the plugin.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with Envo's Elementor Templates & Widgets for WooCommerce <= 1.4.4.
- Valid subscriber account credentials.
Exploitation Steps:
- Obtain a valid nonce for the AJAX action (if required). The nonce may be exposed in the page source or can be extracted from a legitimate user's session.
- Send a POST request to
/wp-admin/admin-ajax.phpwith the following parameters:action:templates_ajax_requesttitle:Malicious Templatecontent:<script>alert('XSS')</script>(if the function allows HTML)_ajax_nonce:[valid_nonce](if applicable)
Example cURL command:
curl -X POST https://target.com/wp-admin/admin-ajax.php \
-d "action=templates_ajax_request&title=Malicious+Template&content=<script>alert('XSS')</script>&_ajax_nonce=123456" \
-c cookies.txt -b cookies.txt
Expected Outcome: A new template is created with the attacker's content. If the template is used on a page, the injected script executes for visitors.
Blue Team (Defense & Detection)
Detection Steps:
- Monitor AJAX requests to
admin-ajax.phpwith actiontemplates_ajax_requestfrom low-privileged users (subscribers, customers). - Review recently created templates in the Elementor library for suspicious content.
- Check for unexpected template posts with
post_type = 'elementor_library'andpost_authornot matching an administrator.
Honeypot Strategy:
- Create a decoy subscriber account and monitor its AJAX activity.
- Log all
templates_ajax_requestcalls and alert on any template creation.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/envo-elementor-templates-for-woocommerce/includes/templates-ajax.php(or similar) – presence of the vulnerable function. - Database: Rows in
wp_postswithpost_type = 'elementor_library'andpost_authornot matching an admin user. - Logs: Apache/Nginx access logs showing POST requests to
/wp-admin/admin-ajax.phpwithaction=templates_ajax_requestfrom non-admin IPs. - Network: Outbound connections from the server to attacker-controlled domains if the template content includes external resources.
Detection Engineering
YARA Rule
rule CVE_2024_0766_WordPress_Plugin
{
meta:
description = "Detects vulnerable Envo's Elementor Templates plugin code"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-0766"
strings:
$func = "templates_ajax_request"
$hook = "wp_ajax_templates_ajax_request"
$no_check = "current_user_can" nocase
condition:
$func and $hook and not $no_check
}
Sigma Rule
title: CVE-2024-0766 - Unauthorized Template Creation via AJAX
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects AJAX requests to create templates without proper authorization
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=templates_ajax_request'
c-uri|endswith: '/wp-admin/admin-ajax.php'
condition: selection
falsepositives:
- Legitimate admin activity (if admin uses the same AJAX action)
level: medium
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-0766 - Envo Elementor Templates Unauthorized AJAX Request";
flow:to_server,established;
content:"POST"; http_method;
content:"/wp-admin/admin-ajax.php"; http_uri;
content:"action=templates_ajax_request"; http_client_body;
classtype:attempted-admin;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not essential for business operations.
- Manually patch the vulnerable function by adding a capability check (see patched code example).
- Restrict user roles – ensure only trusted users have subscriber-level access or higher.
Long-term Measures:
- Monitor the Envato marketplace for an official update.
- Implement a Web Application Firewall (WAF) rule to block
templates_ajax_requestrequests from non-admin users. - Regularly audit WordPress user roles and capabilities.
- Use a security plugin (e.g., Wordfence) to detect unauthorized AJAX activity.
Workaround:
Add the following code to the theme's functions.php to block the AJAX action for non-admins:
add_action('wp_ajax_templates_ajax_request', function() {
if (!current_user_can('administrator')) {
wp_die('Access denied', 403);
}
}, 1);
Valters IT
Securing Digital Ecosystems
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.