Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-87902 — Scans WordPress Core 4.7.0–7.1.1 for CVE-2026-87902 unauthenticated LFI via double-encoded pagename traversal, with optional PEAR config-create RCE escalation and mass scanning. | Kitploit
Tools/GitHubGitHub/langz337/cve-2026-87902
ReconnaissanceVulnerability ScannersWeb Vulnerability ScannersExploitationWeb Application ExploitationInformation GatheringWeb SecurityPenetration TestingRemote Access Tool
GitHublangz337/cve-2026-87902

CVE-2026-87902

11 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Scans WordPress Core 4.7.0–7.1.1 for CVE-2026-87902 unauthenticated LFI via double-encoded pagename traversal, with optional PEAR config-create RCE escalation and mass scanning.

View Repository

CVE-2026-87902 — WordPress Core Unauthenticated Local File Inclusion (LFI → Conditional RCE)

WordPress Core get_page_template() / locate_template() Path Traversal Exploit Tool

For authorized security testing only. Unauthorized access to computer systems is illegal.


Vulnerability Overview

ItemDetails
CVE IDCVE-2026-87902
GHSA IDGHSA-7hp8-65ch-5whp
Vulnerability TypeCWE-98 — Improper Control of Filename for Include/Require
CVSS v3.18.1 (High) / CVSS 4.0: 9.2 (Critical)
Affected ComponentWordPress Core
Affected Versions4.7.0 through 7.1.1 (all branches)
Fixed Versions7.1.2 (and backports down to 4.7.37)
Authentication RequiredNone (Unauthenticated)
Attack VectorSingle GET request
Discovered ByRobert Ressl (via WordPress HackerOne program)
Disclosure DateSeptember 22, 2026
Exploited in the WildYes — listed in CISA KEV catalog

CVE-2026-87902 is an unauthenticated path traversal and local file inclusion (LFI) vulnerability in WordPress Core that affects every WordPress version released since 2016 (4.7.0 to 7.1.1). An attacker requires no account or authentication. By crafting a malicious pagename query parameter, the attacker can cause WordPress's page template resolution mechanism to include any readable .php file outside the active theme directory. Under specific server conditions (PHP register_argc_argv = On and a readable pearcmd.php), the vulnerability can be escalated to remote code execution (RCE).


Affected Versions

BranchFixed Version
4.7.x4.7.37
5.0.x5.0.29
5.3.x5.3.25
5.9.x5.9.18
6.0.x6.0.16
6.6.x6.6.9
6.9.x6.9.9
7.0.x7.0.6
7.1.x7.1.2

Technical Details

Root Cause

The vulnerability resides in get_page_template() in wp-includes/template.php. When the pagename query variable is present, the function constructs page-{$pagename}.php but fails to call validate_file() on that value to check for directory traversal. The candidate filename is then passed to locate_template(), which concatenates it with the theme directory path and only checks file_exists() — it does not verify the resolved path stays inside the theme directory. A template name containing ../ can therefore resolve to a readable PHP file outside the active theme and be included and executed.

Call Chain

GET /?page_id=&pagename= → WP_Query resolves page_id, matches a published page (avoids 404) → get_page_template() urldecode()s pagename, builds page-{$pagename}.php → locate_template() concatenates candidate to theme directory, resolves via file_exists() → template-loader executes realpath() + include

Double-Encoding Bypass

WordPress applies sanitize_title_for_query() to pagename, which replaces literal dots (.) with hyphens (-) to block traversal. It operates on already once-decoded input and does not recursively decode. The attacker sends %252e%252e%252f (double-encoded ../):

  1. The web server decodes once: %252e → %2e, %252f → %2f
  2. sanitize_title_for_query() sees %2e%2e%2f (no literal dots) and passes it through
  3. get_page_template() internally calls urldecode() again: %2e%2e%2f → ../
  4. The traversal sequence becomes effective

Exploitation Preconditions

  1. The active theme (parent or child) contains a top-level directory starting with page- (e.g., page-templates/).
  2. At least one published page exists whose ID can be supplied as page_id.
  3. The target file must end in .php (WordPress appends the extension).

Windows Host Note: Win32 normalizes .. lexically, so traversal may work even if the page- directory does not exist. On Linux, that directory must actually exist.

PEAR RCE Escalation

Conditions:

  • PHP register_argc_argv is set to On
  • A readable pearcmd.php exists on the server

The attacker includes pearcmd.php via LFI and abuses its config-create command to write a PHP file to the server, then includes that file again via LFI to execute arbitrary commands.


CVE Origin & Disclosure

Discoverer

CVE-2026-87902 was discovered and reported by Robert Ressl, a Switzerland-based security researcher.

Disclosure Process

Reported through the WordPress HackerOne program in July 2026. WordPress Security Team coordinated the fix and released it alongside WordPress 7.1.2 on September 22, 2026.

Disclosure Timeline

DateEvent
July 2026Robert Ressl reports the vulnerability via WordPress HackerOne program
September 22, 2026WordPress 7.1.2 released with the fix; advisory published
September 22, 2026Security backports released for branches 7.0 through 4.7
September 23, 2026Attackers begin probing vulnerable sites
September 25, 2026CISA adds CVE-2026-87902 to the KEV catalog

Tool Features

FeatureDescription
Version FingerprintingIdentifies WordPress version via meta generator, RSS feed, OPML, readme.html, asset ?ver=
Smart Version VerdictUses fixed-version mapping to determine whether the target is in the affected range
Theme DiscoveryExtracts active theme slug, detects parent theme, discovers page-* directories
Page ID DiscoveryFinds valid page IDs via REST API, page-id- body class, shortlinks
LFI Oracle ValidationUses safe files like wp-links-opml.php and wp-trackback.php as oracles with negative controls
Double-Encoded TraversalAutomatically double percent-encodes / and . to bypass sanitize_title_for_query()
PEAR RCE ExploitationTries common PEAR paths, writes and executes marker files via config-create
Mass ScanningMulti-threaded concurrent scanning of target lists
Result OutputPersists results to vuln_lfi.txt and vuln_lfitorce.txt

Requirements

  • Python 3.10+
  • requests library

pip install requests


Usage

Start

python3 CVE-2026-87902.py

Interactive menu:

[1] Single Scan LFI [2] Single Scan LFI + RCE [3] Mass Scan LFI [4] Mass Scan LFI + RCE [5] Exit

Single Target Scan (LFI Only)

Choose [1], enter the target URL:

url > https://target.example.com

Single Target Scan (LFI + RCE)

Choose [2], enter URL and command (default id):

url > https://target.example.com cmd > id

Mass Scanning

Choose [3] or [4], enter the file containing target URLs (one per line, # for comments):

file > targets.txt

Output Files

FileContent
vuln_lfi.txtConfirmed LFI targets
vuln_lfitorce.txtSuccessful RCE targets

Configuration

TIMEOUT = 8 # Request timeout (seconds) THREADS = 200 # Concurrent threads for mass scanning USE_ALL_ORACLES = False # Use all oracles (more accurate but slower)


Remediation

  1. Immediately upgrade WordPress to 7.1.2 or the latest version of your branch.
  2. If immediate upgrade is not possible:
    • Block requests containing .., %2e, %252e in the pagename parameter at the WAF or reverse proxy layer
    • Check whether the active theme contains a page-* directory
    • Confirm the PHP register_argc_argv setting
  3. Enable WordPress automatic background updates.

Disclaimer

This tool is intended for authorized security testing and educational purposes only. Users must ensure they have explicit written authorization for the target system. Unauthorized use may violate the CFAA, the UK Computer Misuse Act, and similar laws in other countries. The author assumes no liability for any misuse.


Reference

  • WordPress 7.1.2 Security Release Announcement
Download Tool