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 combining a valid page_id with a double-encoded pagename can preserve traversal syntax through initial sanitization. A subsequent urldecode() in get_page_template() activates that syntax when constructing a template candidate. The template loader checks file existence and readability without enforcing containment within approved theme directories, allowing inclusion of an attacker-selected readable local PHP file. Exploitability depends on the active theme's directory layout and server filesystem access. A demonstrated PEAR-based chain converts inclusion into arbitrary PHP execution when additional PHP configuration and write-access prerequisites are satisfied. Affected releases begin with WordPress 4.7.0, with branch-specific security fixes available through WordPress 7.1.2; patched older branches are not affected merely because their version numbers are lower.
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 permits inclusion and execution of local PHP files outside the active theme directories. Under suitable conditions, an attacker can execute arbitrary PHP with the permissions of the PHP/web-server account, potentially exposing application configuration, database credentials, user and customer records, and other readable data. The attacker may modify site content and writable application resources, deploy web shells or skimmers, and disrupt service. Operating-system privilege escalation, root access, and host escape are not inherent outcomes. Exploitation activity has been observed, but matching request telemetry does not establish that individual targets were compromised.
Mitigation
If you can’t patch tonight, do this now.
Until patched, apply WAF rules that detect encoded traversal in pagename across both query strings and POST bodies. Restrict public access to affected instances where feasible. Disable unnecessary register_argc_argv support in the web-facing PHP runtime, remove unused web-readable PEAR entry points, and restrict PHP filesystem read and write permissions to interrupt the demonstrated execution chain. Where operationally safe, remove, rename, or prevent traversal through qualifying top-level page-* directories or directory symlinks in active parent and child themes. Run the web service with least privilege and segment it from critical systems. Monitor traversal-like page requests, unexpected PHP files, web-worker child processes, and unusual outbound connections. These controls do not repair the underlying inclusion flaw; disabling the PEAR route alone does not prevent other inclusion-based attacks.
Remediation
Patch, then assume compromise.
Upgrade every affected installation to the latest maintained WordPress release containing the fix. Branch-specific fixed releases include 7.1.2, 7.0.6, 6.9.9, and 6.8.10, with additional security backports extending through 4.7.37. Use the appropriate fixed release for the deployed branch rather than treating all versions below 7.1.2 as vulnerable, and plan migration from older courtesy-backport branches. The fix validates decoded page names with validate_file() and adds canonical-path containment checks through _wp_is_template_path_allowed(). Apply distribution-provided updates where applicable; Debian trixie's fixed package is 6.8.10+dfsg1-0+deb13u1. Verify updates across production, staging, pinned deployments, and container images. Investigate previously exposed systems for unauthorized PHP files, account changes, persistence, and suspicious execution; patching does not remove an existing compromise.
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 28, 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 every affected installation to the latest maintained WordPress release containing the fix. Branch-specific fixed releases include 7.1.2, 7.0.6, 6.9.9, and 6.8.10, with additional security backports extending through 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 26.7% (98th percentile) as of Nov 28, 2026.
Recent activity
355 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.