Detect Restrictions for BuddyPress <= 1.5.4 Remote Code Execution (CVE-2026-120539) in Elastic Security
Detects exploitation of CVE-2026-120539, a critical (CVSS 9.8) Remote Code Execution vulnerability in the Restrictions for BuddyPress WordPress plugin (all versions up to and including 1.5.4). The flaw is a code injection issue (CWE-95): the plugin splices the attacker-controlled request URI into a PHP expression inside a double-quoted string and evaluates it with eval(). Because PHP interpolates double-quoted strings, a payload of the form {${...}} in the URL path runs during interpolation, so no quote breakout is needed. The affected conditions are enabled by default and are evaluated before any logged-in check, so an unauthenticated attacker can execute arbitrary PHP with a single GET request. The site must have BuddyPress and Paid Memberships Pro active alongside this plugin. Detection focuses on HTTP requests to the plugin's endpoints carrying PHP code constructs, and on post-exploitation web-shell or child-process behavior spawned from the WordPress PHP worker. Fixed in version 1.5.5.
MITRE ATT&CK
- Tactic
- Initial Access Execution
Elastic Detection Query
// df00tech DF00-f20ad46a84 · https://df00tech.com/detections/CVE-2026-120539 · licence: https://df00tech.com/detections/licence
any where event.category == "web" and
stringContains(url.path, "/wp-admin/") and
(stringContains(url.query, "bp-restrict") or stringContains(url.query, "bp_restrict")) and
(stringContains(url.query, "eval(") or stringContains(url.query, "base64_decode") or
stringContains(url.query, "shell_exec") or stringContains(url.query, "system(") or
stringContains(url.query, "create_function") or stringContains(url.query, "<?php") or
stringContains(url.query, "assert(")) Matches web events targeting wp-admin bp-restrict endpoints carrying PHP code-execution tokens in the query string, indicating CVE-2026-120539 exploitation attempts.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate admin configuration containing code-like text
- Web vulnerability scanners
- Authorized penetration testing traffic
Other platforms for CVE-2026-120539
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Simulated bp-restrict code-injection request
Expected signal: Web access log entry for /wp-admin/admin.php with bp-restrict and eval/base64_decode in the query string.
- Test 2 Simulated PHP worker spawning shell
Expected signal: Process creation of /bin/sh or id/uname parented by the php process.
- Test 3 Simulated web shell drop in uploads
Expected signal: File creation event for a new .php file under wp-content/uploads.
References (4)
- https://www.wordfence.com/threat-intel/vulnerabilities/id/fab68c0b-2211-4cc4-a112-f0011f9d72ed?source=cve
- https://github.com/seventhqueen/buddypress-restrict/releases/tag/1.5.5
- https://plugins.trac.wordpress.org/browser/bp-restrict/tags/1.5.4/admin/class-bp-restrict-admin.php#L213
- https://plugins.trac.wordpress.org/browser/bp-restrict/tags/1.5.4/includes/class-bp-restrict.php#L172
Response Playbook
Triage
- Confirm the installed version of the Restrictions for BuddyPress (bp-restrict) plugin on the affected WordPress host; versions <= 1.5.4 are vulnerable, 1.5.5 is patched.
- Review the flagged web request: extract the source IP, decoded query/body, targeted endpoint, HTTP response status, and whether the PHP primitive reached a plugin handler.
- Correlate the request timestamp with endpoint process telemetry for child processes spawned by the php/php-fpm/web-server worker within the same window.
- Confirm whether BuddyPress and Paid Memberships Pro are active, since both are required for the vulnerable code path.
Containment
- Block the attacking source IP(s) at the WAF/edge and rate-limit or restrict access to /wp-admin/ for the affected site.
- Isolate the WordPress host from the network if post-exploitation child processes or web shells are confirmed.
- Disable the bp-restrict plugin and upgrade to version 1.5.5 or later; rotate WordPress admin and database credentials if compromise is confirmed.
Evidence Collection
- Preserve web server access/error logs, WAF logs, and PHP-FPM logs covering the attack window.
- Capture a forensic image or at minimum the WordPress webroot (wp-content/plugins, wp-content/uploads) to identify dropped web shells and modified files.
- Export process-execution telemetry showing any children of php/php-fpm/httpd/w3wp around the event.
Escalation Criteria
- !Escalate to incident response if a web shell, reverse shell, or non-standard child process of the PHP worker is confirmed.
- !Escalate if the exploitation request returned HTTP 200 with evidence of code execution, or if lateral movement / credential access from the host is observed.
Investigation Guide
Forensic Artifacts
- >
New or recently modified PHP files under wp-content/ (plugins, uploads, themes) indicating a dropped web shell - >
Web server and PHP-FPM log entries showing bp-restrict requests with code primitives - >
Process-execution records of shells or recon tools parented by php/php-fpm/web-server processes
Tuning Guidance
Baseline normal administrator interaction with the bp-restrict settings pages; if legitimate configuration never contains PHP tokens, tighten the regex to alert on any code primitive. Reduce noise by scoping the web-log queries to the hosts actually running WordPress with the plugin installed, and by excluding known scanner IP ranges and authorized pentest sources. Pair the web-log detections with the endpoint child-process query to prioritize alerts that show actual execution.
Hunting Queries
Aggregates bp-restrict exploitation attempts by source IP to surface scanning or repeated targeting of CVE-2026-120539.
// df00tech DF00-f20ad46a84 · https://df00tech.com/detections/CVE-2026-120539 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csUriQuery has_any ("bp-restrict","bp_restrict") | extend d=url_decode(csUriQuery) | where d has_any ("eval(","base64_decode","<?php","shell_exec") | summarize count() by cIP, bin(TimeGenerated, 1h) ``` df00tech DF00-f20ad46a84 · https://df00tech.com/detections/CVE-2026-120539 · licence: https://df00tech.com/detections/licence ```
index=web uri_query="*bp-restrict*" | eval d=urldecode(uri_query) | where match(d,"(?i)(eval\(|base64_decode|<\?php|shell_exec)") | stats count by src_ip Atomic Red Team Tests
Send a crafted HTTP request to the bp-restrict endpoint containing a PHP eval primitive to validate web-log detection coverage (lab only).
Command
curl -s -o /dev/null 'http://wp-lab.local/wp-admin/admin.php?page=bp-restrict&code=eval(base64_decode(%22cGhwaW5mbygpOw==%22))' Cleanup
echo 'No persistent change; clear test entries from web logs if desired.' Expected Telemetry
Web access log entry for /wp-admin/admin.php with bp-restrict and eval/base64_decode in the query string.
Expected Detection
kql, spl, elastic_eql, qradar_aql, sumo_logic and chronicle_yaral rules fire on the decoded PHP primitive.
Emulate post-exploitation by having a PHP process execute a shell command, validating endpoint child-process detection (lab only).
Command
php -r 'system("id; uname -a");' Cleanup
echo 'No cleanup required; command is read-only recon.' Expected Telemetry
Process creation of /bin/sh or id/uname parented by the php process.
Expected Detection
crowdstrike_cql ProcessRollup2 query flags the shell/recon child of php.
Create a benign marker PHP file in the uploads directory to emulate a dropped web shell for file-artifact hunting (lab only).
Command
echo '<?php /* lab-test marker */ echo "argus-test"; ?>' > /var/www/html/wp-content/uploads/argus-test-shell.php Cleanup
rm -f /var/www/html/wp-content/uploads/argus-test-shell.php Expected Telemetry
File creation event for a new .php file under wp-content/uploads.
Expected Detection
Forensic artifact hunt surfaces the newly created PHP file under wp-content/uploads.