Security Advisory vulnerability and BitFire protection

How BitFire FREE Blocks CVE-2026-unassigned Template Inclusion

WordPress vulnerability research

BitFire FREE blocks the double-encoded traversal before vulnerable WordPress template resolution can include an attacker-selected PHP file.

Unauthenticated High Severity (CVSS 7.1) Conditional Remote Code Execution Path Traversal / Local File Inclusion
BitFire · Vulnerability advisoryResearch published
AdvisorySecurity Advisory
ComponentWordPress Core 7.1.1 Template Resolution
Relevant sourcewp-includes/template.php: get_page_template() and locate_template()
Executive summary

What WordPress administrators need to know

The unassigned CVE-2026 double decode template server side include vulnerability affects WordPress Core through 7.1.1. An unauthenticated POST combines an existing published content ID with a doubly encoded `pagename`. PHP performs the first URL decode, then `get_page_template()` decodes the value again and turns the resulting traversal into a template candidate. On a qualifying classic theme, WordPress can include an attacker-selected local file ending in `.php`; code execution additionally requires a suitable attacker-influenced PHP file already on disk. BitFire FREE generic web-attack blocking detects and blocks the encoded path traversal before WordPress runs, while Bot Protection stops restricted automated clients from delivering the required POST.

At a glance

Key facts

  • No WordPress account or nonce is required
  • The POST must name an existing published post or page and target a qualifying classic theme
  • A second URL decode turns preserved percent octets into traversal inside template resolution
  • The primitive includes or discloses local files whose names end in .php
  • Code execution requires a suitable attacker-influenced PHP file already present on disk
  • WordPress 7.1.2 validates decoded names and confines resolved templates to approved directories
01
Vulnerability overview

Understand the exposure

The affected component, attack path, and practical risk for WordPress websites.

Affected componentWordPress Core 7.1.1 Template Resolution
Potential reach+100,000,000 installations
Attack techniquepath traversal and local file inclusion
Published2026-09-22
BitFire FREE blocks the recognizable double-encoded traversal at the request boundary, before WordPress can turn it into a server-side PHP include.
02
Technical analysis

How the vulnerability works

Research details, affected versions, exploitation behavior, and remediation guidance.

How the Double Decode Becomes a Local File Include

PHP first URL-decodes the public `pagename` query value. WordPress query hardening applies `wp_basename()` and `sanitize_title_for_query()`, but percent-encoded octets can survive because no literal slash exists yet. The vulnerable `get_page_template()` code calls `urldecode()` again, materializing `../` only after that earlier processing. It then constructs `page-<decoded value>.php`; `locate_template()` joins the candidate to the active theme and the template loader includes the result. Exploitation requires a POST, any existing published post or page ID, and an active classic theme with a subdirectory beginning `page-`. Block themes are not affected by this PHP-template path. GET probes redirect and do not execute. The include can reach outside the document root, but its target must end in `.php`.

BitFire FREE Blocks the Exploit Before WordPress Runs

BitFire FREE WAF protection inspects the URL and query string before WordPress processes them. This attack must carry recognizable double-encoded path-traversal octets in `pagename`; generic web-attack blocking detects that traversal/server-side-include pattern and rejects the request. The vulnerable second decode therefore never executes, no template path escapes the theme, and the attacker-selected PHP file is never included. This behavior-based protection does not wait for a CVE-specific virtual patch, which is decisive while this issue remains unassigned. BitFire Bot Protection adds an independent delivery barrier: unknown or restricted bots cannot submit the required POST, and fake browsers must pass JavaScript verification before restricted actions. A real verified browser can pass that client check, but the WAF still evaluates its malicious payload. These FREE request-layer controls are available to eligible non-commercial websites; commercial sites require the appropriate license.

WordPress 7.1.2 Closes Both Trust-Boundary Failures

Update to WordPress 7.1.2 immediately. The first fix requires the decoded page name to pass `validate_file()` before it may enter the template hierarchy, blocking `../`, `./`, and drive-letter paths at the source. A second defense in `locate_template()` checks traversal-bearing candidates with `realpath()` and permits only approved theme locations or `wp-includes/theme-compat`. Lab verification described in the supplied analysis confirmed that the patched file stopped inclusion from uploads, inclusion outside the document root, and disclosure of `.php`-suffixed files while normal rendering continued. WAF protection is a strong immediate barrier, not a substitute for removing the vulnerable Core code.

If Your Site Was Affected, Investigate for Persistence.

Patching closes the known template-resolution path but does not remove an earlier compromise. Any site that ran WordPress 7.1.1 or earlier with a qualifying classic or child theme should investigate now, remove discovered persistence, and rotate relevant WordPress, hosting, database, SSH, and SFTP credentials. BitFire Threat Hunter performs the deeper post-compromise review this incident demands. It can discover backdoor WordPress administrator accounts, hidden database triggers, long-running PHP processes, and droppers capable of restoring malware or reinfecting the site. Review access logs for matching POSTs and redirected GET probes, but do not treat the absence of an obvious malicious file as proof that the site is clean.

Deploy BitFire FREE and Patch WordPress Now

BitFire FREE delivers immediate, practical protection against this newly disclosed attack: Bot Protection shuts down automated POST delivery, and the WAF blocks the double-encoded traversal before vulnerable WordPress code can resolve or include a file. Enable BitFire, upgrade every affected site to WordPress 7.1.2, and use Threat Hunter to investigate systems that ran a vulnerable configuration. Layered prevention plus disciplined incident response is the fastest route from urgent disclosure to a defensible WordPress deployment.

03
Source review

Vulnerable and fixed code

The relevant source is located in wp-includes/template.php: get_page_template() and locate_template().

BeforeVulnerable behavior
$pagename_decoded = urldecode( $pagename );
if ( $pagename_decoded !== $pagename ) {
    $templates[] = "page-{$pagename_decoded}.php";
}
AfterCorrected behavior
// Corrected behavior, abridged from the supplied writeup.
$pagename_decoded = urldecode( $pagename );
if ( $pagename_decoded !== $pagename
    && 0 === validate_file( $pagename_decoded ) ) {
    $templates[] = "page-{$pagename_decoded}.php";
}
// locate_template() also rejects resolved paths outside approved theme directories.
04
Zero-day protection

Protection from the first exploit request

BitFire protects WordPress servers on day zero—before a vulnerability is publicly known and before other vendors have time to develop signatures or patches.

01 · VerifyStop unknown clients

Bot controls and browser verification stop untrusted automated clients before previously unknown exploit code reaches WordPress.

02 · DetectBlock malicious behavior

General WAF protections identify dangerous request behavior and hostile payloads without waiting for a vulnerability-specific signature.

03 · PreventContain attacks at runtime

RASP follows execution inside PHP and prevents unauthorized changes to protected files, accounts, and database content.

BitFire · WordPress protectionZero-day ready
BitFire zero-day WordPress vulnerability protection
BitFire combines verified-client controls, behavior-based WAF detection, and runtime RASP enforcement to protect WordPress before an exploit has a name, CVE, signature, or vendor patch.
About the author

Cory Marsh

Cory has more than 20 years of internet security experience and is a lead developer on the BitFire project.

Read BitFire security research →
Protect your WordPress website

Add protection before the next exploit arrives.

BitFire combines bot controls, request inspection, malware detection, and runtime protection in one WordPress security platform.

Protect my site free →