Critical WordPress Template Inclusion Flaw Enables Potential RCE
Vulnerability Disclosure · 41 sources · Updated 1mo ago · First seen Sep 22, 2026

WordPress released version 7.1.2 to fix critical vulnerability CVE-2026-87902 / GHSA-7hp8-65ch-5whp, an improper filename-validation flaw (CWE-98) in get_page_template(). Under specific server and active-theme conditions, an unauthenticated attacker can influence page-template resolution to include a readable local PHP file outside the active theme directory, potentially resulting in remote code execution.
Exploitation requires the top-level directory for the selected template to begin with page-, a condition reported in the Twenty Twelve and Twenty Fourteen themes as well as some third-party themes. The flaw carries a CVSS score of 9.2; administrators should update immediately to 7.1.2 or ensure automatic updates are enabled. Fixes are also being backported to security-supported WordPress releases from version 4.7 onward.

