Hacker News front pageWordPress1 min readintermediate
WordPress: Unauthenticated path traversal leading to conditional RCE
Summary
WordPress 7.1.2 patches an unauthenticated path‑traversal in get_page_template() that lets an attacker include arbitrary readable PHP files outside the theme when a top‑level "page-" directory exists. The bug can lead to remote code execution on systems with a readable PHP payload (e.g., pearcmd.php) and register_argc_argv enabled.
- Unauthenticated attackers can abuse get_page_template() to include any readable .php file outside the theme if the theme has a top‑level directory starting with "page-".
- Exploitation requires a readable local PHP file (e.g., pearcmd.php) and register_argc_argv=On; Docker php image and older cPanel setups are vulnerable.
- Affected themes include legacy Twenty Twelve/Fourteen and popular third‑party themes like Neve, Hestia, and Sydney.
- WordPress 7.1.2 patches the issue; the fix is back‑ported to all branches back to 4.7.
WordPress site operators using affected themes or PHP configurations must upgrade to prevent remote code execution.
5/10



