WordPress 7.1.2 fixes get_page_template() RCE flaw
WordPress 7.1.2 patches CVE-2026-87902, a remote code execution bug in get_page_template() that reaches back to 4.7. Update now, the project says.
3 min read
Drafted with AI from the sources linked in this article, then fact-checked and edited by Claire Whitmore before publishing. How we work

By the numbers
- fixed WordPress release
- 7.1.2
- oldest branch that gets the backport
- 4.7
- contributors to the release
- 30+
WordPress 7.1.2, released on September 22, 2026, fixes a flaw that can let an attacker run code on a site without logging in. The bug sits in get_page_template(), the function that picks which template file renders a page. It affects every WordPress version from 4.7 onward, so almost any site still receiving updates needs this one.
The WordPress 7.1.2 security release post tracks the bug as CVE-2026-87902 and GHSA-7hp8-65ch-5whp. It tells site owners plainly: "Because this is a security release, it is recommended that you update your sites immediately."
What the vulnerability does
The flaw is in page-template resolution. That is the step where WordPress decides which PHP file from the active theme should draw a page.
According to the release post, an attacker can steer that step so it loads a PHP file of their choosing. The file must already be readable on the server, but it can sit outside the active theme's folder. Loading and running an arbitrary PHP file is what makes this remote code execution, or RCE.
LWN.net's report describes it as a path traversal bug. Path traversal is a class of flaw where crafted input walks out of the folder a program meant to stay in. LWN says the attacker does not need an account, "in some limited circumstances."
Who is exposed
Not every site is exploitable. The release post says an attack needs "specific server environment and theme conditions." Neither source lists those conditions in detail.
| Item | Detail |
|---|---|
| Fixed release | WordPress 7.1.2, September 22, 2026 |
| Identifiers | CVE-2026-87902, GHSA-7hp8-65ch-5whp |
| Affected | WordPress 4.7 and later |
| Login needed | No |
| Condition | Specific server and theme setups |
| Reported by | Robert Ressl |
| Release lead | John Blackbourn |
The fix has been backported to every branch down to 4.7. The WordPress project notes that only the most recent version is actively supported, so older branches are a courtesy, not a promise.
LWN adds that ClassicPress, a community fork of WordPress, is affected too. Its security update was still pending when LWN reported.
How it was found
Robert Ressl reported the bug through responsible disclosure, the release post says. That means the project heard about it privately and shipped a fix before the details went public. More than 30 contributors worked on the release.
What this means for developers
Update first, investigate second. Check each site's version in the dashboard or with wp core version from WP-CLI, the WordPress command-line tool. Anything below 7.1.2 on the current branch needs the update. Sites pinned to an older branch should move to that branch's latest point release.
Do not assume auto-updates covered you. Automatic updates can be switched off, and staging copies are easy to forget. Check every environment, not just production.
If you build themes, review how your code chooses template files. The bug turns on template resolution reaching files outside the theme folder. Themes that build a template path from request data deserve a second look.
ClassicPress users should watch for their project's own fix, since the WordPress release does not cover the fork. Until it lands, treat those sites as exposed, and limit who can reach them where you can.
Keep an eye on your logs for odd template requests. Now that the fix is public, attackers can study the patch to learn where the weakness was.
Sources
- WordPress 7.1.2 Security Release - WordPress.org
- Critical WordPress RCE vulnerability announced - LWN.net
Related articles

Fedora 45 ships with RPM 6.1 blocking unsigned packages
Fedora 45 shipped November 3 with RPM 6.1, which refuses unsigned packages. A Tech AI Wire test on Fedora 44 and 45 shows the error and the fixes.

Drupal Commerce Core flaw exploited; update to 3.3.13 now
Attackers are using CVE-2026-118539, a highly critical access bypass in Drupal Commerce Core, to place fraudulent orders. Fixes: 3.3.13 and 8.x-2.41.

PHP2Shell's two critical PHP flaws, explained
PHP2Shell is two PHP flaws rated 9.2 that can let one request take over a web server. How they work, who is exposed and what fully fixes them.
The weekly digest
One email every Friday with the week's top stories from all six desks: AI, dev tools, coding, the tech industry, startups and what's next. Free, no spam.