ACTIVELY EXPLOITED · CVE-2026-87902

WordPress CVE-2026-87902 Exploited the Same Day It Was Patched

pearcmd.php Turned Into a Web Shell Dropper. Attackers began exploiting CVE-2026-87902, a CVSS 9.2 flaw in WordPress page-template resolution, at 11:49 UTC on the day the patch shipped.

Matt Lucas  |  September 26, 2026  |  5 min
Editorial hero illustration
9.2
CVSS score, unauthenticated RCE
Same day
First exploit, Sept 22 at 11:49 UTC
68
Attempts seen by Previdian from Sept 23
Sept 28
CISA KEV federal patch deadline
TL;DR
  • What: CVE-2026-87902 lets an unauthenticated attacker make WordPress get_page_template() include an arbitrary readable local .php file, and exploitation started within hours of the September 22 patch.
  • Impact: Where the theme and server preconditions line up, attackers chain the include with pearcmd.php to write PHP into /tmp and /var/tmp and load a web shell uploader, giving full code execution as the web server user.
  • Fix / mitigation: Update to WordPress 7.1.2, 7.0.6, 6.9.9 or 6.8.10 now, then hunt for dropped PHP files in /tmp and /var/tmp.
  • Who's at risk: WordPress sites with auto-updates disabled or delayed, running a theme with a top-level page-* directory, on servers where pearcmd.php is present and readable (the default path in many PHP builds and container images).

WordPress shipped a fix for CVE-2026-87902 on September 22, 2026. The first exploitation attempt was recorded at 11:49 a.m. UTC that same day. The flaw carries a CVSS score of 9.2 and allows an unauthenticated attacker to reach remote code execution on sites where two preconditions are met. By September 25, CISA had added it to the Known Exploited Vulnerabilities catalog and ordered Federal Civilian Executive Branch agencies to patch by September 28.

Auto-updates will close this on most WordPress installs without anyone touching them. The sites that stay exposed are the ones where auto-updates were turned off for change control, stability, or a managed host's own patch cadence. Those are often the business-critical ones.

What the Bug Does

According to the WordPress advisory, an unauthenticated attacker can make get_page_template() resolve a page template to a chosen readable local .php file outside the active theme directories. WordPress then includes that file. Local file inclusion of PHP is code execution if the attacker can find a file that does something useful when included, and PHP ships one.

Exploitation requires both of the following:

Why pearcmd.php matters

pearcmd.php is a well-known local file inclusion gadget. When included through a web request, it can be driven to write attacker-controlled content to a file on disk. That turns a read-only include bug into arbitrary file write, and then into code execution. Observed requests targeted /usr/local/lib/php/pearcmd.php, the default location in many PHP builds, including common container images.

Observed Attack Chain

Previdian recorded 68 exploitation attempts against its honeypot network starting September 23, with traffic from a New Jersey IP address (104.194.9[.]227) and an Indonesia-based address. The requests follow a three-step pattern:

Patchstack independently saw the same progression: early reconnaissance that included harmless core files to confirm the bug, followed by active exploitation using pearcmd.php to write PHP to disk. Patchstack observed arbitrary file writes with attacker-controlled PHP content in both /tmp and /var/tmp.

Indicators of Compromise

File names observed in /tmp and /var/tmp:

wp-pear-rce-flag.php
poc87902.php
luci_<random>.php
zeta_<random>.php

Source IP addresses linked to exploitation:

104.194.9[.]227
43.250.53[.]42
180.251.159[.]243
195.178.110[.]247
107.189.14[.]87
45.61.184[.]170
92.246.130[.]76

Treat the IP list as short-lived. Mass exploitation campaigns rotate infrastructure quickly. The file names, the pearcmd.php request pattern and PHP files appearing in world-writable temp directories are the durable signals.

How Likely Is Compromise

Previdian founder and CEO Ryan Dewhurst expects mass exploitation attempts but relatively few actual compromises, because WordPress auto-updates are on by default and the preconditions narrow the target set. That assessment is reasonable at internet scale. It does not help an individual organization whose site happens to meet both conditions. A theme with a page-templates directory is routine, and pearcmd.php is present by default on a large share of PHP installs. If auto-updates are disabled on your site, assume you are in the exposed population until you verify otherwise.

Patched does not mean clean

Exploitation began before most manual patch cycles could run. A site patched on September 23 or later may already have a dropped PHP file or uploaded web shell. Updating WordPress removes the entry point, not anything the attacker left behind. Audit /tmp, /var/tmp and the web root after patching.

What to Do Now

Federal agencies have until September 28. Everyone else should be on the same timeline or faster, since the exploit chain is public, simple and already automated.

Fix It Yourself

Everything above is what happened. This is what to run. The check commands change nothing.

Check whether you are exposed

Print the installed WordPress core version (run from the site root with WP-CLI)

wp core version --extra

Find theme directories with a top-level page-* folder (precondition one)

find wp-content/themes -mindepth 2 -maxdepth 2 -type d -name 'page-*'

Locate pearcmd.php and list PHP files dropped in temp dirs since Sept 22

find / -name pearcmd.php -type f 2>/dev/null; find /tmp /var/tmp -type f -name '*.php' -newermt 2026-09-22 -ls 2>/dev/null

Close it

Update WordPress core to the latest release in your current branch (7.1.2, 7.0.6, 6.9.9 or 6.8.10)

wp core update --minor && wp core version

Quarantine PHP files dropped in /tmp and /var/tmp since Sept 22 (moves, does not delete)

sudo mkdir -p /root/cve-2026-87902-quarantine && sudo find /tmp /var/tmp -type f -name '*.php' -newermt 2026-09-22 -exec mv -n {} /root/cve-2026-87902-quarantine/ \;

Defense in depth: disable the pearcmd.php gadget on web hosts that do not use PEAR (breaks the pear CLI; rename back to restore)

sudo mv /usr/local/lib/php/pearcmd.php /usr/local/lib/php/pearcmd.php.disabled

Prompts for the agent you already run

To check a server or fleet for exposure to CVE-2026-87902

Check this host for exposure to WordPress CVE-2026-87902. For every WordPress install you can find (search for wp-config.php), run `wp core version` from its root and report whether it is below 7.1.2, 7.0.6, 6.9.9 or 6.8.10 for its branch. For each install, run `wp theme list --status=active` and `wp theme list --status=parent`, then list any top-level directory in those theme folders whose name starts with page-. Run `find / -name pearcmd.php -type f 2>/dev/null` and report whether the web server user can read each result. Output a table per install: version, patched yes/no, page-* directory present yes/no, pearcmd.php readable yes/no. Show every command you ran and its output. Do not update, move or delete anything.

After patching, to hunt for signs of prior compromise

Hunt for CVE-2026-87902 post-exploitation artifacts on this host. List .php files in /tmp and /var/tmp modified on or after 2026-09-22, and flag any named wp-pear-rce-flag.php, poc87902.php, luci_*.php or zeta_*.php. Grep the web server access logs (check /var/log/nginx, /var/log/apache2 and /var/log/httpd) for requests containing 'pearcmd' and for the IPs 104.194.9.227, 43.250.53.42, 180.251.159.243, 195.178.110.247, 107.189.14.87, 45.61.184.170 and 92.246.130.76. Run `wp user list --role=administrator` and flag accounts registered on or after 2026-09-22. Run `wp core verify-checksums` and `wp plugin verify-checksums --all`. Show all commands and output, summarize findings, and stop before moving, deleting or changing any file or account; propose quarantine steps and wait for my approval.

What to alert on

Alert on web server access logs (nginx or Apache access.log, or your WAF/CDN request log) where the request URI or query string field contains the string pearcmd, which has no legitimate reason to appear in a request to a WordPress site. Pair it with file integrity or EDR file-creation events for any new .php file written under /tmp or /var/tmp by the web server user (www-data, apache, nginx or the php-fpm pool user), and with network telemetry showing a php-fpm or httpd process connecting to raw.githubusercontent.com. Any one of these on a WordPress host warrants triage; two together indicate successful exploitation.

Questions about your exposure?

RedEye Security provides assessments for organizations that need to understand their real risk.

Talk to us