WordPress Core get_page_template() Local File Inclusion (LFI) and Remote Code Execution (RCE) (CVE-2026-87902)
Executive & SecOps Summary
SECOPS ASSESSMENTAll WordPress installations running vulnerable core versions and specific themes.
Unauthenticated attackers can include and execute arbitrary local PHP files, leading to full server compromise.
Immediate update to the latest WordPress security release and deployment of WAF filtering rules.
Affected Products & Version Scope
Remediation & Live Workaround Commands
PATCH & WORKAROUND- Update WordPress: Apply the latest security patches immediately via the dashboard or CLI.
wp core update- WAF Configuration: Implement rules to detect and block directory traversal sequences (
../) in URL parameters related to page templates. - Hardening: Restrict file system permissions and disable PHP execution in the
/wp-content/uploads/directory using.htaccessor Nginx configuration.
Block Exploits Instantly with Managed Virtual Patching Rules
Can't patch production immediately? Deploy managed WAF rules at the edge to intercept RCE, SQLi, and deserialization payloads before they hit your origin server.
Technical Root Cause & Exploitation Mechanics
The vulnerability stems from an improper path resolution logic within the get_page_template() function. An unauthenticated attacker can manipulate template resolution to include arbitrary .php files located outside the active theme's directory (CWE-98). If the attacker can influence the content of any local PHP file (e.g., via log poisoning or media uploads), this LFI can be escalated to Remote Code Execution (RCE). With an EPSS score of 0.94 and inclusion in the CISA KEV catalog, this flaw is being actively exploited in the wild.
Official Vendor Advisories & References
An unauthenticated attacker can make `get_page_template()` page-template resolution include a chosen readable local `.php` file outside the active theme directories. If relevant pre-conditions for both the server and the active theme are met, this can lead to RCE.
Subscribe to Daily Vulnerability Briefings & KEV Alerts
Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.