Attacks reportedCVE published · 22 Sep 2026
WordPress core
CVE-2026-87902 Severity · Critical
CVSS 9.2
Affected
7.1 to 7.1.1, 7.0 to 7.0.5, 6.9 to 6.9.8, and so on down to 4.7 to 4.7.36; every version below 4.7
Fixed in
7.1.2; older branches in 7.0.6 down to 4.7.37; 7.1.3 is current; no fix for versions below 4.7

CVE alert · WordPress

CVE-2026-87902: a WordPress core flaw lets anyone load PHP files on sites with some themes

Anyone with no account can make WordPress load a PHP file from your server, and on some setups run their own code, if your theme has a folder such as page-templates. Update to 7.1.3, or your older version's latest release (for example 7.0.7), today.

Check your systems with your AI agent

Paste this prompt into an AI agent that can run commands on your machines. It only reads versions and settings, asks before using administrator rights, and ends with a report.

Check whether my systems are affected by CVE-2026-87902 in WordPress core, then write me a report.

Read the alert first: https://securityaudit.ae/cve/cve-2026-87902-wordpress-core/

What the alert says (facts checked 23 October 2026):
- Affected: 7.1 to 7.1.1, 7.0 to 7.0.5, 6.9 to 6.9.8, and so on down to 4.7 to 4.7.36; every version below 4.7
- Fixed in: 7.1.2; older branches in 7.0.6 down to 4.7.37; 7.1.3 is current; no fix for versions below 4.7
- Exploited: Yes: in CISA's KEV catalog since 25 September 2026; Patchstack saw attacks from 22 September 2026

Rules:
- Read only. Do not install, update, restart, delete or change anything, and never run exploit or proof-of-concept code.
- Run only commands that read versions or settings. Ask me before any command that needs sudo or administrator rights.
- If you do not know which machines, containers, cloud accounts or sites are in scope, ask me for the list before you start.
- If a machine cannot be reached or a command fails, say so. Do not guess.

Steps:
1. Find where WordPress core runs: servers, containers and their hosts, cloud services, sites.
2. On each one, read the installed version and the settings the alert names. The alert gives these commands:

    wp core version

    wp theme list --status=active
    wp theme list --status=parent
    wp theme path <theme-slug> --dir

3. Compare each version with the affected and fixed versions above. When a vendor or a distribution ships its own fixed package, the alert names it.
4. Report: one line per machine or service with the version found, Affected, Not affected or Unknown, and the evidence (the command and its output). Then the actions to take, in order, from the alert's "How to fix" section, and what you could not check.

Key facts

FactDetail
ProductWordPress core (self-hosted website software)
Affected versions7.1 to 7.1.1, 7.0 to 7.0.5, 6.9 to 6.9.8, and so on down to 4.7 to 4.7.36; every version below 4.7
Fixed in7.1.2; older branches in 7.0.6 down to 4.7.37; 7.1.3 is current; no fix for versions below 4.7
Severity9.2 Critical (CVSS 4.0, WordPress); 8.1 High (CVSS 3.1, CISA)
Who can attackAnyone on the internet, no login needed; the theme must have a top-level folder whose name starts with page-
ExploitedYes: in CISA's KEV catalog since 25 September 2026; Patchstack saw attacks from 22 September 2026
CVE published22 September 2026

What an attacker can do

WordPress picks a page template (the PHP file that builds a page) partly from the requested page name. Unpatched versions let a specially built web request push the template path out of the theme folder with ../. An attacker with no account can make WordPress run a PHP file from elsewhere on the server: local file inclusion.

The attacker can also write and run PHP files if the server has pearcmd.php, a file from the PHP package tool PEAR. This also needs the PHP setting register_argc_argv On and a folder the website can write to, such as /tmp. Running files this way is remote code execution (the attacker runs their own code on your server), with the rights of the account that runs your website. Robert Ressl, who found the flaw, says the damage depends on those rights. An attacker could reach database passwords, read or change site data, alter site files, or take the site offline.

Who is affected

Your site can be open to the file inclusion only if both of these are true:

  • Your version is unpatched: any version below its branch's patched release (branch: versions with the same first two numbers, such as 6.9.x). WordPress lists patched releases for branches 4.7 to 7.1 and none for older versions. The CVE record counts every version before 7.1.2 as affected.
  • Your active theme, or its parent theme if it is a child theme, has a top-level folder whose name starts with page-, such as page-templates. WordPress lists Twenty Twelve, Twenty Fourteen, Neve, Hestia and Sydney as having one. Ressl saw none in the Twenty Twenty-Three, Twenty Twenty-Four and Twenty Twenty-Five versions he checked.

Ressl lists further conditions, such as a published page that can be reached by its ID.

The known route to code execution needs pearcmd.php, register_argc_argv On, and a folder the website can write to, such as /tmp. WordPress says the official php Docker image (a ready-made server package) and a default setup of the cPanel hosting control panel with PHP before 8.5 are affected.

How to check your version

If WP-CLI (the WordPress command-line tool) is on the server, run:

shell
wp core version

On the 7.1 branch, 7.1.2 or later is fixed, and anything earlier is vulnerable. Other branches have their own fixed release, such as 7.0.6, 6.9.9 or 4.7.37. Without WP-CLI, open Tools > Site Health > Info in the admin area and read Version in the WordPress section. Versions 4.7 to 5.1 lack that screen. On those, read the At a Glance box on the Dashboard home, or $wp_version in wp-includes/version.php.

Then find your theme's name and its folder:

shell
wp theme list --status=active
wp theme list --status=parent
wp theme path <theme-slug> --dir

Look there for a top-level folder whose name starts with page-. For the server condition, check register_argc_argv in your website's PHP settings. Ressl warns that command-line PHP may use different settings. Check them through the site itself, for example with a temporary phpinfo() page, which lists the settings.

What to do now

  1. Update WordPress today: Dashboard > Updates > Update Now. Install 7.1.3, or your branch's latest release, such as 7.0.7 or 4.7.38. Below 4.7 there is no fix, so move to the latest WordPress version. The first patched releases, such as 7.1.2, 7.0.6 and 4.7.37, lack later security updates, and WordPress flags them as insecure.
  2. Until you update, have your firewall block any pagename containing ../, even encoded, in addresses or form data.
  3. Turn off register_argc_argv for web requests and remove unused pearcmd.php files. This blocks the known route to code execution; the inclusion stays open until you update.
  4. Search your access logs, ignoring letter case. Look for pagename containing %2e%2e or %252e%252e, which encode ... Also look for pagename with page_id on / or /index.php, and for pearcmd. Most attempts use POST form data, which these logs skip, so a clean result does not rule out an attempt.
  5. If you find unexpected .php files in /tmp or /var/tmp, assume an attacker controls the server.

Is it being exploited?

Yes. CISA (the US cybersecurity agency) added CVE-2026-87902 to its Known Exploited Vulnerabilities catalog on 25 September 2026, with a patch deadline of 28 September 2026 for federal agencies. On the CVSS severity scale, it rates the flaw 8.1 out of 10, against 9.2 from WordPress.

Patchstack, a WordPress security company, says its firewall blocked the first attack attempt at 11:49 UTC on 22 September 2026, the day 7.1.2 came out. The first attempt to write a file through pearcmd followed at 15:34 UTC. That day, Ressl also published code that demonstrates the attack.

By 23 September 2026, attackers were writing PHP files to /tmp and /var/tmp. A ready-made check for this flaw in the free Nuclei scanner was in public use. Attack traffic came from a few hundred IP addresses, and Patchstack says blocking single addresses does not stop it. In your logs, a normal page address that returns a feed file, such as RSS or OPML, shows the file inclusion ran.

Get help

Updating closes this flaw. Flaws in your own code get no CVE and no update, and a test of your app is how they are found.

Web app and API security test

A penetration test of your web app and its API: who can see whose data, and what an attacker can change.

From AED 20,000, excl. 5% VAT

Ask for a quote Book a call

Sources

  1. GHSA-7hp8-65ch-5whp: Unauthenticated path traversal in page-template resolution leading to conditional RCE WordPress (GitHub security advisory)
  2. WordPress 7.1.2 Release WordPress.org
  3. CVE-2026-87902 record CVE Program
  4. Known Exploited Vulnerabilities Catalog CISA
  5. CVE-2026-87902: Attackers Started Probing WordPress Sites Hours After the Patch Patchstack
  6. CVE-2026-87902: Critical WordPress file inclusion and conditional RCE Robert Ressl (finder)

More CVE alerts

All CVE alerts