What is CVE-2026-87902?
CVE-2026-87902 is a WordPress core vulnerability that lets a remote attacker, with no account and no user interaction, make page-template resolution (get_page_template()) include a readable local .php file located outside the active theme. If the server and the theme meet certain preconditions, it ends in remote code execution (RCE).
It is a path traversal that leads to local file inclusion (LFI): WordPress builds page-{$pagename}.php from the pagename query variable without checking that the path stays inside the theme.
The fix shipped on September 22, 2026, in WordPress 7.1.2, with backports down to the 4.7 branch. WordPress scores it CVSS v4.0 9.2 (Critical) and CISA, in the CVE record, CVSS v3.1 8.1 (High).
It is being actively exploited. CISA added it to its Known Exploited Vulnerabilities (KEV) catalog on September 25, 2026. Patchstack saw attempts on the day of the patch, including PHP files being written through pearcmd.php, and by September 23 public scanning tooling was in circulation.
Are you affected?
The vulnerable code is in every WordPress release from 4.7.0 onward that is not on a fixed version, regardless of theme. To reach code execution, the WordPress advisory requires two preconditions:
-
Theme: the active theme (parent or child) has a top-level directory whose name starts with
page-(for examplepage-templates). The advisory names Twenty Twelve, Twenty Fourteen, Neve, Hestia and Sydney: check the filesystem, not the theme name. -
Server: a local
.phpfile readable by the web server account that can serve as the target; the well-known case is PEAR'spearcmd.phpwithregister_argc_argvset toOn.
According to the advisory, the official php Docker image and the default cPanel configuration with PHP older than 8.5 meet the server precondition (EasyApache 4's default php.ini sets register_argc_argv = On for ea-php74 through ea-php84 and Off for ea-php85); you or your provider may have changed it. Without these preconditions there is still file inclusion (an information leak, per Patchstack), so update anyway.
Versions: you are vulnerable if your version is older than the first fixed release of its branch: 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. WordPress.org now flags even those releases as insecure: update to the newest release of your branch (as of November 12, 2026, for example 7.1.4 on 7.1 or 6.8.12 on 6.8). Releases before 4.7 are unsupported and have no fix: do not assume they are safe.
Distribution packages (only if you did not install from wordpress.org), as of November 12, 2026:
- Debian 13: fixed in
6.8.10+dfsg1-0+deb13u1(DSA-6525-1); the security archive offers6.8.12+dfsg1-0+deb13u1. - Debian 12 and Ubuntu 22.04, 24.04 and 26.04: vulnerable or "Needs evaluation", with no fix published.
For other releases or packages (such as EPEL), check your distribution's security tracker.
Red Hat does not ship WordPress in the RHEL repositories, but WordPress installed from wordpress.org on RHEL, AlmaLinux, Rocky Linux or CloudLinux, with or without cPanel or DirectAdmin, is affected as on any other system.
How to check your site
Run these read-only commands as the site's user, not as root; YOUR_WORDPRESS_PATH is the directory that contains wp-config.php. Installed version, with WP-CLI (does not load plugins or themes) or without it:
wp core version --path=YOUR_WORDPRESS_PATH
grep -F '$wp_version =' YOUR_WORDPRESS_PATH/wp-includes/version.php
With the Debian or Ubuntu package, compare the version with their trackers (see Sources):
dpkg -l wordpress 2>/dev/null | tail -n 1; apt-cache policy wordpress
Active theme (active in status; parent is its parent theme). This command does load WordPress: skip it if you suspect the site is compromised.
wp theme list --fields=name,status,version --skip-update-check --path=YOUR_WORDPRESS_PATH
Directories or symlinks named page-* at the top level of each theme (only the active theme and its parent count). An empty result does not mean you are safe: the only fix is to update.
find YOUR_WORDPRESS_PATH/wp-content/themes -maxdepth 2 -name 'page-*' \( -type d -o -type l \)
For register_argc_argv, check the PHP configuration the website uses (PHP-FPM or web SAPI), not php -i on the command line, which can show a different value.
How to mitigate
| Option | Best for | Fixes the flaw? |
|---|---|---|
| A: update WordPress | Every site | Yes, durably |
| B: filter pagename at the firewall | While you schedule the update | No, temporary |
| C: disable register_argc_argv | Servers with the directive On | No, it only breaks the chain to RCE |
Option A: update WordPress (recommended)
Update every site to the newest release of its branch from the dashboard (Updates, Update Now) or with WP-CLI. This command modifies the site: back up files and database first, and run it as the site's user. It only updates within the current branch:
wp core update --minor --path=YOUR_WORDPRESS_PATH
Automatic updates for minor releases are on by default unless AUTOMATIC_UPDATER_DISABLED, WP_AUTO_UPDATE_CORE or a filter disables them: do not assume they ran. If you use a distribution package, update it with your package manager.
The newest release of each branch also fixes CVE-2026-119977, another WordPress core RCE in the upgrade process, added to the KEV catalog on November 3, 2026.
Option B: filter pagename (temporary workaround)
Patchstack suggests rejecting, at your web application firewall or reverse proxy, requests with path traversal sequences in pagename, since a real slug never contains one. The rule must cover %2e%2e, %252e%252e and the POST body. It does not fix the flaw.
Option C: disable register_argc_argv
According to Patchstack, setting register_argc_argv to Off does not fix the inclusion, but it breaks the pearcmd.php chain. The PHP manual recommends register_argc_argv=0 outside the CLI after verifying that it is safe; code that reads $argv or $argc in web requests will stop working. Check /tmp and /var/tmp before restarting PHP-FPM or the web server: with systemd PrivateTmp, a service's temporary files are removed when it stops.
Detecting signs of compromise
Patchstack's indicators:
-
pagenamecontaining%2e%2eor%252e%252e, in the query string or the POST body, or beginning withtemplates%2for anotherpage-directory. - Requests containing
pearcmd,+config-showor+config-create. - A 200 response carrying OPML or RSS output from a normal page URL: the inclusion ran on your host.
- The user agents
cve-2026-87902-poc/1.0andnuclei-cve-2026-87902/1.0; most of the rest spoof a browser, so do not filter on user agent or IP alone.
Apache logs on Debian and Ubuntu, compressed ones included (on nginx, /var/log/nginx/access.log*; adjust the path if each site has its own logs). Logs do not record POST bodies, so finding nothing does not prove you were not attacked:
zgrep -i -E 'pagename=[^ ]*%(25)?2e%(25)?2e|pearcmd|config-(show|create)' /var/log/apache2/access.log*
Unexpected PHP files in /tmp and /var/tmp (Patchstack saw names such as wp-pear-rce-flag.php, poc87902.php, luci_*.php or zeta_*.php). Run it as root so it includes the /tmp/systemd-private-* directories:
find /tmp /var/tmp -type f -name '*.php' -ls
If any show up, Patchstack says to treat the host as compromised; preserve evidence before deleting. An empty result is not conclusive: the attacker can write wherever the PHP user has permission to.
After mitigating
- Confirm each site's version with
wp core version. - Verify core files (this does not check plugins, themes or
/tmp: a clean result is not conclusive):wp core verify-checksums --path=YOUR_WORDPRESS_PATH - If you were exposed while unpatched, review historical logs for the indicators above.
- If a request reached the vulnerable path, treat the site as compromised: review administrator accounts, recent or modified plugins, scheduled tasks and unexpected PHP files, and start a full incident response.
- If you confirm a compromise, we also recommend changing the database password, the
wp-config.phpkeys and the administrator credentials.
Need help?
Open a ticket at soporte.telecu.cloud and reference: CVE-2026-87902.
Sources
- WordPress: Security advisory GHSA-7hp8-65ch-5whp
- WordPress.org: WordPress 7.1.2 release announcement
- CVE Program: CVE-2026-87902 record
- CISA: Known Exploited Vulnerabilities catalog
- Debian: Security tracker: CVE-2026-87902
- Ubuntu: CVE-2026-87902 status
- Patchstack: CVE-2026-87902 exploitation and indicators