# CVE-2021-21389: BuddyPress privilege escalation via REST API

> A regular user can gain administrator rights by exploiting the REST API members endpoint in the BuddyPress WordPress plugin.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Mar 2021
- **Updated:** 3 Aug 2024
- **Also known as:** GHSA-m6j4-8r7p-wpp3

## What is CVE-2021-21389?

CVE-2021-21389 is a high-severity vulnerability in BuddyPress, published on 26 Mar 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

BuddyPress is an open source WordPress plugin to build a community site. In releases of BuddyPress from 5.0.0 before 7.2.1 it's possible for a non-privileged, regular user to obtain administrator rights by exploiting an issue in the REST API members endpoint. The vulnerability has been fixed in BuddyPress 7.2.1. Existing installations of the plugin should be updated to this version to mitigate the issue.

Weakness: CWE-863 (Incorrect Authorization)

## Which versions are affected by CVE-2021-21389?

2 open source packages ship an affected version, including buddypress/buddypress. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `buddypress/buddypress` | Packagist | From 5.0.0 | 7.2.1 |
| `buddypress/buddypress` | Packagist | From 5.0.0 | 7.2.1 |

Products: Buddypress Buddypress.

## How do I fix CVE-2021-21389?

Upgrade buddypress/buddypress to 7.2.1 or later.

## Is CVE-2021-21389 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-21389 exists.

Public exploit code:

- BuddyPress is an open source WordPress plugin to build a community site. In releases of BuddyPress from 5.0.0 before 7.2.1 it's possible for a non-privileged, regular user to obtain administrator rights by exploiting an issue in the REST API members endpoint. The vulnerability has been fixed in BuddyPress 7.2.1. Existing installations of the plugin should be updated to this version to mitigate the issue. (github_poc): https://github.com/HoangKien1020/CVE-2021-21389
- 경희대 졸업프로젝트 (github_poc): https://github.com/mynameSumin/CVE-2021-21389
- BuddyPress REST API  <7.2.1 - Privilege Escalation/Remote Code Execution (nuclei): http/cves/2021/CVE-2021-21389.yaml

## Other vulnerabilities in BuddyPress

- [CVE-2024-10011](https://insights.sbomify.com/CVE-2024-10011/): BuddyPress <= 14.1.0 - Authenticated (Subscriber+) Directory Traversal (high 8.1)
- [CVE-2020-5244](https://insights.sbomify.com/CVE-2020-5244/): Private data exposure via REST API in BuddyPress (high 8.0)
- [CVE-2012-2109](https://insights.sbomify.com/CVE-2012-2109/): SQL injection in n/a (high 7.5)
- [CVE-2025-23798](https://insights.sbomify.com/CVE-2025-23798/): WordPress Mass Messaging in BuddyPress Plugin <= 2.2.1 - Reflected Cross Site Scripting (XSS) vulnerability (high 7.1)
- [CVE-2023-50880](https://insights.sbomify.com/CVE-2023-50880/): WordPress BuddyPress Plugin <= 11.3.1 is vulnerable to Cross Site Scripting (XSS) (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-21389 and fix it if it is affected.

What it is: CVE-2021-21389 is a high-severity vulnerability in BuddyPress, published on 26 Mar 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-21389 exists.

Affected packages and fixed versions:
- buddypress/buddypress (Packagist): affected from 5.0.0; fixed in 7.2.1
- buddypress/buddypress (Packagist): affected from 5.0.0; fixed in 7.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-21389/ (Markdown: https://insights.sbomify.com/CVE-2021-21389/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-21389
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-21389
- OSV: https://osv.dev/vulnerability/CVE-2021-21389

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-21389/
Summaries are generated and may contain mistakes; the official description above is the record.
