CVE-2026-87902: Unauthenticated Local PHP File Inclusion in WordPress Core Page-Template Resolution
- Vendor
- Wordpress
CVE-2026-87902 is an unauthenticated path traversal and local PHP file inclusion vulnerability in WordPress Core page-template resolution. A crafted frontend request supplies a double-encoded traversal value through pagename alongside a valid page_id. Subsequent URL decoding in get_page_template() activates traversal syntax when constructing a template candidate. The template-loading pipeline checks the target's existence and readability without adequately enforcing containment within approved theme directories, allowing inclusion of an attacker-selected readable local PHP file. Exploitation depends on the active theme's directory layout and server filesystem access; remote code execution requires additional conditions. The vulnerability affects unpatched WordPress branches beginning with 4.7, with fixes released in WordPress 7.1.2 and branch-specific security backports.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows an unauthenticated remote attacker to cause PHP files outside the active theme directories to execute in the WordPress request context. Where a usable local execution gadget or attacker-controlled PHP file is available, this can become arbitrary code execution with the PHP/web-server account's privileges. Consequences can include disclosure of application configuration, database credentials, customer and user records; unauthorized modification of site content and writable application resources; web-shell deployment; and service disruption. Operating-system privilege escalation and root access are not inherent consequences. Exploitation activity has been observed, although counts of matching requests do not establish successful compromise.
Mitigation
If you can’t patch tonight, do this now.
Until patching is complete, deploy WAF controls that detect encoded traversal in pagename across query strings and POST bodies, and restrict public access to affected instances where feasible. Disable unnecessary register_argc_argv support in the web-facing PHP runtime, remove or make inaccessible unused PEAR command entry points, and restrict PHP filesystem read access and write permissions. Where operationally safe, remove or rename the qualifying top-level theme directory to break the demonstrated traversal route. Run PHP with least privilege and segment internet-facing WordPress systems from critical assets. Monitor suspicious template-resolution requests, unexpected PHP files, account changes, and web-worker process activity. These measures reduce exposure or interrupt known execution chains but do not repair the underlying vulnerability; restricting administrative interfaces alone is insufficient.
Remediation
Patch, then assume compromise.
Upgrade to the latest maintained WordPress release containing the fix, or install the security release for the deployed branch. Fixed releases include 7.1.2, 7.0.6, 6.9.9, 6.8.10, and additional branch-specific backports down to 4.7.37. Older branches are not uniformly vulnerable merely because their version numbers are below 7.1.2; verify the exact branch-specific fixed version. Debian 13 installations should install wordpress 6.8.10+dfsg1-0+deb13u1 or a later vendor-fixed package. Apply appropriate distribution updates elsewhere, and verify production, staging, and container deployments individually. The fix validates decoded page names and adds template-path containment checks. Investigate previously exposed installations for compromise because updating does not remove attacker-created files or persistence.
Exploits
16 exploits validated by Mallory's analysis. Hidden: 13 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2026-87902 exploited in the wild?
- Yes. As of Nov 18, 2026, Mallory has reports of exploitation in the wild, and CISA added it to KEV on Sep 25, 2026.
- Is there a public exploit for CVE-2026-87902?
- Yes. Mallory tracks 16 public exploits or proofs of concept for CVE-2026-87902, the earliest disclosed Sep 22, 2026.
- Is there a patch for CVE-2026-87902?
- Upgrade to the latest maintained WordPress release containing the fix, or install the security release for the deployed branch. Fixed releases include 7.1.2, 7.0.6, 6.9.9, 6.8.10, and additional branch-specific backports down to 4.7.37.
- What products are affected by CVE-2026-87902?
- Wordpress.
- How severe is CVE-2026-87902?
- CVE-2026-87902 has a CVSS v3.1 score of 8.1 (High) and an EPSS score of 95.8% (100th percentile) as of Nov 18, 2026.
Recent activity
351 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.