# BuddyPress <= 12.7.4 - Unauthenticated SQL Injection via 'relation' Key of 'xprofile' Members REST API Parameter

- **ID:** WPSEC-2026-4026
- **Plugin:** BuddyPress (`buddypress`), https://wordpress.org/plugins/buddypress/
- **Affected versions:** from 12.0.0 before 12.7.5
- **Fixed in:** 12.7.5 (Update to 12.7.5 or later.)
- **Severity:** High 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N)
- **Weakness:** CWE-89
- **Usage among sites WPSec scans:** plugin Medium, affected versions Low (as of 2026-11-26)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/buddypress
- **Fix released:** 2026-11-25
- **Published:** 2026-11-26
- **URL:** https://wpsec.com/vuln/WPSEC-2026-4026/

## Description

The BuddyPress plugin for WordPress is vulnerable to SQL Injection via the 'relation' key of nested clauses in the 'xprofile' parameter of the members REST API endpoint (/buddypress/v1/members) in versions 12.0.0 up to, and including, 12.7.4, due to insufficient validation of the 'relation' value in BP_XProfile_Query (and the shared BP_Recursive_Query base class). A clause whose 'value' is an empty array was treated as a first-order clause during sanitization, so its 'relation' key was never checked, and once the empty value was removed the clause was processed as a nested query whose raw 'relation' string was concatenated into the SQL WHERE clause. This makes it possible for unauthenticated attackers to append additional SQL to an existing query and extract sensitive information from the database.

## References

- https://wpsec.com/vuln/WPSEC-2026-4026/
- https://plugins.svn.wordpress.org/buddypress/tags/12.7.5/
- https://wordpress.org/plugins/buddypress/

Source: WPSec, https://wpsec.com/vuln/WPSEC-2026-4026/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Free to use, share and adapt, also commercially, if you credit WPSec and link to this advisory.
