-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The function's name is the question. Its body is not the answer.\n\nThe plugin is User Registration & Membership for WordPress, sixty thousand active installs and 4.2 million lifetime downloads, maintained by wpeverest. The vulnerable function lives in `includes/class-ur-user-approval.php`. The implementation in version 5.1.5 is one expression:\n\n```php\nprotected function is_admin_creation_process() {\n return ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n}\n```\n\nTwo callers consume the return value as a context flag. `set_user_status()` reads it to decide whether a newly registered user goes to APPROVED or PENDING:\n\n```php\nif ( 'admin_approval' === ur_get_user_login_option( $user_id ) ) {\n $status = UR_Admin_User_Manager::PENDING;\n if ( $this->is_admin_creation_process() ) {\n $status = UR_Admin_User_Manager::APPROVED;\n }\n ...\n}\n```\n\n`send_request_notification_to_admin()` reads it to decide whether to email the site administrator about the registration. When the function returns true, the user is auto-approved and the admin notification is suppressed.\n\nThe role of the function is narrow and specific. It needs to answer one question: was this user created by an administrator through the `wp-admin/user-new.php` backend form? In that legitimate path, WordPress core has already authenticated the admin via cookies, capability checks, and a nonce against the `create-user` action; the plugin hooks in late and needs to know whether to defer to the upstream gate. The check the plugin uses to distinguish admin-flow from frontend-registration-flow is a string equality against a URL parameter.\n\n`$_REQUEST` in PHP is the union of `$_GET`, `$_POST`, and `$_COOKIE`. Anything a client puts on the URL or in the body becomes `$_REQUEST['action']`. The string `createuser` appears there when `wp-admin/user-new.php` POSTs a form containing ``. It also appears there when an attacker appends `?action=createuser` to a registration form submission. The plugin cannot tell those two senders apart, because the bytes are identical.\n\n## The exploit body\n\nThe PoC published by Anthony Cihan (Offensive Security Lead, Obviam, the researcher credited by Wordfence's coordinated disclosure) walks a three-step chain. Two of the three steps work around AJAX-layer nonce checks the plugin layers on top. The third is CVE-2026-6145.\n\nStep one harvests a nonce from an unauthenticated AJAX endpoint. `wp_ajax_nopriv_user_registration_get_recent_nonce` is gated only by a `Referer` header that the client controls:\n\n```\nPOST /wp-admin/admin-ajax.php HTTP/1.1\nReferer: https://target/\n\naction=user_registration_get_recent_nonce&form_ids=7&nonce_for=registration\n```\n\n```json\n{\"success\":true,\"data\":{\"7\":\"a1b2c3d4e5\"}}\n```\n\nStep two submits the registration with `ur_fallback_submit=1`, which routes the request through the non-AJAX form handler. That handler does not re-verify the AJAX nonce. Step three is the CVE: the registration POST's URL carries `?action=createuser`.\n\n```\nPOST /?action=createuser HTTP/1.1\nReferer: https://target/\n\nur_fallback_submit=1&\nform_id=7&\nur_frontend_form_nonce=a1b2c3d4e5&\nform_data=[{\"field_name\":\"user_login\",\"value\":\"attacker\",...},\n {\"field_name\":\"user_email\",\"value\":\"x@y.lab\",...},\n {\"field_name\":\"user_pass\",\"value\":\"P@ss!\",...},\n {\"field_name\":\"user_confirm_password\",\"value\":\"P@ss!\",...}]\n```\n\nWhen `set_user_status()` fires on the `user_registration_after_register_user_action` hook, `is_admin_creation_process()` returns true because `$_REQUEST['action'] === 'createuser'`. The new user's status writes as APPROVED instead of PENDING. When `send_request_notification_to_admin()` fires on the `user_register` hook, the same function returns true a second time and the admin notification is dropped. The site's approval queue does not learn that a new account exists.\n\nOn a site whose only gate against unwanted registrations is the admin approval workflow, the gate is now decorative.\n\n## The comment names the rule that would have caught this\n\nWordPress's coding standards ship a ruleset for the PHP_CodeSniffer static analyzer. One of those rules is `WordPress.Security.NonceVerification.Recommended`. The rule fires when code reads `$_REQUEST`, `$_POST`, or `$_GET` in a context where a state-changing action might follow. The fix the rule recommends is a call to `wp_verify_nonce()` or `check_admin_referer()` against the relevant action before the read.\n\nThe vulnerable line is annotated with the directive that suppresses that rule:\n\n```php\nreturn ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n```\n\n`phpcs:ignore` is the comment form that tells the analyzer to skip the line. The argument names the rule being suppressed. The author of the suppression read the analyzer's warning, understood that the analyzer was asking them to verify a nonce, and replaced the warning with a comment that named exactly the check the function would have needed.\n\nThe annotation does not appear in the function before version 3.3.0, released 1 August 2024. Before that, the function ran with the same body and no comment; the analyzer would have flagged it on every commit. From 3.3.0 onward the analyzer stops flagging it and the body stays the same. The line that read `$_REQUEST` without a nonce check became the line that read `$_REQUEST` without a nonce check and asked the analyzer to please stop saying so.\n\nThe function itself dates to 31 August 2017, in version 1.0.4. For seven of the function's nine years on disk it ran with no annotation and no check. For the last twenty-one months it ran with the annotation and no check.\n\nThis is [todo-that-shipped](/patterns/todo-that-shipped) in its suppression-directive variant. The canonical form has a comment naming the missing control (`// TODO: verify path is under the base directory`, or a commented-out `check_ajax_referer` line that two characters of slash would re-enable). Here the comment is a `phpcs:ignore` directive that names the rule the developer read and silenced. The named control was never written. The comment is the named control's only manifestation in the source tree.\n\n## The patch\n\nThe 5.1.6 diff for this function, from `tags/5.1.5/includes/class-ur-user-approval.php` to `tags/5.1.6/includes/class-ur-user-approval.php`:\n\n```diff\n protected function is_admin_creation_process() {\n- return ( isset( $_REQUEST['action'] ) && 'createuser' == $_REQUEST['action'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n+ return (\n+ is_admin() &&\n+ current_user_can( 'create_users' ) &&\n+ isset( $_REQUEST['action'] ) && // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n+ 'createuser' === $_REQUEST['action'] // phpcs:ignore WordPress.Security.NonceVerification.Recommended\n+ );\n }\n```\n\nThe patch adds two function calls and tightens the equality from `==` to `===`. `is_admin()` returns true only when the current request is being processed inside the `wp-admin/` directory hierarchy; the constant is set by `wp-admin/admin.php` and friends, not by anything an attacker can reach via `index.php` rewrites. `current_user_can('create_users')` returns true only when the request is bound to an authenticated user holding the `create_users` capability. Together those two calls answer the question the function's name asks. Without them the function answered no question at all.\n\nThe `phpcs:ignore` directive is preserved. The patch splits the original one-line return across four lines and re-attaches the directive to two of the new lines. The analyzer is still being instructed to skip its nonce check on the `$_REQUEST` reads. The surrounding `is_admin()` and `current_user_can()` calls answer the analyzer's underlying concern by making the read happen only inside an already-authenticated admin context, so the suppression is less wrong than it was. The annotation is still on a function that does not verify a nonce.\n\nThe `includes/` directory carries 140 `phpcs:ignore WordPress.Security.NonceVerification` annotations in 5.1.5. It carries 141 in 5.1.6. The patch's net change to the count is plus one.\n\n## This is internal-only-by-convention\n\nThe shape at the boundary is [internal-only-by-convention](/patterns/internal-only-by-convention), the same shape as Next.js's `x-middleware-subrequest` header in [CVE-2025-29927](/posts/next-middleware-cve-2025-29927-recursion-guard-was-the-bypass) and ActiveMQ's `vm://` transport scheme in [CVE-2026-34197](/posts/activemq-jmx-denied-schemes-was-one). WordPress core's `wp-admin/user-new.php` form is one page in one directory. When an admin submits that form, the request body contains `action=createuser` because the form contains the hidden field that puts it there. The convention exists so wp-admin's own dispatch logic can route to the create-user handler. The convention does not make the parameter internal-only; the parameter rides on a normal HTTP form submission and any client can include it on any URL.\n\nThe plugin read the convention as enforcement. `is_admin_creation_process()` treated the presence of `action=createuser` in `$_REQUEST` as proof that the request was made by `wp-admin/user-new.php`. The proof was a string. The string costs nothing to send. Every other check WordPress provides for the same purpose, `is_admin()`, `current_user_can()`, `check_admin_referer()`, was available and unused for nine years.\n\n## Five CVEs in this plugin in five months\n\nThe PoC's README links four other CVEs against the same plugin from the same calendar year:\n\n| CVE | Versions affected | Class |\n|-----|-------------------|-------|\n| CVE-2026-1492 | up to 5.1.2 | Unauthenticated privilege escalation |\n| CVE-2026-1779 | up to 5.1.2 | Authentication bypass via `register_member` |\n| CVE-2026-4056 | 5.0.1 through 5.1.4 | Broken access control on REST API |\n| CVE-2026-6203 | up to 5.1.4 | Unauthenticated open redirect |\n| CVE-2026-6145 | up to 5.1.5 | Admin approval bypass (this post) |\n\nFive CVEs, all authorization-related, in versions released within a five-month window. The codebase shape that produces them is visible in the directory listing: 140 `phpcs:ignore WordPress.Security.NonceVerification.Recommended` annotations across the `includes/` tree. Each annotation is a line where the analyzer told a developer to verify a nonce and the developer replied that the analyzer should stop telling them so. Not all 140 will turn into CVEs. Some are reads of admin-only screens where the surrounding context already gates the call; some are reads that lead to no state change. Others are at user-controlled boundaries and were suppressed for the same reason this one was: because writing the check was less expedient than annotating past it.\n\nThis is the [design-debt-driver](/patterns/design-debt-driver) signature in the strict sense. The substrate is the codebase's relationship with PHPCS's nonce-verification rule. The rule fires; the rule is suppressed; the suppression survives review; the unguarded read sits in the file; eventually one of the suppressions is on a function whose name asserts a security property. The bug class repeats because the practice repeats.\n\n## Disclosure timeline\n\nThe PoC's timeline puts the original discovery on 9 March 2026, during an authorized audit of version 5.1.4. Wordfence (the CNA) reserved CVE-2026-6145 on 12 April. The patched 5.1.6 went to the WordPress.org plugin directory on 27 April; the CVE record and public PoC dropped on 14 May. The window from patched-version-published to PoC-published is seventeen days, the standard Wordfence coordinated-disclosure cadence.\n\nWhat the timeline does not say: the function `is_admin_creation_process()` has been in the file since 31 August 2017. The PHPCS suppression was added on 1 August 2024. The first researcher to look at this function during an authorized audit was the one credited on the CVE.\n\n## What this looks like to a defender\n\nIf you run WordPress with User Registration & Membership 5.1.5 or earlier, and you have configured admin approval as a security control, the queue has not been a security control. Anyone who could find your registration form's `data-form-id` attribute, visible in any rendered registration page, could create an APPROVED account without your knowledge. `Users → All Users` in `wp-admin` records the account; the admin notification mailbox does not. The compromise window for any specific site begins whenever its operator first enabled admin approval.\n\nUpgrade to 5.1.6. Then audit `Users → All Users` for accounts in APPROVED status with no corresponding admin notification email in the mailbox. Bypass-created accounts are visible as a triangulation across those two sources; legitimate admin-approval flow always emits the email.\n\nThe 5.1.6 patch closes the function. It does not close the 140 other places the codebase reads `$_REQUEST` after telling PHPCS to be quiet about it. Most of those will be fine. The next one that is not fine is the next CVE.\n\nPoC: [Hann1bl3L3ct3r/CVE-2026-6145](https://github.com/Hann1bl3L3ct3r/CVE-2026-6145)","closing_line":"The annotation names the rule the analyzer was firing. The patch keeps the annotation.","hook_md":"The plugin's `is_admin_creation_process()` returns true when `$_REQUEST['action']` equals the string `createuser`. The line of code that performs that check ends with a comment instructing PHP_CodeSniffer to ignore the rule `WordPress.Security.NonceVerification.Recommended`. The rule fires on any read of `$_REQUEST` that is not preceded by a nonce check. The author of the suppression read the analyzer's warning, named the rule the analyzer was firing, and shipped the read with no nonce check. The function has been in the plugin since 31 August 2017. The PHPCS suppression has been there since 1 August 2024. The patch ships on 27 April 2026. The patch keeps the suppression.","post_id":306,"slug":"user-registration-is-admin-creation-process-was-a-string","title":"CVE-2026-6145: User Registration's is_admin_creation_process() Was a String Comparison. The Annotation Above It Named the Missing Check.","type":"initial","unreadable_sentence":"The author of the suppression read the analyzer's warning, understood that the analyzer was asking them to verify a nonce, and replaced the warning with a comment that named exactly the check the function would have needed."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCag4cMQAKCRDeZjl4jgkQ JpkiAP9yDSjxFwyN/JXuB8Jzvc5RJt56PvuCbDZ4JqyxLVvrBAEAwIQLEB2SpCBv paELEJlNNoUI6YVxIGibqn8DCe8zEQQ= =NNzn -----END PGP SIGNATURE-----