WordPress Core <= 7.1.1 - Unauthenticated Local File Inclusion via locate_template() Path Traversal

8.1
Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')
CVE CVE-2026-87902
CVSS 8.1 (High)
Publicly Published September 22, 2026
Last Updated September 22, 2026
Researcher Robert Ressl

Description

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.

Wordfence blocked 203,374 attacks targeting this vulnerability in the past 24 hours.

References

Share

Vulnerability Details for WordPress

Software Type Core
Patched? Yes
Remediation 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
Affected Versions
  • 6.6 - 6.6.8
  • 6.7 - 6.7.8
  • 6.8 - 6.8.9
  • 6.9 - 6.9.8
Expand to see 21 more affected version ranges.
  • 7.0 - 7.0.5
  • 7.1 - 7.1.1
  • 4.7 - 4.7.36
  • 4.8 - 4.8.31
  • 4.9 - 4.9.32
  • 5.0 - 5.0.28
  • 5.1 - 5.1.25
  • 5.2 - 5.2.27
  • 5.3 - 5.3.24
  • 5.4 - 5.4.22
  • 5.5 - 5.5.21
  • 5.6 - 5.6.20
  • 5.7 - 5.7.18
  • 5.8 - 5.8.16
  • 5.9 - 5.9.17
  • 6.0 - 6.0.15
  • 6.1 - 6.1.13
  • 6.2 - 6.2.12
  • 6.3 - 6.3.11
  • 6.4 - 6.4.11
  • 6.5 - 6.5.11
Patched Versions
  • 4.7.37
  • 4.8.32
  • 4.9.33
  • 5.0.29
Expand to see 21 more patched versions.
  • 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

Recent vulnerabilities in WordPress

# Title CVE ID CVSS Researchers Date
1 WordPress Core 4.7.0 - 7.1.2 - Authenticated (Contributor+) Denial of Service via Block Editor URL Details 4.3 Anthropic October 7, 2026
2 WordPress Core 6.5.0 - 7.1.2 - Authenticated (Author+) Second-Order SQL Injection via WXR Export 4.8 Anthropic October 7, 2026
3 WordPress Core 4.7.0 - 7.1.2 - Authenticated (Author+) Unauthorized Sticky Post Modification via REST API 4.3 Anthropic October 7, 2026
4 WordPress Core 4.7.0 - 7.1.2 - Unauthenticated Sensitive Information Exposure via Comment Feeds CVE-2026-66666 5.3 Ananda Dhakal October 7, 2026
5 WordPress Core 4.7.0 - 7.1.2 - Authenticated (Contributor+) Stored Cross-Site Scripting via Imgur oEmbed 6.4 Zhengyu Liu, Jingcheng Yang, Gavin Zhong October 7, 2026
6 WordPress Core 4.7.0 - 7.1.2 - Conditional Action Hook Injection via Unregistered Post Status or Post Type 3.3 Alex Concha October 7, 2026
7 WordPress Core 7.1 - 7.1.2 - Unauthenticated Stored Cross-Site Scripting via Pending Comments 7.2 Thomas Chauchefoin October 6, 2026
8 WordPress Core <= 7.1 - Forced Theme Install/Preview and Selector Injection via Theme Installer Route 4.3 Paulos Yibelo September 17, 2026
9 WordPress Core <= 7.1 - Authenticated (Contributor+) Path Traversal via REST Templates Controller 4.3 Anthropic September 17, 2026
10 WordPress Core <= 7.1 - Authenticated (Administrator+) Missing Authorization to Network Plugin Activation (Multisite) 2.7 Jesse McNeil September 17, 2026

Did you know Wordfence Intelligence provides free personal and commercial API access to our comprehensive WordPress vulnerability database, along with a free webhook integration to stay on top of the latest vulnerabilities added and updated in the database? Get started today!

Learn more

Want to get notified of the latest vulnerabilities that may affect your WordPress site?
Install Wordfence on your site today to get notified immediately if your site is affected by a vulnerability that has been added to our database.

Get Wordfence

The Wordfence Intelligence WordPress vulnerability database is completely free to access and query via API. Please review the documentation on how to access and consume the vulnerability data via API.

Documentation