Critical WordPress Flaw Lets Unauthenticated Attackers Execute Remote Code
WordPress 7.1.2 patches a critical CVSS 9.2 path traversal flaw (CVE-2026-87902) that could allow unauthenticated RCE under specific theme and server configurations.
WordPress has released version 7.1.2 to address a critical path traversal vulnerability, CVE-2026-87902, which could allow unauthenticated remote code execution under specific conditions. The flaw, with a CVSS v4 score of 9.2, stems from improper page-template resolution and affects WordPress versions from 4.7 onwards. Successful exploitation requires the active theme to have a top-level directory starting with 'page-' and a readable local PHP file accessible to the web server. Patches have been backported to older supported branches.
- WordPress version 7.1.2 patches a critical path traversal vulnerability (CVE-2026-87902) that can lead to unauthenticated RCE.
- The CVSS v4 score is 9.2, and the flaw affects versions dating back to WordPress 4.7.
- Exploitation is conditional, requiring specific server configurations and the presence of a 'page-*' directory in the active theme.
- Patched versions have been released for all supported WordPress branches.
Vulnerabilities mentionedAll →
- CVE-2026-879028.118%Unauthenticated Local File Inclusion to RCE in WordPress Core (fixed in 7.1.2)published · WordPress (WordPress.org) WordPress core KEV PoC ×16
| CVE | Vulnerability | CVSS | EPSS | Flags | Affected |
|---|
Full article489 words · extracted from gbhackers.com · click to collapse
WordPress has released version 7.1.2 to address a critical path-traversal vulnerability, tracked as CVE-2026-87902, which could allow unauthenticated remote code execution (RCE) under specific server and theme configurations.
This flaw carries a CVSS v4 score of 9.2 and affects WordPress versions dating back to 4.7.
Critical WordPress Flaw
The issue arises from improper page-template resolution in WordPress’s `get_page_template()` functionality. An unauthenticated remote attacker could exploit this by manipulating template resolution, enabling WordPress to include a locally readable PHP file chosen by the attacker, located outside the active theme directories.
This creates a path traversal condition that, under the right circumstances, can escalate to arbitrary PHP code execution on the affected web server.
The vulnerability is classified under CWE-98, which pertains to improper control of filenames used in PHP include or require operations.
The advisory rates this vulnerability as critical because exploitation requires no authentication or user interaction and can compromise the confidentiality, integrity, and availability of the affected WordPress installation.
While exploitation is possible, it is conditional, not universal. According to the advisory, attackers need two key preconditions:
- The active parent or child theme must contain a top-level directory starting with “page-“, such as “page-templates.”
- A readable local .php file must exist on the server and be accessible to the web server process.
Affected themes include the legacy Twenty Twelve and Twenty Fourteen WordPress themes, as well as several third-party themes like Neve, Hestia, and Sydney.
A potentially dangerous chain involves PHP’s `pearcmd.php`, which can be exploited for PEAR-to-RCE behavior when the `register_argc_argv` PHP setting is enabled. The advisory notes that the official PHP Docker image is affected by this issue, as are default cPanel configurations using PHP versions earlier than 8.5.
The issue impacts WordPress versions 7.1.0 through 7.1.1, as well as older supported and security-maintained branches down to version 4.7.
WordPress 7.1.2 is the primary fixed release, with patched maintenance versions issued for each eligible branch, including 7.0.6, 6.9.9, 6.8.10, and 4.7.37.
WordPress has backported the patch for users operating older branches, although only the most recent version remains actively supported.
Administrators should update to WordPress 7.1.2 or the latest patched release available for their branch immediately.
Updates can be installed from the WordPress Dashboard by navigating to Updates → Update Now, and sites with automatic background updates enabled should begin updating automatically. The latest WordPress package is also available from the official download page.
Site owners should review their active and child themes for “page-*” directories, verify whether readable PHP files such as `pearcmd.php` are exposed to the web server account, and turn off unnecessary PHP configurations, including `register_argc_argv`, where operationally feasible. Security researcher Robert Ressl responsibly disclosed this vulnerability.
Cut every SOC alert investigation by 21 min. Power your SOC with instant IOC context for immediate response: Integrate TI Lookup in your SOC
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.