# BuddyPress <= 14.5.6 - Unauthenticated SQL Injection via 'relation' Key of the Members REST Endpoint 'xprofile' Parameter

- **ID:** WPSEC-2026-4027
- **Plugin:** BuddyPress (`buddypress`), https://wordpress.org/plugins/buddypress/
- **Affected versions:** from 14.0.0 before 14.5.7
- **Fixed in:** 14.5.7 (Update to 14.5.7 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 Medium (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-4027/

## Description

The BuddyPress plugin for WordPress is vulnerable to SQL Injection via the 'relation' key of the 'xprofile' parameter of the members REST API endpoint (/buddypress/v1/members) in versions 14.0.0 up to, and including, 14.5.6, due to insufficient validation in the BP_XProfile_Query (and BP_Recursive_Query) query sanitizer. A clause with an empty 'value' array stops being a first-order clause once that value is removed, so it is kept without its own 'relation' being validated, and that raw 'relation' string is then used to join the generated WHERE clauses. 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-4027/
- https://plugins.svn.wordpress.org/buddypress/tags/14.5.7/
- https://wordpress.org/plugins/buddypress/

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

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.
