Critical WordPress Core Flaw Lets Unauthenticated Attackers Execute Remote Code

WordPress has released version 7.1.2 to address a critical core vulnerability that could allow unauthenticated attackers to achieve remote code execution under specific server and theme configurations.

Tracked as CVE-2026-87902 and GHSA-7hp8-65ch-5whp, the flaw carries a CVSS v4 score of 9.2 and affects WordPress installations dating back to version 4.7.

The issue resides in WordPress page-template resolution, specifically within the get_page_template() functionality. An attacker does not need a WordPress account or any privileges to exploit the flaw.

Critical WordPress Core Flaw

By manipulating page-template handling, they may be able to cause WordPress to include a readable local PHP file located outside the active theme directory.

If the included file can be influenced or already exists in a suitable location, the condition can escalate from a path traversal-style issue to remote code execution.

Successful exploitation could enable attackers to run arbitrary PHP code in the context of the affected web server, potentially leading to website takeover, data theft, persistent backdoors, malware deployment, or further movement across a hosting environment.

The vulnerability was responsibly disclosed by security researcher Robert Ressl. WordPress categorized the flaw as critical because it is remotely reachable and requires no authentication or user interaction.

The advisory maps the issue to CWE-98, covering improper control of filenames used in PHP include or require operations. Exploitation depends on multiple conditions.

The active parent or child theme must contain a top-level directory beginning with page-, such as page-templates. According to WordPress, this includes legacy Twenty Twelve and Twenty Fourteen themes, as well as some third-party themes including Neve, Hestia, and Sydney.

A readable local PHP target must also be available to the web server process. The advisory highlights the known pearcmd.php transition as one potential route to code execution when PHP’s register_argc_argv setting is enabled.

Environments potentially exposed to this condition include the official PHP Docker image and default cPanel deployments using PHP versions earlier than 8.5.

WordPress 7.1.2 is the primary fixed release. The project has also backported the patch to every currently security-supported branch through WordPress 4.7, allowing administrators to remediate without necessarily moving immediately to the latest major release.

Patched versions include 7.0.6, 6.9.9, 6.8.10, 6.7.9, 6.6.9, 6.5.12, and corresponding updates for older maintained branches.

Administrators should update WordPress installations immediately through the Dashboard’s Updates section or by deploying the latest package from WordPress.org. Sites with automatic background updates enabled should begin receiving the security update automatically.

Security teams should also review active themes for top-level page-* directories, identify exposed PHP files outside theme paths, and validate whether register_argc_argv is enabled.

Organizations using containerized PHP or shared-hosting control panels should prioritize exposure assessment, patch verification, and post-update log reviews for unusual requests targeting page-template parameters.

Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team 

Tamilselvan
Tamilselvanhttps://cyberpress.org/
Tamilselvan is an Investigative cybersecurity journalist dedicated to breaking stories on ransomware cartels, data breaches, and state-sponsored espionage.

Trending News

Related Stories