BP Profile Search <= 5.9 - Unauthenticated Local File Inclusion to Remote Code Execution via 'bps_directory' Cookie 'ajax_template' Value
Strategic Overview
- Status
- Patched in 6.0
- Affected Plugin
- BP Profile Search
- Affected Version
<= 5.9- CVSS
- 8.1High
- Weakness type
- CWE-98 · Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
- CVE
CVE-2026-104995
At a glance
CVE-2026-104995 is a high-severity Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in the BP Profile Search WordPress plugin, affecting versions <= 5.9. It carries a CVSS score of 8.1 (reachable over the network; high confidentiality, integrity, availability impact). Exploitation requires no authentication. The issue is fixed in version 6.0; sites on affected versions should update now. Disclosed October 2026, reported by snr.
Vulnerability Overview
The BP Profile Search plugin for WordPress is vulnerable to Local File Inclusion in versions up to, and including, 5.9 via the 'ajax_template' value parsed from the client-controlled 'bps_directory' cookie during BuddyPress AJAX directory requests. The bps_directory_ajax() filter (hooked onto bp_legacy_object_template_path and bp_nouveau_object_template_path) reads the cookie, applies only a referer-derived 'page' comparison in bps_get_directory_data() (where bps_current_page() uses HTTP_REFERER during AJAX and is therefore also attacker-controlled), and then suffixes the attacker-controlled template value with '.php' and passes it to bp_locate_template() with no basename restriction, no whitelist, and no path-traversal check. This makes it possible for unauthenticated attackers to include arbitrary PHP files on the server, which can lead to remote code execution when PHP files can be uploaded or when images such as the default wordpress:php8.
Technical Analysis
The vector marks this flaw as remotely reachable over the network, and no privileges on the target site, and no interaction from a victim user. A successful exploit has high impact on confidentiality, integrity, availability — full site compromise territory.
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
BP Profile Search <= 5.9 carries this weakness at ajax_template, and reaching it takes no account at all. PHP file inclusion means a path used by include or require is built from request data, so the file that gets executed is under the caller's influence.
Including an attacker-influenced file executes its contents, which is why this class is routinely chained with an upload or log-poisoning step to reach code execution. For BP Profile Search the fix is 6.0: builds <= 5.9 are affected, anything from 6.0 onward is not.
Remediation
Update to version 6.0, or a newer patched version
How does WordSec protect against this?
Requests carrying this pattern arrive without a session, so nothing upstream of the firewall gets a chance to reject them: WordSec's web application firewall inspects request payloads before WordPress loads them. Classes like this one can leave something behind, so the staged malware scanner is the second half: it looks for dropped files and modified code rather than for the request that created them. None of that substitutes for the fix: BP Profile Search 6.0 closes this, and updating the plugin is the step that ends it.
- Firewall
- Scanner
- Login Security
External References
Related records
Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C