SecPod

Learn Search

Search across all Learn content

← Back to Security Research
No Account Needed: Critical WordPress Flaw (CVE-2026-87902) Lets Attackers Run Code on Some Servers — Patch Now

No Account Needed: Critical WordPress Flaw (CVE-2026-87902) Lets Attackers Run Code on Some Servers — Patch Now

WordPress has fixed CVE-2026-87902, an unauthenticated path traversal in page-template resolution that can lead to remote code execution when theme and server conditions align. The issue affects WordPress from 4.7.0 through 7.1.1 and is patched in 7.1.2, with backports across older supported branches. This article covers how the flaw works, affected and fixed versions, impact, and recommended remediation.

Oct 27, 2026By Bapanapalli Prem Sai Siddhik

Summary

WordPress has released a security fix for CVE-2026-87902, an unauthenticated path traversal in page-template resolution. Under documented theme and server conditions, the inclusion can lead to remote code execution. The fix is available in WordPress 7.1.2, with backports across supported branches back to 4.7. Matching patched releases should be applied as soon as possible.

Vulnerability Details

CVE ID CVSS Score Type
CVE-2026-87902 9.2 CWE-98: Improper Control of Filename for Include Statement

Technical Information

Critical Unauthenticated No User Interaction Path Traversal Public PoC

CVE-2026-87902 - Unauthenticated Path Traversal in Page-Template Resolution

An unauthenticated attacker can influence page-template resolution so that WordPress includes a chosen readable local PHP file from outside the active theme directories. No account or user interaction is required.

Remote code execution is conditional. The active child or parent theme must contain a top-level directory whose name starts with page- (for example page-templates). That layout appears in some legacy default themes and certain third-party themes. A suitable local .php target must also exist and be readable by the web-server account; when PHP runs with register_argc_argv enabled, known PEAR entry points can complete the path to code execution on common hosting stacks.

Proof of Concept Analysis

A public proof-of-concept is available. The high-level flow is as follows:

1. Unauthenticated request reaches template selection

WordPress accepts public request parameters used when choosing a page template. The attacker does not need an account, cookie, or privileged role.

2. Crafted input shapes the template candidate

Values tied to page naming are turned into template filename candidates. Because those candidates are not fully constrained to the theme tree, path elements can point outside the intended directories.

3. Loader includes an external local PHP file

The template loader resolves a readable local .php file and includes it during page rendering. At this stage the issue is local file inclusion: the site runs whatever that file already contains.

4. Inclusion becomes code execution on suitable hosts

If the included file can be driven to run attacker-controlled logic, for example through a helper script present on some PHP deployments, execution continues under the web-server account.

1
Unauthenticated
Request
→
2
Template Path
Manipulation
→
3
Local PHP
Inclusion
→
4
Conditional
Code Execution

Impact

  • Local file inclusion
    An unauthenticated attacker can cause page-template resolution to include a readable local PHP file outside the active theme directories.
  • Conditional remote code execution
    When theme and server conditions align, inclusion can lead to code execution with the privileges of the web-server account, which may allow access to configuration, site data, or writable application resources.

Affected and Fixed Versions

As per the WordPress security advisory, the following version ranges are affected and the corresponding patched releases are:

Affected versions Patched version
7.1.0 – 7.1.17.1.2
7.0.0 – 7.0.57.0.6
6.9.0 – 6.9.86.9.9
6.8.0 – 6.8.96.8.10
6.7.0 – 6.7.86.7.9
6.6.0 – 6.6.86.6.9
6.5.0 – 6.5.116.5.12
6.4.0 – 6.4.116.4.12
6.3.0 – 6.3.116.3.12
6.2.0 – 6.2.126.2.13
6.1.0 – 6.1.136.1.14
6.0.0 – 6.0.156.0.16
5.9.0 – 5.9.175.9.18
5.8.0 – 5.8.165.8.17
5.7.0 – 5.7.185.7.19
5.6.0 – 5.6.205.6.21
5.5.0 – 5.5.215.5.22
5.4.0 – 5.4.225.4.23
5.3.0 – 5.3.245.3.25
5.2.0 – 5.2.275.2.28
5.1.0 – 5.1.255.1.26
5.0.0 – 5.0.285.0.29
4.9.0 – 4.9.324.9.33
4.8.0 – 4.8.314.8.32
4.7.0 – 4.7.364.7.37

Only the most recent WordPress version is actively supported. Release notes are available on WordPress.org.

MITRE ATT&CK Mapping

Technique ID Technique Name Tactic
T1190 Exploit Public-Facing Application Initial Access
T1083 File and Directory Discovery Discovery

Mitigation and Recommendations

Updating to a patched release is the fix. WordPress does not offer a separate workaround.

  • Apply the fixed release for the branch in use. Sites with automatic background updates will start the process automatically; others can update from the dashboard under Updates or download from WordPress.org.
  • Where an immediate update is not possible, exposure can be reduced by disabling register_argc_argv for web requests when it is not required, and by removing unused web-readable PEAR entry points. These steps do not close the vulnerability in WordPress core.
  • Check whether the active child or parent theme includes a top-level directory whose name starts with page-, which is part of the practical attack path for this issue.

Instantly Fix Risks with Saner Patch Management

Saner patch management is a continuous, automated, and integrated solution that helps you quickly remediate risks, including critical third-party application updates. It supports Windows, Linux, macOS, and 550+ third-party applications.

You can stage patches in a safe testing environment before production deployment and roll back if needed.

Experience the fastest and most accurate patching software here.

Featured Posts

Open Critical RabbitMQ OAuth2 Authentication Bypass Could Grant Admin Access: November 30, 2026
Critical RabbitMQ OAuth2 Authentication Bypass Could Grant Admin Access: November 30, 2026

CVE Research

Critical RabbitMQ OAuth2 Authentication Bypass Could Grant Admin Access: November 30, 2026

A critical RabbitMQ OAuth2 vulnerability rated 9.1 allows unauthorized privileged token issuance in affected management configurations. Explore technical analysis, security risks, affected versions, exploitation evidence, available security patches and recommended remediation strategies.

Dec 1, 2026

Open Critical Vulnerabilities in MySQL Server, MySQL Cluster and RealVNC - November 30, 2026
Critical Vulnerabilities in MySQL Server, MySQL Cluster and RealVNC - November 30, 2026

CVE Research

Critical Vulnerabilities in MySQL Server, MySQL Cluster and RealVNC - November 30, 2026

Explore two Critical vulnerabilities affecting MySQL Server, MySQL Cluster and RealVNC, involving improper authentication and out-of-bounds write weaknesses. Understand their technical root causes, affected versions, CVSS severity, exploitation evidence, security patches and recommended remediation strategies.

Nov 30, 2026

Open November 2026 Linux Security Updates for Debian, Fedora, Red Hat and Ubuntu: Critical Browser, .NET and Enterprise Infrastructure Vulnerabilities
November 2026 Linux Security Updates for Debian, Fedora, Red Hat and Ubuntu: Critical Browser, .NET and Enterprise Infrastructure Vulnerabilities

CVE Research

November 2026 Linux Security Updates for Debian, Fedora, Red Hat and Ubuntu: Critical Browser, .NET and Enterprise Infrastructure Vulnerabilities

Nov 27, 2026

Open Linux Vulnerability Research: Critical PHP, Chromium and Kernel Security Updates – November 25, 2026
Linux Vulnerability Research: Critical PHP, Chromium and Kernel Security Updates – November 25, 2026

CVE Research

Linux Vulnerability Research: Critical PHP, Chromium and Kernel Security Updates – November 25, 2026

Explore 20 Linux security advisories across Debian, Fedora, Red Hat and Rocky Linux, covering Critical PHP and Chromium vulnerabilities, kernel security flaws, known exploitation evidence, technical vulnerability analysis, security patches and recommended remediation strategies.

Nov 27, 2026