Attackers started poking at this one the same day the patch came out, working straight from the fix.

At a glance

  • CVE: CVE-2026-87902 (GHSA-7hp8-65ch-5whp).
  • Severity: 8.1 (High) at NVD. WordPress’s own advisory rates it Critical, 9.2 on CVSS 4.0.
  • Affected: every WordPress branch from 4.7 to 7.1 before its fixed release — for example 7.1.0–7.1.1, 7.0.0–7.0.5, 6.9.0–6.9.8, 6.8.0–6.8.9, all the way down to 4.7.0–4.7.36.
  • Known exploited: Yes — Patchstack saw the first attempts on 2026-09-22, and CISA added it to its KEV list on 2026-09-25.

What’s going on

When WordPress shows a page, get_page_template() works out which template file in your theme to load. An unauthenticated attacker can craft a request that makes that lookup climb out of the theme folder and include any readable .php file on the server. That’s a path traversal leading to a local file include.

Whether that becomes full code execution depends on two things lining up. First, your active (or parent) theme has a top-level folder whose name starts with page-, such as page-templates — that’s true for the old Twenty Twelve and Twenty Fourteen themes and popular ones like Neve, Hestia and Sydney. Second, there’s a useful PHP file to include: PEAR’s pearcmd.php is the classic one, and it can be abused when PHP’s register_argc_argv setting is on. WordPress says the official PHP Docker image and default cPanel setups on PHP older than 8.5 fit the bill. Patchstack watched attackers go from probing to writing PHP files into /tmp through pearcmd.php within a day, and a ready-made Nuclei scanning template was in circulation by 2026-09-23. It was reported by Robert Ressl.

Timeline

  • Disclosed: 2026-09-22 (WordPress 7.1.2 release)
  • Patch released: 2026-09-22, with backports to 4.7
  • Exploited in the wild: first attempts 2026-09-22, 11:49 UTC, per Patchstack
  • Added to CISA KEV: 2026-09-25

== UPDATE ==

The good news: every affected branch got a fix, so even an old site can patch without a major upgrade.

  • Patch available: Yep.
  • Fixed in: WordPress 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. Later releases include it too (7.1.5 is current as of this write-up).
  • How to apply: Sites with automatic background updates should already have it — check Dashboard → Updates and click Update Now if not. If you manage core with Composer, Git or your host’s tooling, update to the fixed release on your branch, or newer.
  • If you can’t patch yet: Patchstack suggests rejecting any request where the pagename parameter contains a traversal sequence (a real page slug never does), and turning off register_argc_argv, which doesn’t fix the include but breaks the pearcmd.php route to code execution. To check whether you were hit, look in your logs for pagename values containing %2e%2e or %252e%252e, or requests mentioning pearcmd, +config-show or +config-create, and look for unexpected .php files in /tmp and /var/tmp — if you find those, treat the server as compromised.

References