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.

Sep 23, 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 demonstrates how the flaw can be exercised end to end. The sequence below describes the logic of the attack, not a step-by-step exploit recipe.

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 CVE-2022-0492: Linux Kernel cgroups Flaw, From Container to Host Root
CVE-2022-0492: Linux Kernel cgroups Flaw, From Container to Host Root

CVE Research

CVE-2022-0492: Linux Kernel cgroups Flaw, From Container to Host Root

Sep 22, 2026

Open CVE-2023-27351: The PaperCut Authentication Bypass That Became a Ransomware Gateway
CVE-2023-27351: The PaperCut Authentication Bypass That Became a Ransomware Gateway

CVE Research

CVE-2023-27351: The PaperCut Authentication Bypass That Became a Ransomware Gateway

Sep 22, 2026

Open Inside the ShinyHunters Playbook: From Credential Theft to Data Extortion
Inside the ShinyHunters Playbook: From Credential Theft to Data Extortion

CVE Research

Inside the ShinyHunters Playbook: From Credential Theft to Data Extortion

Sep 22, 2026

Open Patch Analysis & Exploitation Timeline: Seven CVEs, Two Remediation Tracks, CISA's September 2, 2026 KEV Additions
Patch Analysis & Exploitation Timeline: Seven CVEs, Two Remediation Tracks, CISA's September 2, 2026 KEV Additions

CVE Research

Patch Analysis & Exploitation Timeline: Seven CVEs, Two Remediation Tracks, CISA's September 2, 2026 KEV Additions

An analysis of seven vulnerabilities added to the CISA Known Exploited Vulnerabilities catalog on September 2, 2026, covering vulnerability types, remediation deadlines, and patch prioritization considerations.

Sep 18, 2026