CVE-2026-87902 is an unauthenticated remote file inclusion (CWE-98) in WordPress core — not a plugin, not a theme, but the CMS engine that W3Techs estimates powers more than 40% of all websites. WordPress shipped the fix in 7.1.2 on September 22, 2026, alongside backports to every branch down to 4.7. Attackers had working exploitation traffic in the wild before the day was out.
The bug lets an unauthenticated request reach a local .php file outside the active theme through the pagename query parameter. Where the server has PHP's register_argc_argv enabled — the default in official PHP Docker images and in cPanel stacks on PHP below 8.5 — that inclusion escalates to full remote code execution via PEAR's pearcmd.php. CISA added it to the Known Exploited Vulnerabilities catalog on September 25 with a September 28 remediation deadline.
If you run WordPress below 7.1.2 (or the matching backport), treat this as an emergency patch. This brief covers the root cause, the LFI-to-RCE mechanics, live IOCs from Patchstack and honeypot telemetry, ready-to-run hunt queries, and the hardening that closes the door even before you patch.
◈ Table of Contents
Vulnerability Profile & Affected Versions
Phase 01CVE-2026-87902 is unusual precisely because it lives in WordPress core. Plugin and theme flaws are a weekly occurrence; a pre-authentication remote file inclusion in the base CMS reaches into a decade of releases and every hosting stack that runs them. The NVD record and CISA KEV entry give the authoritative shape of the flaw.
| Attribute | Value |
|---|---|
| CVE ID | CVE-2026-87902 |
| Vulnerability class | CWE-98 — Improper Control of Filename for Include/Require (Remote File Inclusion) |
| NVD CVSS v3.1 | 8.1 HIGH — AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Vendor (Patchstack) score | 9.2 CRITICAL |
| Authentication required | None (unauthenticated, pre-auth) |
| User interaction | None |
| Affected product | WordPress Core |
| Affected versions | 4.7.0 through 7.1.1 (all releases below 7.1.2) |
| Fixed versions | 7.1.2, 7.0.6, 6.9.9, 6.8.10 — plus backports on every supported branch to 4.7 |
| Discovered by | Robert Ressl |
| NVD published | 2026-09-22 · last modified 2026-09-26 |
| CISA KEV | Added 2026-09-25 · federal remediation due 2026-09-28 |
The NVD base score of 8.1 hinges on "high" attack complexity because RCE depends on server-side preconditions. Do not let that lull you: the preconditions (a theme directory prefixed "page-" and register_argc_argv=On) are the norm on shared hosting and default Docker images, which is why Patchstack scored it 9.2 and exploitation was mass, not targeted.
Disclosure & Exploitation Timeline
Phase 02The gap between patch and exploitation was measured in hours. This is a textbook "patch-diff to n-day" case: the fix commit told attackers exactly where the vulnerable code path was, and automated scanners were probing before most administrators had read the release notes.
- 12026-09-22 — WordPress releases 7.1.2 and backported fixes down to branch 4.7. The advisory describes the flaw as an unauthenticated path traversal that can lead to RCE.
- 22026-09-22, ~11:49 UTC — Previdian's honeypot network records the first exploitation attempt, the same day the patch shipped.
- 32026-09-22, 17:44 UTC — Patchstack observes reconnaissance probes against protected sites, under five hours after the release. Early requests target harmless core files to fingerprint vulnerable installs.
- 42026-09-23 — Attack traffic surges more than tenfold. Payloads shift from passive reconnaissance to writing executable PHP to disk via
pearcmd.php. - 52026-09-25 — CISA adds CVE-2026-87902 to the KEV catalog; the Cyber Security Agency of Singapore issues alert AL-2026-128 confirming in-the-wild exploitation and a public PoC.
- 62026-09-28 — Federal remediation deadline. By this point mass scanning has broadened well beyond the original honeypot source IPs.
When a widely-deployed project ships a security release, assume the patch itself is the exploit blueprint. The window to "patch on the next maintenance cycle" no longer exists for internet-facing CMS software — the safe assumption is exploitation within 24 hours of the commit landing.
Root Cause: How get_page_template Fails
Phase 03The flaw is a missing security check on a single filename. WordPress already knows how to defend against directory traversal — it calls validate_file() in the same code region — but the path built from the pagename parameter skips that guard entirely.
During template resolution, get_page_template() constructs a candidate template filename of the form page-{$pagename}.php. An earlier urldecode() converts encoded traversal sequences in pagename into real path separators. The result is passed toward the include machinery without the validate_file() traversal check that WordPress applies to the neighbouring template candidates.
Because page- is prepended, the attacker must first climb out of the theme's page-* directory and then walk the filesystem to a readable .php target. That constraint is why the second precondition — an active theme with a top-level directory whose name begins with page- (for example page-templates/) — matters: it gives the traversal a valid starting anchor.
WordPress 7.1.2 closes the hole two ways: it runs the missing validate_file() check against the pagename-derived candidate, and it introduces a new _wp_is_template_path_allowed() helper that validates every resolved template path against the allowed theme directories. Belt and braces — the second guard closes adjacent variants a single check might have missed.
- pagename-derived template names now pass through validate_file() traversal rejection
- _wp_is_template_path_allowed() confirms the resolved path resides under a permitted theme directory
- Backported identically to 7.0.6, 6.9.9, 6.8.10 and every supported branch to 4.7
Initial Access: The pagename RFI
Phase 04Reaching the vulnerable code path requires a specific request shape. The attacker needs WordPress to route the request into page-template resolution, which means supplying a valid page_id alongside a pagename loaded with double-encoded traversal.
The page_id forces WordPress to treat the request as a page query so template resolution runs. The pagename value carries the path traversal. Sequences are double-encoded (%252e%252e%252f decodes to ../) so they survive WordPress's own decoding and land as literal separators at the vulnerable line.
The page- prefix and appended .php extension mean this is not arbitrary file read of any file — the target must be a readable .php file reachable by climbing out of a page-* theme directory. That is exactly what makes pearcmd.php at /usr/local/lib/php/ the payload of choice.
Deep Dive: LFI to RCE via pearcmd.php
Phase 05Including a local .php file only runs its code — it does not, on its own, run attacker code. The escalation to RCE is a well-known LFI-to-RCE primitive that abuses PEAR's command-line utility, and it hinges entirely on one PHP setting: register_argc_argv.
When register_argc_argv is enabled, PHP populates $argv from the HTTP query string, splitting on +. A CLI script like pearcmd.php — never meant to be reached over the web — then parses the query string as if it were command-line arguments. This setting is on by default in the official PHP Docker images and in cPanel environments running PHP below 8.5, which is why so many hosts were immediately exploitable rather than merely vulnerable to file disclosure.
The dividing line between "information disclosure" and "remote code execution" for CVE-2026-87902 is literally one php.ini directive. Auditing register_argc_argv across your fleet tells you which hosts are RCE-exploitable versus which only leak file contents.
PEAR's config-create command takes a root directory and an output file, then writes a configuration file to that path. Because the command echoes supplied values into the written file, an attacker can smuggle a PHP tag into the "root" argument and have it persisted verbatim to a file of their choosing under /tmp or /var/tmp — directories that are world-writable and, crucially, readable back through the same inclusion bug.
In observed attacks the written file is a small dropper. Patchstack and Previdian recorded stagers reaching out to raw.githubusercontent[.]com/MrG3P5/web-shell/refs/heads/main/uploader.php to pull a fuller file-upload webshell, then persisting it under the webroot.
Because the write lands in /tmp or /var/tmp before a webshell is planted in the docroot, IR teams that only inspect the WordPress directory will miss the first-stage artifact. Include /tmp and /var/tmp in your PHP-file sweep.
Post-Exploitation: Webshells & Payloads
Phase 06Once code execution is achieved, the observed behaviour is characteristic of opportunistic, automated campaigns: fingerprint, prove exploitation, plant a webshell, move on. The filenames left behind are the clearest tell.
Early payloads were proof-of-exploitation markers; later waves planted functional file-upload shells. Researchers catalogued a recurring set of filenames written to /tmp, /var/tmp, and the webroot.
| Filename | Role |
|---|---|
| wp-pear-rce-flag.php | Proof-of-exploitation marker confirming the PEAR chain worked |
| poc87902.php | PoC dropper named for the CVE; early-wave write test |
| luci_<random>.php | Randomized-suffix webshell dropped by one campaign cluster |
| zeta_<random>.php | Randomized-suffix webshell dropped by a second cluster |
| uploader.php | Fuller file-upload webshell pulled from a GitHub raw URL |
Persistence
File-upload webshells give durable re-entry independent of the CMS patch level. Patching after compromise does not remove an already-planted shell.
Commodity Follow-on
Access consistent with mass exploitation typically feeds SEO spam injection, cryptominers, or resale to access brokers rather than hands-on-keyboard intrusion.
Data at Risk
Code execution as the web user exposes wp-config.php secrets, database credentials, and customer PII stored in the WordPress database.
Exposure & Scale
Phase 07The blast radius is a function of two things: WordPress's install base, and how many of those installs meet the RCE preconditions. Both point to a very large exposed population.
| Exposure factor | Detail |
|---|---|
| Install base | WordPress powers an estimated 40%+ of all websites (W3Techs) — the largest single CMS footprint on the internet |
| Version span | Every release 4.7.0 – 7.1.1 is affected — nearly a decade of installs, including long-unmaintained sites |
| RCE precondition 1 | Active theme with a top-level directory named page-* (e.g. page-templates/) |
| RCE precondition 2 | register_argc_argv=On — default in official PHP Docker images and cPanel PHP < 8.5 |
| Honeypot signal | Previdian recorded 68 distinct exploitation attempts across its sensor network in the first reporting window |
| Corroboration | Patchstack, BleepingComputer, The Hacker News, Security Affairs, CSA Singapore (AL-2026-128), CISA KEV |
Indicators of Compromise
Phase 08IOCs below are drawn from Patchstack and Previdian telemetry. Treat source IPs as low-confidence and short-lived — the value is in the request patterns and dropped filenames, which are far more durable across the campaign.
| Indicator | Type | Source |
|---|---|---|
| 169.58.48.193 | IPv4 | Patchstack |
| 169.58.48.195 | IPv4 | Patchstack |
| 2001:df1:e8c0::106b | IPv6 | Patchstack |
| 104.194.9.227 | IPv4 (New Jersey) | Previdian honeypot |
| 43.250.53.42 | IPv4 | Previdian honeypot |
| 180.251.159.243 | IPv4 (Indonesia) | Previdian honeypot |
| Indicator | Type | Notes |
|---|---|---|
| /tmp/poc87902.php | File path | First-stage write via pearcmd config-create |
| /var/tmp/*.php | File path | Alternate write location for droppers |
| wp-pear-rce-flag.php | Filename | Proof-of-exploitation marker |
| luci_<random>.php / zeta_<random>.php | Filename | Randomized-suffix webshells (docroot) |
| raw.githubusercontent[.]com/MrG3P5/web-shell/refs/heads/main/uploader.php | URL | Second-stage webshell source |
| pagename=..%252f / ..%252e%252e%252f | Request param | Double-encoded traversal in pagename |
| pearcmd + config-create in query string | Request pattern | PEAR RCE chain marker |
Detection & Hunt Queries
Phase 09The most reliable detections target the request shape, not the source IP. Below are paired Microsoft Sentinel (KQL) and Splunk (SPL) queries against web access logs, a raw log grep for quick triage, and a YARA rule for the dropped artifacts. Adjust table and sourcetype names to your ingestion.
Alert on HTTP 200 responses to pagename-traversal requests, not just the requests themselves. A 200 on a request that should have been a 404 is the strongest single signal that the inclusion resolved and the host is genuinely exploitable.
MITRE ATT&CK Mapping
Phase 10| Tactic | Technique | ID | Application to CVE-2026-87902 |
|---|---|---|---|
| Reconnaissance | Active Scanning: Vulnerability Scanning | T1595.002 | Fingerprinting probes against core files via pagename traversal |
| Initial Access | Exploit Public-Facing Application | T1190 | Unauthenticated RFI in WordPress core over the web |
| Execution | Command and Scripting Interpreter: PHP | T1059 | RCE via included pearcmd.php + register_argc_argv |
| Persistence | Server Software Component: Web Shell | T1505.003 | uploader.php and luci_/zeta_ webshells planted in docroot |
| Defense Evasion | Obfuscated/Encoded Files or Information | T1027 | Double URL-encoded traversal to bypass decoding |
| Command & Control | Ingress Tool Transfer | T1105 | Second-stage webshell pulled from raw.githubusercontent |
Mitigation & Hardening
Phase 11Update to 7.1.2 or the backport matching your branch (7.0.6, 6.9.9, 6.8.10, or the fix on your supported branch to 4.7). WordPress auto-updates handle minor releases for most sites — verify it actually applied rather than assuming.
If you cannot patch instantly, neutralize the escalation path. Turning off register_argc_argv demotes the bug from RCE to (at worst) local file read, and removing PEAR eliminates the specific gadget entirely. Neither is a substitute for patching.
Add a WAF rule blocking encoded traversal in the pagename parameter and any request combining pearcmd with config-create. Then assume-breach: if you were unpatched and internet-facing before Sep 25, hunt for the artifacts in Phase 08 before you trust the host.
- Core updated to 7.1.2 / matching backport and verify-checksums is clean
- No PHP files with recent mtime in /tmp or /var/tmp
- No pear-rce-flag / poc87902 / luci_ / zeta_ / uploader.php files under the webroot
- Access logs reviewed for pagename-traversal requests that returned HTTP 200
- wp-config.php secrets and DB credentials rotated if code execution is suspected
Patching does not remove a webshell that is already on disk. If exploitation predated your patch, credential rotation and a full artifact sweep are mandatory — otherwise attackers retain access through the planted shell regardless of core version.
Sources & References
Phase 12Run WordPress at scale? Feed the CVE-2026-87902 IOCs above into CyberHawk's IOC Scanner to sweep your estate for dropped webshells, and track live exploitation on the Threat Intel feed. For more n-day breakdowns and detection content, follow the CyberHawk Blog.
◈ Stay Connected
Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.
"They can't exploit you if you are the Exploit."