Advisory · WordPress Core · CVE-2026-87902

WordPress Core CVE-2026-87902: file inclusion exploited via pearcmd

CVE-2026-87902 is a path traversal in the way WordPress resolves page templates, present in every version from 4.7.0 through 7.1.1 and fixed in 7.1.2 on 22 September 2026. It lets someone who has never logged in make PHP load a file that already exists on the server, and on servers where pearcmd.php is reachable that becomes code execution. CISA listed it as exploited on 25 September. Code execution needs two conditions together, and this page says how to check both.

First published in the weekly briefing of 5 October 2026 and moved here unchanged. Later Core releases are covered in the briefings and advisories linked at the end of the page.

Affected
WordPress Core 4.7.0 through 7.1.1
Fixed in
7.1.2 (22 September 2026) and the matching branch releases
Exploitation
In CISA’s KEV since 25 September; Patchstack reports pearcmd.php config-create writing PHP into /tmp
Needs both
A theme directory starting with page-, and a route from inclusion to execution such as pearcmd.php

WordPress Core · CVE-2026-87902

CVE-2026-87902: from probing to real code-execution attempts

CVE-2026-87902 is an unauthenticated path traversal in the way WordPress resolves page templates, present in every version from 4.7.0 through 7.1.1. To find a page template, WordPress builds a filename, page-{pagename}.php, from the pagename value in the request — and decodes that value one extra time without the traversal check it applies a few lines earlier. WordPress strips a literal ../ from slugs but leaves percent-encoded characters alone, so an encoded %2e%2e survives the clean-up and turns into ../ after the extra decode. The result is a local file inclusion: someone who has never logged in can make PHP load a .php file that already exists elsewhere on the server. It was reported by Robert Ressl and fixed in 7.1.2 on 22 September. WordPress’s advisory rates it 9.2, critical, under CVSS 4.0; NVD and Wordfence give 8.1 under CVSS 3.1.

Attackers test it first by including harmless core files such as wp-links-opml.php or feed-rss2.php — which is why OPML or RSS output from an ordinary page URL means the inclusion worked. The step from inclusion to code execution is pearcmd.php, the command-line front end of PEAR, the old PHP package manager still installed on many servers. Included with attacker-controlled arguments, its config-create command writes a file with attacker-chosen content to a path the attacker picks. Write PHP into /tmp, include it, and the file inclusion has become remote code execution. That is what Patchstack now reports seeing: requests that include pearcmd.php and use config-create to drop PHP files into /tmp and /var/tmp. Probing began within hours of the release, a Nuclei scanning template is in general circulation, and CISA added the flaw to its Known Exploited Vulnerabilities catalog on 25 September. The Canadian Centre for Cyber Security’s advisory AV26-952 also reports exploitation in the wild.

Code execution is conditional, and WordPress’s own advisory says two conditions must hold together. The active theme, or its parent, must contain a top-level directory whose name starts with page- — a page-templates folder is common, and the advisory names Twenty Twelve, Twenty Fourteen, Neve, Hestia, and Sydney among the themes that qualify. And the server must offer a route from inclusion to execution, such as pearcmd.php with register_argc_argv set to On: Patchstack notes that the official PHP Docker image is affected, as is cPanel’s default configuration with any PHP version before 8.5. A site that does not meet both conditions is still vulnerable to the inclusion and still needs the update.

Fixed releases exist for every branch back to 4.7: 7.1.2, 7.0.6, 6.9.9, 6.8.10, 6.7.9, 6.6.9, 6.5.12, 6.4.12, 6.3.12, 6.2.13, 6.1.14, 6.0.16, 5.9.18, 5.8.17, 5.7.19, 5.6.21, 5.5.22, 5.4.23, 5.3.25, 5.2.28, 5.1.26, 5.0.29, 4.9.33, 4.8.32, and 4.7.37. The older-branch releases are a courtesy — WordPress says only the latest version is actively supported — so a site on an old branch should be planning its move to 7.1. Wordfence’s free tier receives its firewall rule for this flaw on 22 October, after the usual 30-day delay; until then, the update is the protection.

Figure 1 · At a glance

An unauthenticated file inclusion that becomes code execution where pearcmd.php is reachable.

QuestionAnswer
AffectedWordPress Core 4.7.0 through 7.1.1
Fixed inWordPress 7.1.2, 22 September 2026
StatusIn CISA’s KEV since 25 September
Condition 1The active theme or its parent has a top-level directory starting with page-
Condition 2A route from inclusion to execution, such as pearcmd.php with register_argc_argv On
The points that decide what to do about the WordPress Core file inclusion CVE-2026-87902, as stated in the sections below.
IndicatorWhere to lookWhat it suggests
pagename containing %2e%2e or %252e%252e, often beginning templates%2fAccess logs: query strings, and POST bodies where they are loggedEncoded or double-encoded traversal aimed at the vulnerable parameter
pagename and page_id in the same requestAccess logsA real page_id is needed to reach the vulnerable code; without one WordPress returns a 404 first
pearcmd, +config-show, or +config-create in a requestAccess logs, full request lineAn attempt to turn the inclusion into a file write; config-create is the write
User agent cve-2026-87902-poc/1.0 or nuclei-cve-2026-87902/1.0Access logs, user-agent fieldProof-of-concept or scanner traffic. Most attack traffic spoofs an ordinary browser, so do not filter on user agent alone
wp-pear-rce-flag.php, poc87902.php, luci_<random>.php, zeta_<random>.php, or any unexpected PHP in /tmp or /var/tmpFile system, sorted by modification timeThe written payload; treat it as evidence of compromise and preserve it before removing
HTTP 200 returning OPML or RSS content from an ordinary page URLAccess logs with response sizesThe inclusion ran on your host

Common questions

Common questions about CVE-2026-87902

I updated to WordPress 7.1.2. Do I still need to check anything?

Yes, if the site ran 7.1.1 or earlier at any point after 22 September. The update stops new attempts but does not remove PHP written to /tmp, a cron entry, or an administrator created before it. Search the access logs for pearcmd, config-create, and encoded traversal in pagename, and the temporary directories for PHP files, before you consider the site clean.

Is my site exposed to CVE-2026-87902 if it is not on cPanel?

Every site on 4.7.0 through 7.1.1 is vulnerable to the file inclusion, wherever it is hosted, until it is updated. Turning that into code execution needs two things at once, according to WordPress’s advisory: an active theme, or parent theme, with a top-level directory starting with page-, and a server-side route such as pearcmd.php with register_argc_argv on. cPanel’s default configuration with PHP before 8.5 and the official PHP Docker image both provide that route, but other hosts can too, so check rather than assume.

Choose the response path

Updated to 7.1.2 or later and still unsure what ran: choose the response path.

One site, one worrying result

Get the finding classified and the site restored to a trusted state.

Best when a log search turned up pearcmd requests, PHP in a temporary directory, or an administrator nobody created, and you want it handled properly rather than deleted and hoped for.