WordPress: Unauthenticated path traversal leading to conditional RCE
Security Alert: WordPress Unauthenticated Path Traversal leading to Conditional RCE
A critical security vulnerability has been identified in WordPress involving unauthenticated path traversal during the resolution of page templates. This flaw can potentially be leveraged to achieve Remote Code Execution (RCE), provided specific environmental and configuration conditions are met.
🔍 Vulnerability Overview
The core of the issue lies within the get_page_template() function. An attacker who is not authenticated can manipulate this process to force the system to include a local .php file located outside of the designated active theme directories.
Attack Vector Flow
⚠️ Conditions for RCE
This vulnerability is "conditional," meaning RCE is not guaranteed on every installation. For a successful exploit leading to code execution, the following criteria must be satisfied:
1. Theme Structure Requirements
The active parent or child theme must contain a top-level directory that begins with the prefix page- (for example, a folder named page-templates/).
Known affected themes include:
Twenty Eleven(Not listed) Twenty Twelve- Twenty Fourteen
- Neve
- Hestia
- Sydney
2. File Availability
There must be a target .php file residing on the server that is readable by the account running the web server.
3. Server Environment (The PEAR Path)
A common exploitation route involves the pearcmd.php file. The transition from PEAR RCE is possible if the following PHP configuration is active:
register_argc_argv = On
Note on Affected Environments:
- The official Docker PHP image is vulnerable.
- Default cPanel configurations are vulnerable when utilizing PHP versions older than 8.5.
🛠️ Version Impact & Remediation
The vulnerability spans a vast range of WordPress versions. The fix has been released in version 7.1.2 and backported to legacy branches as a courtesy.
Version Mapping Table
| Affected Version Range | Patched Version |
|---|---|
7.1.0 - 7.1.1 | 7.1.2 |
7.0.0 - 7.0.5 | 7.0.6 |
6.9.0 - 6.9.8 | 6.9.9 |
6.8.0 - 6.8.9 | 6.8.10 |
6.7.0 - 6.7.8 | 6.7.9 |
6.6.0 - 6.6.8 | 6.6.9 |
6.5.0 - 6.5.11 | 6.5.12 |
6.4.0 - 6.4.11 | 6.4.12 |
6.3.0 - 6.3.11 | 6.3.12 |
6.2.0 - 6.2.12 | 6.2.13 |
6.1.0 - 6.1.13 | 6.1.14 |
6.0.0 - 6.0.15 | 6.0.16 |
5.9.0 - 5.9.17 | 5.9.18 |
5.8.0 - 5.8.16 | 5.8.17 |
5.7.0 - 5.7.18 | 5.7.19 |
5.6.0 - 5.6.20 | 5.6.21 |
5.5.0 - 5.5.21 | 5.5.22 |
5.4.0 - 5.4.22 | 5.4.23 |
5.3.0 - 5.3.24 | 5.3.25 |
5.2.0 - 5.2.27 | 5.2.28 |
5.1.0 - 5.1.25 | 5.1.26 |
5.0.0 - 5.0.28 | 5.0.29 |
4.9.0 - 4.9.32 | 4.9.33 |
4.8.0 - 4.8.31 | 4.8.32 |
4.7.0 - 4.7.36 | 4.7.37 |
📊 Severity Analysis
The overall severity is rated as Critical.
Detailed Metrics Breakdown
Exploitability
- Attack Vector:
Network(Remote exploitation possible) - Attack Complexity:
Low(No significant evasion required) - Attack Requirements:
Present(Requires specific theme/server config) - Privileges Required:
None(Unauthenticated) - User Interaction:
None(No victim action needed)
Impact
- Confidentiality:
High(Unauthorized access to sensitive data) - Integrity:
High(Unauthorized modification of system data) - Availability:
High(Potential for total system disruption)
Metric Definitions
- Attack Vector: Measures how remote the attacker can be. Network-based attacks are more severe than physical ones.
- Attack Complexity: Measures the effort to bypass security controls. Low complexity means the exploit is more reliable.
- Attack Requirements: Prerequisites of the deployment (e.g., specific software versions) that enable the attack.
- Privileges Required: The level of access an attacker needs before starting. In this case, none.
- User Interaction: Whether a legitimate user must perform an action for the attack to work.
- Confidentiality/Integrity/Availability: The "CIA triad" measuring the damage to data privacy, data accuracy, and system uptime.