CVE-2026-87902
WordPress Core Remote File Inclusion Vulnerability
Description
CVE-2026-87902 is a high-severity PHP file inclusion vulnerability in WordPress Core. An unauthenticated attacker can make get_page_template() page-template resolution include a chosen readable local .php file from outside the active theme directories, and where the relevant preconditions for both the server and the active theme are met, that inclusion leads to remote code execution. The affected range spans essentially the whole supported history of WordPress, from versions below 4.7.37 through to 7.1.2, with a fixed release in every maintained branch. Given how much of the web runs on WordPress and how quickly attackers moved — Patchstack reported probing within hours of the patch — this file inclusion vulnerability is being scanned for at scale. CISA has added CVE-2026-87902 to the Known Exploited Vulnerabilities catalog, its EPSS score of 40.0% places it in the 99th percentile, and the remediation deadline of September 28, 2026 has already passed.
KEV Information
CVSS Score
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HOpen in CalculatorCWEs
Affected Products
| Vendor | Product | Version |
|---|---|---|
| wordpress | wordpress | < 4.7.37; >= 4.8, < 4.8.32; >= 4.9, < 4.9.33; >= 5.0, < 5.0.29; >= 5.1, < 5.1.26; >= 5.2, < 5.2.28; >= 5.3, < 5.3.25; >= 5.4, < 5.4.23; >= 5.5, < 5.5.22; >= 5.6, < 5.6.21; >= 5.7, < 5.7.19; >= 5.8, < 5.8.17; >= 5.9, < 5.9.18; >= 6.0, < 6.0.16; >= 6.1, < 6.1.14; >= 6.2, < 6.2.13; >= 6.3, < 6.3.12; >= 6.4, < 6.4.12; >= 6.5, < 6.5.12; >= 6.6, < 6.6.9; >= 6.7, < 6.7.9; >= 6.8, < 6.8.10; >= 6.9, < 6.9.9; >= 7.0, < 7.0.6; >= 7.1, < 7.1.2 |
References
- https://github.com/WordPress/wordpress-develop/security/advisories/GHSA-7hp8-65ch-5whp(Vendor Advisory)
- https://patchstack.com/articles/cve-2026-87902-attackers-started-probing-wordpress-sites-hours-after-the-patch/(Third Party Advisory)
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-87902(US Government Resource)
Weakness Type
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program
This weakness occurs when a PHP application builds an include or require path from externally influenced input without validating it, so an attacker chooses which file the interpreter executes. In WordPress, the template resolution performed by get_page_template() can be steered to a .php file outside the active theme directories; because PHP executes whatever it includes, a file the attacker can point at becomes code running inside WordPress.
Learn more: CWE-98 — Improper Control of Filename for Include/Require Statement in PHP Program
Impact Analysis
CVE-2026-87902 has a CVSS 3.1 base score of 8.1 (High) with the vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Attack Vector (Network), Privileges Required (None), User Interaction (None): the request comes from the internet with no account and no victim, which is the worst possible starting position for a defender and the reason mass scanning began immediately. Attack Complexity (High) reflects the vendor's own caveat — reaching code execution depends on preconditions on both the server and the active theme, so not every site is exploitable to the full extent, but the inclusion itself is the generic part and the conditions are common enough that the EPSS model puts this in the 99th percentile. Confidentiality, Integrity and Availability (all High): code executing inside WordPress reads wp-config.php and therefore the database credentials, can modify posts, users and plugins, can plant a persistent web shell, and can take the site down. For agencies and hosts running many sites on shared infrastructure, one exploited instance frequently becomes many. Treat an unpatched, internet-facing WordPress as already probed.
Exploit Maturity
CISA has added CVE-2026-87902 to the Known Exploited Vulnerabilities catalog, confirming exploitation in the wild, and the remediation deadline of September 28, 2026 has already passed; the entry does not flag use in ransomware campaigns. Patchstack reported that attackers started probing WordPress sites hours after the patch, which is the characteristic pattern for WordPress Core issues: the fix is public in the source tree, the diff is small, and the affected installation base is enormous. The EPSS score of 40.0% places CVE-2026-87902 in the 99th percentile — among the highest exploitation probabilities assigned to any vulnerability, and an order of magnitude above most entries in this KEV batch. No packaged exploit appears in the reference set, but the GitHub security advisory and the public reporting give attackers everything they need. Every internet-facing WordPress site that ran an affected version should be assumed to have been probed and should be checked for a planted web shell, not merely updated.
Remediation
- Carry out the action CISA requires, immediately. Apply mitigations in accordance with the WordPress project's instructions, comply with CISA's BOD 26-04 "Prioritizing Security Updates Based on Risk" guidance and the "Forensics Triage Requirements", and discontinue use of the product if mitigations are unavailable. The KEV remediation deadline of September 28, 2026 has already passed.
- Update WordPress to the fixed release in your branch. The project shipped fixes across every maintained branch — among them 4.7.37, 4.8.32, 4.9.33, 5.9.18, 6.4.12, 6.8.10, 6.9.9, 7.0.6 and 7.1.2 — as documented in GHSA-7hp8-65ch-5whp. Sites with automatic background updates enabled usually received the patch already; verify the version rather than assuming it.
- Verify every site you operate, not just the flagship one. The breadth of the affected range means forgotten staging copies, multisite installations and sites on shared hosting are the likely stragglers; enumerate all WordPress installations under your control with their versions and confirm each one is on a fixed release.
- Check for compromise, because probing started within hours. Review web server logs for unusual requests around template and page parameters, search the webroot for recently created or modified
.phpfiles (web shells typically appear inwp-content/uploadsor theme directories), compare core files against the official checksums, look for unexpected administrator accounts, scheduled events and plugins, and rotate database credentials, salts inwp-config.phpand all administrator passwords. - Harden the PHP inclusion surface. Disable
allow_url_include, keepallow_url_fopenoff where possible, restrict PHP'sopen_basedirto the site's own directories so that no file outside them is readable for inclusion, prevent PHP execution inside upload directories at the web server level, and in your own code never derive an include path from request data — map input to a fixed allowlist instead.
Technical Details
WordPress resolves which template file to render through get_page_template(), and in the affected versions that resolution can be influenced so that it returns a path to a readable local .php file outside the active theme directories. The resulting include executes that file in the WordPress runtime context, which is the CWE-98 mechanism: the filename for an include statement is under external control, so the interpreter — not merely the file reader — acts on the attacker's choice. The advisory is explicit that full remote code execution depends on preconditions for both the server and the active theme, which is why NVD assigns High attack complexity despite the trivial reachability; the attacker needs a suitable .php file to be present and readable on the host, and the theme must take the code path that honours the chosen template. The CVSS vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H records the rest without qualification: remote, unauthenticated, no interaction, complete impact within the WordPress installation's own authority.
Frequently Asked Questions
Is CVE-2026-87902 being actively exploited?
Yes. CISA has added CVE-2026-87902 to the Known Exploited Vulnerabilities catalog, Patchstack observed attackers probing WordPress sites within hours of the patch, and the remediation deadline of September 28, 2026 has already passed. The EPSS score of 40.0% places the vulnerability in the 99th percentile for exploitation likelihood. Use in ransomware campaigns is not recorded in the KEV entry.
What products are affected by CVE-2026-87902?
CVE-2026-87902 affects WordPress Core across essentially its whole maintained history: versions below 4.7.37, and every branch from 4.8 through 7.1 below their respective fixed releases (for example 4.9.33, 5.9.18, 6.4.12, 6.8.10, 6.9.9, 7.0.6 and 7.1.2). Whether full code execution is achievable depends additionally on server configuration and the active theme.
How do I fix CVE-2026-87902?
Update WordPress to the fixed release in your branch, as listed in GHSA-7hp8-65ch-5whp; automatic background updates will have done this on many sites, but the version should be verified explicitly. Then check for compromise — scan the webroot for new .php files, compare core files against official checksums, review administrator accounts — and rotate database credentials, wp-config.php salts and admin passwords.
How severe is CVE-2026-87902?
CVE-2026-87902 is rated High with a CVSS 3.1 base score of 8.1: unauthenticated and remotely reachable with full impact on confidentiality, integrity and availability, scored below critical only because reaching code execution depends on server and theme preconditions. Its EPSS score of 40.0% in the 99th percentile is exceptionally high and reflects both the vast installation base and the immediate start of mass probing.
Need Help With Vulnerability Management?
Our security experts can help you prioritize and remediate vulnerabilities effectively.