Skip to content
Access control Disclosed report Intermediate

Broken access control: any member can self-assign arbitrary BuddyPress member types via the ungated "types" REST parameter, bypassing the bp_moderate

The BuddyPress Members REST endpoint only checks the 'member_type' parameter for the bp_moderate capability, but a legacy alias 'types' is processed after the permission check and writes the member type. Any authenticated low-privilege user can self-assign any registered member type, bypassing the intended authorization.

jakubk Follow

Originally disclosed on HackerOne

Medium 6.4 View original
  • Triaged in 14 days
  • Fixed in 3 months
  • Paid in 50 days
  • Disclosed after 4 months

The BuddyPress Members REST endpoint (PUT /wp-json/buddypress/v1/members/{id}) is intended to forbid a non-moderator from changing their own member type: update_item_permissions_check() blocks the edit unless the caller has the bp_moderate capability.

That gate only inspects the "member_type" request parameter. However, prepare_item_for_database() — which runs AFTER the permission check has already passed — also honors a legacy alias parameter named "types": it reads "types", converts it into "member_type", and writes it via bp_set_member_type().

As a result, any authenticated low-privilege user (e.g. a subscriber) can self-assign ANY registered member type by sending "types=" instead of "member_type=", completely bypassing the bp_moderate authorization check the code explicitly enforces for this operation.

Affected file: bp-members/classes/class-bp-rest-members-endpoint.php (BuddyPress 14.5.0)

Permission gate (only checks "member_type"): line 352: $member_type_edit = ! empty( $request->get_param( 'member_type' ) ); line 370: if ( $member_type_edit && ! bp_current_user_can( 'bp_moderate' ) ) { $retval = $error; }

Ungated alias written after the check passes: line 796: $types = $request->get_param( 'types' ); line 798: $request->set_param( 'member_type', bp_rest_sanitize_member_types( $types ) ); line 807: bp_set_member_type( $prepared_user->ID, $request->get_param( 'member_type' ), $append );

Setup:

  1. A WordPress site with BuddyPress 14.5.0, Members component + REST API enabled.
  2. At least one registered member type. If the test site has none, register one, e.g. an mu-plugin: add_action('bp_register_member_types', function(){ bp_register_member_type('vip', array('labels'=>array('name'=>'VIP'))); });
  3. A plain subscriber account (here: user "mallory", id 2), authenticated to the REST API (Application Password or cookie + X-WP-Nonce). No moderator/admin capability.

Control — confirm the intended gate works (direct member_type is blocked): 4. Send: PUT /wp-json/buddypress/v1/members/2 Content-Type: application/x-www-form-urlencoded Body: member_type=vip Response: HTTP 403 {"code":"bp_rest_authorization_required","message":"Sorry, you are not allowed to perform this action."}

Exploit — the alias bypasses the gate: 5. Send the same request using the "types" alias instead: PUT /wp-json/buddypress/v1/members/2 Content-Type: application/x-www-form-urlencoded Body: types=vip Response: HTTP 200, body contains "member_types":["vip"]

Server-side confirmation (fresh process, not the response echo): 6. wp eval 'var_export(bp_get_member_type(2, false));' -> array( 0 => 'vip', ) The WordPress role is unchanged (subscriber); this is a member-type escalation.

curl equivalents (Application Password auth):

blocked

curl -u mallory:APPPASS -X PUT https://SITE/wp-json/buddypress/v1/members/2 --data "member_type=vip"

bypass

curl -u mallory:APPPASS -X PUT https://SITE/wp-json/buddypress/v1/members/2 --data "types=vip"

Impact

The code deliberately restricts member-type self-assignment to users holding bp_moderate. That control is fully bypassed by any single authenticated low-privilege account acting on its own profile. Member types in BuddyPress and third-party plugins commonly gate member-directory filtering, profile/content visibility, and access tiers (e.g. "vip", "staff", "verified"). An attacker can therefore grant themselves any registered member type and gain whatever access that type confers on a given installation — an authorization-bypass of an explicit privilege check, with a universal precondition (one low-privilege user).

The original report as published on HackerOne, by jakubk. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The permission check only inspects the 'member_type' parameter, while a legacy alias 'types' is processed later in prepare_item_for_database() and written without re-checking authorization.

Impact

Any authenticated low-privilege user can grant themselves any registered member type, potentially gaining access or visibility that the type confers, bypassing an explicit privilege check.

What the attacker needed

BuddyPress 14.5.0 with Members component and REST API; At least one registered member type; A low-privilege authenticated account

How it was found

  1. Set up a WordPress site with BuddyPress 14.5.0, Members component and REST API enabled.
  2. Ensure at least one registered member type exists (register one if needed).
  3. Authenticate as a plain subscriber account to the REST API.
  4. Send a PUT request to the members endpoint with 'member_type=vip' and observe HTTP 403.
  5. Send the same request using 'types=vip' instead and observe HTTP 200 with member_types containing 'vip'.
  6. Confirm server-side that the member type was set using a WP-CLI command.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A website feature lets moderators give users special labels (member types) that can control what they see or do. The code checks permission only when the request uses one parameter name, but it also accepts an older alias name and applies that without checking. So a normal user can give themselves any label, like 'vip', even though they should not be allowed to.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by jakubk

View all

6 more disclosed reports, best first.

More from WordPress

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.