WordPress Core <= 7.1.1 — Unauthenticated Local File Inclusion via locate_template() Path Traversal
CVE-2026-87902Published · Updated Action summary
Affected: ≤7.1.1Update to 4.7.37 or 4.8.32 or 4.9.33 or 5.0.29 or 5.1.26 or 5.2.28 or 5.3.25 or 5.4.23 or 5.5.22 or 5.6.21 or 5.7.19 or 5.8.17 or 5.9.18 or 6.0.16 or 6.1.14 or 6.2.13 or 6.3.12 or 6.4.12 or 6.5.12 or 6.6.9 or 6.7.9 or 6.8.10 or 6.9.9 or 7.0.6 or 7.1.2 or newer
Fixed versions are per release branch: update to the fix for the branch you run.
All remediation stepsOn this page3
Overview
- Advisory ID
- CVE-2026-87902
- Product
- WordPress wordpress
- Affected
- ≤7.1.1
- Fixed in
- 4.7.37, 4.8.32, 4.9.33, 5.0.29, 5.1.26, 5.2.28, 5.3.25, 5.4.23, 5.5.22, 5.6.21, 5.7.19, 5.8.17, 5.9.18, 6.0.16, 6.1.14, 6.2.13, 6.3.12, 6.4.12, 6.5.12, 6.6.9, 6.7.9, 6.8.10, 6.9.9, 7.0.6, 7.1.2
- Weakness
- CWE-98 Local File Inclusion
- Required access
- No account needed
- Published
- · updated
- Credit
- Robert Ressl
- Source
- Wordfence Intelligence
- Affected≤ 7.1.1
- Patched in4.7.37 / 4.8.32 / 4.9.33 / 5.0.29 / 5.1.26 / 5.2.28 / 5.3.25 / 5.4.23 / 5.5.22 / 5.6.21 / 5.7.19 / 5.8.17 / 5.9.18 / 6.0.16 / 6.1.14 / 6.2.13 / 6.3.12 / 6.4.12 / 6.5.12 / 6.6.9 / 6.7.9 / 6.8.10 / 6.9.9 / 7.0.6 / 7.1.2
Update to 4.7.37 / 4.8.32 / 4.9.33 / 5.0.29 / 5.1.26 / 5.2.28 / 5.3.25 / 5.4.23 / 5.5.22 / 5.6.21 / 5.7.19 / 5.8.17 / 5.9.18 / 6.0.16 / 6.1.14 / 6.2.13 / 6.3.12 / 6.4.12 / 6.5.12 / 6.6.9 / 6.7.9 / 6.8.10 / 6.9.9 / 7.0.6 / 7.1.2 or newer.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HWhat does this vector mean?
AV:NAttack vector- Network
AC:HAttack complexity- High
PR:NPrivileges required- None
UI:NUser interaction- None
S:UScope- Unchanged
C:HConfidentiality- High
I:HIntegrity- High
A:HAvailability- High
WordPress Core is vulnerable to Local File Inclusion via the locate_template() function in various versions up to, and including, 7.1.1. The function resolved a caller-supplied template name against the theme directories without verifying the result stayed within them, so a template name containing '..' could resolve to a readable PHP file outside the active theme and be included. The core-reachable vector is get_page_template(), which builds page-{$pagename}.php from the URL-derived, url-decoded 'pagename' query variable. This makes it possible for unauthenticated attackers to make page-template resolution include a chosen readable local .php file outside the theme directories, which under certain conditions can lead to remote code execution. Exploitation requires (1) the active parent or child theme to contain a top-level directory whose name begins with 'page-' (e.g. 'page-templates' in Twenty Twelve, Twenty Fourteen, Neve, Hestia, Sydney), and (2) a readable .php target on the server accessible to the web-server account (e.g. pearcmd.php with register_argc_argv=On, as in the official PHP Docker image and default cPanel setups on PHP < 8.5), which yields RCE.
Not sure which version you run? Run a passive check — it reads public files only.
Remediation & mitigations
- Update to one of the following versions, or a newer patched version: 4.7.37, 4.8.32, 4.9.33, 5.0.29, 5.1.26, 5.2.28, 5.3.25, 5.4.23, 5.5.22, 5.6.21, 5.7.19, 5.8.17, 5.9.18, 6.0.16, 6.1.14, 6.2.13, 6.3.12, 6.4.12, 6.5.12, 6.6.9, 6.7.9, 6.8.10, 6.9.9, 7.0.6, 7.1.2
- Because this CVE is listed in CISA KEV, review the site for signs of compromise: unknown administrator accounts, new PHP files under wp-content/uploads, and unexpected redirects.
- Rotate administrator passwords and application secrets if the site ran a vulnerable version while publicly reachable.
References & provenance
Proof-of-concept & detection
This CVE is listed in CISA KEV. VulnCrest does not publish proof-of-concept code for KEV-listed vulnerabilities.
- UnreviewedGitHubabraxas/CVE-2026-87902
- UnreviewedGitHubvulpecuna/CVE-2026-87902
- UnreviewedGitHubressl/cve-2026-87902-poc
- UnreviewedGitHubpwnVader/CVE-2026-87902-PoC-pwnVader
- UnreviewedGitHubrabakuku/CVE-2026-87902-A-working-PoC-for-WordPress-s-critical-path-traversal
- UnreviewedGitHubdinosn/cve-2026-87902-wordpress-lfi-lab
- UnreviewedGitHubzer0dayf/CVE-2026-87902
- UnreviewedGitHubHassham1/CVE-2026-87902
- UnreviewedGitHubynsmroztas/WPSniper
- UnreviewedGitHubbhideki/CVE-2026-87902
- UnreviewedGitHubtc4dy/CVE-2026-87902-Toolkit
- UnreviewedGitHubnextco/wordpress-cve-2026-87902
- UnreviewedGitHubzyphorixofficialmain-lab/cve-2026-87902
- UnreviewedGitHubcrowsec-edtech/CVE-2026-87902
- UnreviewedGitHubjoaovicdev/EXPLOIT-CVE-2026-87902
- UnreviewedGitHubSVTagan/WP-CVE-2026-87902
- UnreviewedGitHubitskill-jp/wordpress-upgrade-check
- UnreviewedGitHubrwxrwxs/CVE-2026-87902
- UnreviewedGitHublangz337/CVE-2026-87902
- UnreviewedGitHubabatsakidis/wp-cve-2026-87902-checker
- UnreviewedGitHubMaalfer/CVE-2026-87902-exploit
- UnreviewedGitHubHackfutSecRoot/CVE-2026-87902
- UnreviewedGitHubtonydelouvre/CVE-2026-87902
- UnreviewedGitHubxiaxiu555/cve-2026-87902
Third-party code, not reviewed by VulnCrest. Fake PoC repositories regularly contain malware. Read the code before running anything, and only run it against a lab you own.
Advisories & patches
- Advisorywordfence.com
Related CVEs
| Severity | Vulnerability | CVE | Published |
|---|---|---|---|
| Medium6.4 | Authenticated (Contributor+) DOM-Based Stored Cross-Site Scripting via 'data-text-sec', 'data-title', and 'title' Attributes via Custom HTML Block | CVE-2026-18742 | |
| High7.1 | Unauthenticated PHP Object Injection to Arbitrary File Deletion via 'comment_content'/'comment_agent' Parameter during Attachment Rename Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization≤4.2.19Update to 4.2.20VulnCrest analysis | CVE-2026-124969 | |
| Critical9.8 | Missing Authorization to Unauthenticated Arbitrary User Password Reset / Account Takeover via Webhook with 'Is the user ID' Field | CVE-2026-126173 | |
| High7.2 | Unauthenticated Stored Cross-Site Scripting via Comment User-Agent Header | CVE-2026-120688 |
- Medium6.4Authenticated (Contributor+) DOM-Based Stored Cross-Site Scripting via 'data-text-sec', 'data-title', and 'title' Attributes via Custom HTML Block
Flatsome
≤3.20.12Update to 3.20.13
- High7.1VulnCrest analysisUnauthenticated PHP Object Injection to Arbitrary File Deletion via 'comment_content'/'comment_agent' Parameter during Attachment Rename
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization
≤4.2.19Update to 4.2.20
- Critical9.8Missing Authorization to Unauthenticated Arbitrary User Password Reset / Account Takeover via Webhook with 'Is the user ID' Field
AutomatorWP Webhooks
≤1.4.4Update to 1.4.5
- High7.2Unauthenticated Stored Cross-Site Scripting via Comment User-Agent Header
EZ SQL Reports Shortcode Widget and DB Backup
≤5.25.25Update to 5.26.45
Timeline
CVE published
Severity high, CVSS 8.1
Record last updated
Sources & licenses
Wordfence record- Vulnerability data
- Wordfence Intelligence. Copyright 2012-2026 Defiant Inc. Licensed under the CC BY-SA 4.0.
- CVE® identifiers
- Copyright 1999-2026 The MITRE Corporation. Used under the CVE Program. CVE® is a registered trademark of The MITRE Corporation.
- CVSS / CWE
- National Vulnerability Database (NVD), shown unmodified. This product uses the NVD API but is not endorsed or certified by the NVD.
- KEV status
- CISA Known Exploited Vulnerabilities catalog (CC0 1.0).
- EPSS
- Exploit Prediction Scoring System by FIRST.org.
- VulnCrest content
- Summary, remediation guidance and page layout © VulnCrest. Not sourced from NVD.
