CVE-2026-104995 in BP Profile Search Plugininfo

Summary

by MITRE • 10/15/2026

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.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 10/15/2026

The BP Profile Search plugin for WordPress contains a critical Local File Inclusion vulnerability in versions up to and including 5.9. This flaw is triggered during BuddyPress AJAX directory requests through the manipulation of the client-controlled bps_directory cookie, specifically via its ajax_template value. The vulnerability stems from how the plugin handles template path resolution when integrating with BuddyPress themes such as legacy or nouveau templates. When a user interacts with the site, the plugin hooks into bp_legacy_object_template_path and bp_nouveau_object_template_path filters to determine which PHP file should be loaded for rendering specific directory views. Instead of validating the requested template against a strict whitelist or ensuring it resides within an expected application directory, the code directly incorporates attacker-supplied input from the cookie without sufficient sanitization.

The technical mechanism behind this vulnerability involves several layers of insufficient validation. The bps_directory_ajax function reads the value from the bps_directory cookie and passes it to bps_get_directory_data for processing. Within this process, the plugin attempts to verify the request's legitimacy by comparing a page identifier derived from the HTTP_REFERER header against expected values using the bps_current_page helper function. However, because AJAX requests often do not include standard referer headers or allow them to be spoofed easily in many browser configurations and attack scenarios, an attacker can control this value as well. Consequently, the security check is effectively bypassed. The plugin then appends .php to the user-supplied template string and passes it directly to bp_locate_template without performing any basename restrictions or path-traversal checks such as verifying that the resulting file path does not contain directory traversal sequences like ../.

This lack of input validation allows unauthenticated attackers to include arbitrary PHP files located on the server's filesystem. By carefully crafting the bps_directory cookie value, an attacker can specify paths to sensitive configuration files, core WordPress files, or other plugins installed on the system. The operational impact is severe because Local File Inclusion serves as a direct pathway to Remote Code Execution if there are any writable directories where attackers can upload malicious PHP scripts. Even without file uploads, including core WordPress files like wp-config.php can lead to information disclosure of database credentials and site keys, which facilitates further compromise of the entire web application infrastructure.

From a classification perspective, this vulnerability aligns with CWE-98 Improper Control of Filename for Include/Require Statement in PHP Program within the Common Weakness Enumeration framework. It also maps to ATT&CK technique T1059 Command and Scripting Interpreter if used for execution or T1003 Offline Data from Local System during information gathering phases following successful inclusion. The root cause lies in the failure to implement a strict allowlist approach for template selection, relying instead on opaque referer checks that are easily circumvented in AJAX-driven environments common in modern WordPress deployments utilizing BuddyPress extensions.

Mitigation strategies must prioritize immediate patching of the BP Profile Search plugin to version 6.0 or later where this issue has been addressed by developers through stricter input validation and path canonicalization. In the interim, administrators should restrict access to wp-content/uploads and other writable directories via web server configuration rules such as .htaccess deny directives for PHP execution in upload folders. Additionally, implementing Web Application Firewalls with specific rule sets targeting cookie manipulation and local file inclusion patterns can provide a layer of defense against exploitation attempts while updates are being applied across the infrastructure.

Responsible

Wordfence

Reservation

10/02/2026

Disclosure

10/15/2026

Moderation

accepted

EPSS

0.00853

KEV

no

Activities

low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!