# BuddyPress <= 11.6.4 - Unauthenticated SQL Injection via 'xprofile' Parameter

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

## 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 in versions 10.0.0 up to, and including, 11.6.4. This is due to insufficient validation of the 'relation' value in BP_XProfile_Query. A clause whose 'value' is an empty array has that value removed during sanitization. The clause is then treated as a nested query, but its own 'relation' is never checked, and get_sql_for_query() concatenates that raw relation into the WHERE clause of the member query. This makes it possible for unauthenticated attackers to append additional SQL queries to existing queries, which can be used to extract sensitive information from the database.

## References

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

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

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.
