Skip to content
PatchBriefing

Search PatchBriefing

Type at least two characters. Results update as you type.

Search CVEs, products, packages and article titles.

Nothing found. Identifiers such as CVE and GHSA can be searched in both languages.

Subscribe

High · 8.1 WordPress NCSC-2026-0389 CVE-2026-87902 6ff76d9b-aa12-4391-90cd-f9df36d4a3a5 Actively exploited

WordPress Core Local File Inclusion Flaw (CVE-2026-87902) Under Active Exploitation

An unauthenticated Local File Inclusion vulnerability in WordPress Core's locate_template() function, tracked as CVE-2026-87902, is being actively exploited. Under specific theme and server conditions it can lead to remote code execution. WordPress 7.1.2 and updated releases across all supported branches fix the issue.

By PatchBriefing ·

Produced automatically from official sources with the help of AI. How we work →

AI summary

A vulnerability in WordPress Core, tracked as CVE-2026-87902, allows unauthenticated attackers to trigger Local File Inclusion through the locate_template() function. The issue affects all WordPress Core versions up to and including 7.1.1 and is known to be actively exploited. WordPress.org has released version 7.1.2 as a security update, alongside fixed releases for every previously supported branch.

What happened

WordPress Core contains a Local File Inclusion vulnerability in the locate_template() function, which resolves a caller-supplied template name against the active theme's directories. The function did not verify that the resolved path stayed within those directories, allowing a template name containing '..' sequences to resolve to a file outside the theme. This flaw is reachable through get_page_template(), which builds a filename (page-{$pagename}.php) using the URL-derived 'pagename' query variable after URL-decoding, making it reachable by unauthenticated visitors.

Technical cause

The root cause is improper control of the filename used in an include/require statement (CWE-98), also described as PHP Remote/Local File Inclusion. Because locate_template() does not validate that the resolved template path remains inside the theme directory, a crafted 'pagename' value passed through get_page_template() can cause WordPress to include a PHP file located outside the active theme, provided that file is readable by the web server.

Why it matters

This is an unauthenticated vulnerability, meaning no login or user interaction is required to attempt exploitation. Under certain conditions it can lead to remote code execution. Two conditions must both be met for a full RCE chain: (1) the active parent or child theme must contain a top-level directory whose name starts with 'page-' (examples include the directory structures used by Twenty Twelve, Twenty Fourteen, Neve, Hestia, and Sydney), and (2) a readable .php file must exist on the server that the web server account can access, such as pearcmd.php in environments with register_argc_argv enabled (for example, the official PHP Docker image and default cPanel setups on PHP versions below 8.5). Where both conditions are present, this flaw can escalate from information disclosure/LFI to full remote code execution.

Who is affected

All WordPress Core installations running a version up to and including 7.1.1 are affected, spanning the entire version history back to the 4.7 branch. Sites are most exposed when running a theme whose structure includes a top-level directory starting with 'page-', and when a readable, exploitable PHP file (such as pearcmd.php under PHP < 8.5 with register_argc_argv enabled) is present on the server.

Discovery and timeline

The vulnerability was reported by researcher Robert Ressl. It was published on 2026-09-22 and WordPress.org released the fixed version 7.1.2 as a security release on the same date. The advisory record has since been updated, most recently on 2026-09-28.

Affected versions

WordPress Core versions from 4.7 up to and including 7.1.1 are affected, across every minor branch in between (4.7.x through 7.1.x). Fixed versions have been released for each branch: 4.7.37, 4.8.32, 4.9.33, 5.0.29, 5.1.26, 5.2.28, 5.3.25, 5.4.23, 5.5.22, 5.6.21, 5.7.19, 5.8.17, 5.9.18, 6.0.16, 6.1.14, 6.2.13, 6.3.12, 6.4.12, 6.5.12, 6.6.9, 6.7.9, 6.8.10, 6.9.9, 7.0.6, and 7.1.2.

Fixes and mitigation

WordPress.org has released fixed versions for every supported branch, with 7.1.2 as the current security release. Sites should update to the fixed version matching their branch (see Affected versions). As an additional precaution, administrators can review whether their active theme contains a top-level directory starting with 'page-' and whether any unnecessary, exploitable PHP files (such as pearcmd.php) are reachable by the web server, though patching remains the primary fix.

Recommended action

Update WordPress Core to the fixed version for your branch as soon as possible. Given that this vulnerability is unauthenticated, reachable without user interaction, and actively exploited, treat this update as urgent. If immediate updating is not possible, review theme directory structures and restrict or remove access to risky executables such as pearcmd.php as an interim mitigation.

PatchBriefing score

8.1 / 10 · High

Official CVSS: 8.1

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS 0.2674 (98 percentile)

Listed in CISA KEV since September 24, 2026

Why this score

The PatchBriefing score equals the official CVSS score; when this article covers several vulnerabilities, the highest one. Signals such as known exploitation and EPSS are listed separately and do not change the score.

Affected versions

WordPress Core ≥ 0 < 4.7.37
vulnerable
WordPress Core ≥ 4.8 < 4.8.32
vulnerable
WordPress Core ≥ 4.9 < 4.9.33
vulnerable
WordPress Core ≥ 5.0 < 5.0.29
vulnerable
WordPress Core ≥ 5.1 < 5.1.26
vulnerable
WordPress Core ≥ 5.2 < 5.2.28
vulnerable
WordPress Core ≥ 5.3 < 5.3.25
vulnerable
WordPress Core ≥ 5.4 < 5.4.23
vulnerable
WordPress Core ≥ 5.5 < 5.5.22
vulnerable
WordPress Core ≥ 5.6 < 5.6.21
vulnerable
WordPress Core ≥ 5.7 < 5.7.19
vulnerable
WordPress Core ≥ 5.8 < 5.8.17
vulnerable
WordPress Core ≥ 5.9 < 5.9.18
vulnerable
WordPress Core ≥ 6.0 < 6.0.16
vulnerable
WordPress Core ≥ 6.1 < 6.1.14
vulnerable
WordPress Core ≥ 6.2 < 6.2.13
vulnerable
WordPress Core ≥ 6.3 < 6.3.12
vulnerable
WordPress Core ≥ 6.4 < 6.4.12
vulnerable
WordPress Core ≥ 6.5 < 6.5.12
vulnerable
WordPress Core ≥ 6.6 < 6.6.9
vulnerable
WordPress Core ≥ 6.7 < 6.7.9
vulnerable
WordPress Core ≥ 6.8 < 6.8.10
vulnerable
WordPress Core ≥ 6.9 < 6.9.9
vulnerable
WordPress Core ≥ 7.0 < 7.0.6
vulnerable
WordPress Core ≥ 7.1 < 7.1.2
vulnerable
WordPress Core ≥ 7.1 < 7.1.2
vulnerable
≥ 4.7.37
patched
≥ 4.8.32
patched
≥ 4.9.33
patched
≥ 5.0.29
patched
≥ 5.1.26
patched
≥ 5.2.28
patched
≥ 5.3.25
patched
≥ 5.4.23
patched
≥ 5.5.22
patched
≥ 5.6.21
patched
≥ 5.7.19
patched
≥ 5.8.17
patched
≥ 5.9.18
patched
≥ 6.0.16
patched
≥ 6.1.14
patched
≥ 6.2.13
patched
≥ 6.3.12
patched
≥ 6.4.12
patched
≥ 6.5.12
patched
≥ 6.6.9
patched
≥ 6.7.9
patched
≥ 6.8.10
patched
≥ 6.9.9
patched
≥ 7.0.6
patched
≥ 7.1.2
patched
WordPress Core 4.7-4.7.36
vulnerable
WordPress Core 4.8-4.8.31
vulnerable
WordPress Core 4.9-4.9.32
vulnerable
WordPress Core 5.0-5.0.28
vulnerable
WordPress Core 5.1-5.1.25
vulnerable
WordPress Core 5.2-5.2.27
vulnerable
WordPress Core 5.3-5.3.24
vulnerable
WordPress Core 5.4-5.4.22
vulnerable
WordPress Core 5.5-5.5.21
vulnerable
WordPress Core 5.6-5.6.20
vulnerable
WordPress Core 5.7-5.7.18
vulnerable
WordPress Core 5.8-5.8.16
vulnerable
WordPress Core 5.9-5.9.17
vulnerable
WordPress Core 6.0-6.0.15
vulnerable
WordPress Core 6.1-6.1.13
vulnerable
WordPress Core 6.2-6.2.12
vulnerable
WordPress Core 6.3-6.3.11
vulnerable
WordPress Core 6.4-6.4.11
vulnerable
WordPress Core 6.5-6.5.11
vulnerable
WordPress Core 6.6-6.6.8
vulnerable
WordPress Core 6.7-6.7.8
vulnerable
WordPress Core 6.8-6.8.9
vulnerable
WordPress Core 6.9-6.9.8
vulnerable
WordPress Core 7.0-7.0.5
vulnerable
WordPress Core 7.1-7.1.1
vulnerable
≥ 4.7.37
patched
≥ 4.8.32
patched
≥ 4.9.33
patched
≥ 5.0.29
patched
≥ 5.1.26
patched
≥ 5.2.28
patched
≥ 5.3.25
patched
≥ 5.4.23
patched
≥ 5.5.22
patched
≥ 5.6.21
patched
≥ 5.7.19
patched
≥ 5.8.17
patched
≥ 5.9.18
patched
≥ 6.0.16
patched
≥ 6.1.14
patched
≥ 6.2.13
patched
≥ 6.3.12
patched
≥ 6.4.12
patched
≥ 6.5.12
patched
≥ 6.6.9
patched
≥ 6.7.9
patched
≥ 6.8.10
patched
≥ 6.9.9
patched
≥ 7.0.6
patched
≥ 7.1.2
patched

Reported fixes

WordPress.org has released fixed versions for every supported branch, with 7.1.2 as the current security release. Sites should update to the fixed version matching their branch (see Affected versions). As an additional precaution, administrators can review whether their active theme contains a top-level directory starting with 'page-' and whether any unnecessary, exploitable PHP files (such as pearcmd.php) are reachable by the web server, though patching remains the primary fix.

How this was built

5 source records were collected, matched and used to prepare the report above.

  • NCSC-NL advisories cert
  • NVD (NIST) database
  • Wordfence Intelligence scanner
  • CVE.org database
  • WordPress.org releases vendor
Unified report
WordPress Core Local File Inclusion Flaw (CVE-2026-87902) Under Active Exploitation
1 article · 5 sources cited
Revision history
  1. Generated
  2. Published
  3. Generated
The Morning Brief

Relevant changes for the stacks you follow.

Choose your stacks, topics and optional WordPress plugins. At 07:00 CET, matching advisories and releases from the reporting period are grouped into one email.

✓ Choose stacks and topics✓ Change preferences anytime✓ One grouped email