Skip to content

WordPress CVE-2026-87902: Unauthenticated LFI, Conditional RCE — Who Is Actually at Risk

WordPress CVE-2026-87902: Unauthenticated LFI, Conditional RCE — Who Is Actually at Risk

Published 28 September 2026. Based on public advisories and reporting; UnpanicTech did not reproduce the vulnerability or test any exploit.

A WordPress site running 7.1.2, or the fixed release for its branch, is not exposed to CVE-2026-87902. A site that isn't patched has a real problem, because matching requests have been reaching servers since the day the fix shipped [3].

The flaw is in get_page_template(), the function WordPress uses to pick the theme file that renders a page. According to WordPress's advisory, an unauthenticated attacker can make it include a chosen, readable local .php file from outside the active theme directories. If conditions on both the theme and the server are met, that can lead to remote code execution [1]. Affected versions run from 4.7.0 through 7.1.1, with fixes on every branch back to 4.7.37 [1].

CISA added the CVE to its Known Exploited Vulnerabilities (KEV) catalog on 25 September 2026 [2]. So the useful question isn't whether this is real. It's which sites can actually be pushed from file inclusion to code execution, and that comes down to a few things you can check in minutes.

Three checks before anything else

  1. Version. Is the site on 7.1.2, 7.0.6, 6.9.9, 6.8.10 or the fixed release of its older branch? Include staging copies and container images.
  2. Theme. Does the active theme have a top-level folder whose name starts with page-, such as page-templates?
  3. Server. Is PEAR's pearcmd.php reachable, and is register_argc_argv on for web requests?

If you can't answer 2 and 3 quickly, don't wait. Update.

How one request becomes code execution, and where it stops

The request carries two parameters: page_id and pagename. WordPress cleans the pagename value first, but the cleaning step keeps percent-encoded characters intact. Later, get_page_template() decodes them, and the traversal sequences turn into a real path [3]. CrowdSec adds that this code path skipped the validate_file() check WordPress uses elsewhere for the same kind of filename [4].

The page_id matters too. Patchstack notes that without an ID that resolves to a real page, WordPress serves a 404 and the template code never runs [3]. That is why the payloads it logs always pair the two parameters.

Flow diagram of the CVE-2026-87902 attack path: an unauthenticated request, filename built by get_page_template, theme condition, local PHP file included, server condition for PEAR, and attacker-chosen PHP written and run.
Figure 1. Conceptual attack path. The two amber boxes are the conditions that decide how far a request gets.

Including a file isn't the same as running an attacker's code. The included file has to do something useful on its own. The public chain Patchstack sees in its traffic points the inclusion at PEAR's pearcmd.php. When PHP has register_argc_argv enabled, part of the query string reaches that script as command arguments, and one of its commands can write a file with attacker-chosen content [3]. Patchstack says turning register_argc_argv off doesn't fix the inclusion, but it breaks that chain, which is the difference between an information leak and code execution [3].

Who is actually exposed

The table is this article's own reading of the sources, not a vendor risk rating, and it has not been tested against live installs.

Situation Local file inclusion? Code execution? Action
Patched (7.1.2, 7.0.6, 6.9.9, 6.8.10 and older-branch fixes) Fixed per the advisory Fixed per the advisory Verify version everywhere, including staging and containers. If it was unpatched after 22 Sep, check logs.
Unpatched, theme has no page-* folder Sources disagree (see next section) The advisory ties RCE to theme and server conditions Patch. Don't treat this row as safe.
Unpatched, page-* folder, no reachable pearcmd.php or register_argc_argv off Yes, per the advisory The documented public chain is broken. Other chains aren't described in the sources I read. Patch.
Unpatched, page-* folder, pearcmd.php reachable, register_argc_argv on Yes This is the chain Patchstack sees attempted Patch now, then look for signs of compromise.

CrowdSec argues the sites that get hit are the ones where automatic updates are off: agency-managed sites pinned to a version, staging copies left online, containers built from an old image, and hosts with read-only filesystems [4]. It also says register_argc_argv is on by default in the official PHP Docker images and in cPanel environments below PHP 8.5, citing Security Affairs [4]. I haven't verified that default independently, so check your own configuration.

Where the sources disagree: does the inclusion itself need the theme folder?

WordPress's advisory says the RCE outcome needs preconditions on both the server and the active theme [1]. It doesn't say whether the plain file inclusion needs the theme condition too.

CrowdSec says the inclusion works on any unpatched site, and that only the RCE step needs a page-* theme folder plus PEAR and register_argc_argv [4]. Patchstack's observations point the other way. Nearly every payload it logs starts with templates%2f, because the traversal has to continue a real directory beginning with page- before it can climb out of the theme [3]. That suggests attackers treat the folder as necessary for the traversal itself.

This article did not test which reading is right. The practical consequence is the same either way: a clean theme check is not a reason to delay the update. CrowdSec also says the advisory names example themes, but the advisory text I read doesn't, so I've left theme names out. Look at your own theme folders instead.

What attackers are doing, and what the numbers can't prove

Patchstack's first request arrived at 11:49 UTC on 22 September, the same day the fix was published. Its payloads matched the exact encoding the patch addresses, so whoever built them was working from the diff, not from independent discovery [3].

By 23 September it described three stages. First, an inclusion of a harmless core file to see whether the host is vulnerable. Second, a request aimed at pearcmd.php with a benign command to check that it's reachable. Third, a file-write attempt [3]. Some payloads only write a marker string, which looks like someone building a list of vulnerable hosts. Others write a short tag that runs a shell command when the file is accessed [3].

Those files landed in /tmp and /var/tmp. Patchstack notes that a file there is not usually reachable over the web, so on its own it shows execution rather than a persistent backdoor [3]. The researcher's proof of concept and lab are public [5], and a scanner user-agent named after a Nuclei template shows up in the traffic [3].

Vertical timeline from the 20 July report to WordPress, through the 22 September fix and first attacks, to CISA KEV listing on 25 September and the federal deadline on 28 September 2026.
Figure 2. Timeline assembled from the advisory, Patchstack, CrowdSec and CISA. Times are as reported by each source.

CrowdSec counted 322,680 matching signals between 23 and 27 September. Daily volume rose from 14,938 to 124,154, and distinct sources went from 237 to 23,321. Its tracker showed 30,813 unique IP addresses by 28 September [4]. CrowdSec's first-seen date is 23 September, a day after Patchstack's, but its detection rule only went live on 23 September, so that isn't a real disagreement [4].

CrowdSec is clear about what those numbers don't show, and it's worth repeating:

  • A matching request is an attempt. It can't confirm any attempt worked, and most targets will lack the conditions RCE needs.
  • Unique IP addresses are not unique attackers. One operator can rotate through thousands.
  • The data comes from machines in the CrowdSec network, which is a sample, not a census.
  • Five days is too short a window to forecast from [4].

On the official side, CISA lists the CVE as added on 2026-09-25 with a due date of 2026-09-28. Known ransomware use is marked "Unknown", and forensic triage is required under its BOD 26-04 directive [2]. In the sources I reviewed, none names a compromised organisation, a threat actor or a specific campaign, so this article doesn't either.

Why it's called LFI, RFI and RCE, and why there are two scores

The advisory calls it a path traversal and describes inclusion of a "local" PHP file. Its CWE-98 label is officially titled "PHP Remote File Inclusion" [1], and CISA's KEV listing uses "Remote File Inclusion" in its name [2]. That looks like a CWE naming artifact. In this bug the attacker picks a path on the server itself, so local file inclusion describes it better. RCE is the conditional outcome, not the base bug.

The two scores use different versions of the CVSS scoring system, so they shouldn't be compared directly:

CVSS 4.0: 9.2 Critical

Published in the WordPress advisory. The theme and server requirements count as "attack requirements", and attack complexity stays low [1].

CVSS 3.1: 8.1 High

CrowdSec attributes this to CISA [4]. The researcher's repository lists the same score with high attack complexity [5].

Same flaw, two ways of scoring the same conditions. Neither score says anything about whether your site is being attacked.

What to do, in order

  1. Update. Move to 7.1.2 or the fixed release of your branch. Confirm with wp core version and check every copy of the site, not only production [1].
  2. If you can't update yet, block the request pattern. Patchstack says a real page slug never contains a traversal sequence, so rejecting them in pagename shouldn't affect normal traffic [3].
  3. Break the known RCE chain. Disable register_argc_argv for web requests or remove pearcmd.php. CrowdSec notes this closes the known route but not the inclusion [4]. Don't rely on php -i from a shell for this check, because command-line PHP always exposes $argv. Look at the FPM or Apache configuration the site really uses.
  4. Check your exposure. These are ordinary file checks, not tests of the vulnerability. Adjust paths to your host.
# run from the WordPress root
wp core version
find wp-content/themes -maxdepth 2 -type d -name 'page-*'
ls -l /usr/local/lib/php/pearcmd.php /usr/share/php/pearcmd.php /usr/share/pear/pearcmd.php 2>/dev/null

Looking for signs of earlier compromise

If a site was unpatched at any point after 22 September, look before assuming it's clean [4]. Patchstack's strongest indicators are pagename values containing %2e%2e or %252e%252e, pagename and page_id together on the site root, and any request mentioning pearcmd [3].

# GET requests only; POST bodies are usually not in access logs
zgrep -Ei 'pagename=[^& ]*(%2e|%252e)' /var/log/nginx/access.log*
zgrep -Ei 'pearcmd|config-(show|create)' /var/log/nginx/access.log*
# unexpected PHP files in temp directories
find /tmp /var/tmp -maxdepth 2 -name '*.php' -ls

The POST caveat matters. Patchstack reports that POST has overtaken GET as the more common method, because WordPress reads pagename from the request body [3]. Standard access logs don't record request bodies, so an empty grep result is not a clean bill of health.

Unexpected .php files in /tmp or /var/tmp, especially the names Patchstack lists, mean a file-write attempt succeeded, and the host should be treated as compromised [3]. CrowdSec also suggests checking wp-content/uploads for new PHP files [4].

What we still don't know

  • Whether the plain file inclusion needs the page-* theme folder, or only the RCE step does.
  • How many attempts have actually succeeded. The public numbers count requests, not compromises.
  • Whether chains other than pearcmd.php are being used. None is described in the sources I read.
  • Whether attackers will move payloads from /tmp to locations that survive a reboot or are reachable over the web. Patchstack says it's watching for that [3].

Defender takeaway

"Conditional RCE" is easy to read as "probably not my problem". CrowdSec's observation is that attackers aren't guessing your theme or server setup; they send the whole chain and see which hosts answer [4]. The conditions are the thing being scanned for, not a shield you can plan around. Sites nobody owns are where this lands hardest: the forgotten staging copy, the pinned agency build, the old container image.

Today is also the KEV deadline for US federal agencies [2]. If you run WordPress anywhere, treat it as your deadline too, and run the log check for the window since 22 September.

Update log: 28 September 2026, first publication. Facts here can change; if a source revises a score, affected version or exploitation detail, this article will be corrected and the change noted.

Sources & References

  1. WordPress, Advisory GHSA-7hp8-65ch-5whp: Unauthenticated path traversal in page-template resolution leading to conditional RCE (affected and fixed versions, CVSS 4.0 vector, CWE-98).
  2. CISA, Known Exploited Vulnerabilities Catalog (date added, due date, ransomware field) and alert of 25 September 2026 (listing name).
  3. Patchstack, CVE-2026-87902: Attackers Started Probing WordPress Sites Hours After the Patch (first-seen times, attack stages, indicators, mitigations).
  4. CrowdSec, CVE-2026-87902: 30,000 IPs Target WordPress in Five Days (telemetry and caveats, exposure patterns, CVSS 3.1 attribution).
  5. Robert Ressl, CVE-2026-87902 proof of concept and lab (discoverer's repository, CVSS 3.1 vector, lab reproduction on WordPress 7.0.2).
NK

Cybersecurity Researcher & Technical Editor

UnpanicTech publishes independent cybersecurity research and defensive security analysis. Naseem Khan serves as Technical Editor, with a focus on vulnerability analysis, defensive security, incident response, cloud security, and practical security engineering.

Leave a Comment (Authenticated Users)