Skip to main content

CVE-2024-7850: BP Profile Search WordPress Plugin CSRF Flaw

CVE-2024-7850 is a Cross-Site Request Forgery vulnerability in the BP Profile Search WordPress plugin affecting versions up to 5.7.5. Attackers can exploit this flaw to inject malicious scripts by tricking administrators. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-7850 Overview

The BP Profile Search plugin for WordPress contains a Cross-Site Request Forgery (CSRF) vulnerability affecting all versions up to and including 5.7.5. The flaw stems from missing or incorrect nonce validation in the bps_ajax_field_selector(), bps_ajax_template_options(), and bps_ajax_field_row() functions. Unauthenticated attackers can inject malicious web scripts through forged requests if they trick a site administrator into clicking a crafted link. The issue is tracked under CWE-352 and was published to the National Vulnerability Database on August 20, 2024.

Critical Impact

Successful exploitation allows unauthenticated attackers to inject malicious scripts into WordPress administrative contexts via social engineering, enabling script execution with administrator privileges.

Affected Products

  • BP Profile Search plugin for WordPress — all versions up to and including 5.7.5
  • Fixed in BP Profile Search version 5.8
  • WordPress sites running BuddyPress with the affected plugin installed

Discovery Timeline

  • 2024-08-20 - CVE-2024-7850 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-7850

Vulnerability Analysis

The vulnerability is a Cross-Site Request Forgery issue in the BP Profile Search plugin's AJAX handlers. The affected handlers process administrator-side configuration requests but fail to verify a valid WordPress nonce before executing their logic. Because the handlers accept attacker-controlled input and reflect it into administrative responses, the CSRF primitive chains into script injection in the administrator's browser context.

The three vulnerable functions reside in bps-admin.php: bps_ajax_field_selector(), bps_ajax_template_options(), and bps_ajax_field_row(). An attacker crafts a web page or email containing a request that targets one of these endpoints. If a logged-in administrator visits the attacker-controlled resource, the browser automatically submits authenticated requests to the WordPress site. The server processes the request as legitimate because session cookies are present and no nonce check rejects the forgery.

Root Cause

The root cause is the absence of check_ajax_referer() or equivalent nonce validation in the three AJAX handlers. WordPress provides a standard CSRF mitigation pattern through nonces, but the plugin's administrative AJAX endpoints did not call it before performing privileged actions. See the pre-patch handler in bps-admin.php and the corrective change in changeset 3136686.

Attack Vector

The attack requires network access to the target WordPress site and user interaction from an authenticated administrator. The attacker hosts a page that issues a forged request to the vulnerable AJAX endpoint. When the administrator loads the page, the browser submits the request with session credentials attached. The response renders attacker-controlled script content in the administrative context. See the Wordfence Vulnerability Report for additional analysis. No proof-of-concept exploitation code is published in the referenced advisories.

Detection Methods for CVE-2024-7850

Indicators of Compromise

  • Unexpected administrative AJAX requests to admin-ajax.php with action parameters bps_ajax_field_selector, bps_ajax_template_options, or bps_ajax_field_row originating from external referrers.
  • Administrator session activity initiated shortly after the user visited an untrusted external link or email.
  • New or modified BP Profile Search configuration entries that administrators do not recall creating.

Detection Strategies

  • Inspect web server access logs for POST requests to admin-ajax.php with the three affected action values and a Referer header pointing outside the site's own domain.
  • Correlate WordPress audit logs with browser history or email gateway logs to identify administrators redirected from external resources immediately before configuration changes.
  • Scan installed plugin inventories for BP Profile Search versions at or below 5.7.5.

Monitoring Recommendations

  • Enable a WordPress audit logging plugin to record administrative configuration changes and AJAX actions.
  • Alert on unusual spikes in admin-ajax.php traffic tied to the BP Profile Search action names.
  • Monitor for the introduction of unexpected script tags or template options within BP Profile Search settings.

How to Mitigate CVE-2024-7850

Immediate Actions Required

  • Upgrade the BP Profile Search plugin to version 5.8 or later, which adds nonce validation to the affected AJAX handlers.
  • Audit administrator accounts for recent configuration changes to BP Profile Search since the plugin was installed or last updated.
  • Instruct site administrators to log out of WordPress before browsing untrusted links or email content.

Patch Information

The vendor remediated the issue in version 5.8 by adding nonce verification to the three AJAX handlers. Review the fix in WordPress changeset 3136686 and the final tagged release in changeset 3137271. Administrators should apply the update through the WordPress plugin management interface.

Workarounds

  • Deactivate the BP Profile Search plugin until the site can be upgraded to version 5.8 or later.
  • Restrict administrative access to the WordPress dashboard using IP allow-listing at the web server or WAF layer.
  • Configure a Web Application Firewall rule to block requests to admin-ajax.php targeting the three affected action parameters when the Referer does not match the site origin.
bash
# Example WAF rule concept - block cross-origin admin-ajax requests
# targeting the vulnerable BP Profile Search actions
SecRule REQUEST_URI "@endsWith /wp-admin/admin-ajax.php" \
  "chain,deny,status:403,id:1007850"
  SecRule ARGS:action "@rx ^(bps_ajax_field_selector|bps_ajax_template_options|bps_ajax_field_row)$" \
    "chain"
    SecRule REQUEST_HEADERS:Referer "!@beginsWith https://your-site.example"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.