# rtMedia for WordPress, BuddyPress and bbPress <= 4.7.17 - Authenticated (Subscriber+) SQL Injection via 'custom_fields' Parameter

- **ID:** WPSEC-2026-3329
- **Plugin:** rtMedia for WordPress, BuddyPress and bbPress (`buddypress-media`), https://wordpress.org/plugins/buddypress-media/
- **Affected versions:** from 3.7.33 before 4.7.18
- **Fixed in:** 4.7.18 (Update to 4.7.18 or later.)
- **Severity:** Medium 6.5 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N)
- **Weakness:** CWE-89
- **Usage among sites WPSec scans:** plugin Low, affected versions Low (as of 2026-11-18)
- **Attack surface analysis:** https://attacksurface.wpsec.com/plugin/buddypress-media
- **Fix released:** 2026-11-17
- **Published:** 2026-11-18
- **URL:** https://wpsec.com/vuln/WPSEC-2026-3329/

## Description

The rtMedia for WordPress, BuddyPress and bbPress plugin for WordPress is vulnerable to SQL Injection via the 'custom_fields' media upload parameter in all versions from 3.7.33 up to, and including, 4.7.17. The cause is unsafe rewriting of queries in the rtm_filter_metaid_column_name() query filter, which renames the meta_id column for the media meta table. The filter replaced each quoted literal with a '__QUOTE__' placeholder and then put the literals back one at a time at the first placeholder it found. When a meta key supplied by the user contains the text '__QUOTE__', the next literal (the user-supplied meta value) is put inside the key. This undoes the quoting added by the database layer. This makes it possible for authenticated attackers, with subscriber-level access and above, to place their own text outside of quotes and append additional SQL to the media meta INSERT query in order to extract sensitive information from the database.

## References

- https://wpsec.com/vuln/WPSEC-2026-3329/
- https://plugins.svn.wordpress.org/buddypress-media/tags/4.7.18/
- https://wordpress.org/plugins/buddypress-media/

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

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.
