CVE-2026-87902: Attackers Started Probing WordPress Sites Hours After the Patch
An unauthenticated local file inclusion in WordPress page template resolution allowed attackers to include arbitrary local files, and when PEAR's pearcmd.php was reachable they could use it to write attacker-controlled PHP files to disk, leading to code execution. Attackers began probing vulnerable sites within hours of the patch and later escalated to file write attempts.
Yesterday we wrote up CVE-2026-87902, the unauthenticated local file inclusion in WordPress page template resolution fixed in 7.1.2. That post covered the sink,
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Impact
Attackers could achieve arbitrary file write with attacker-controlled PHP content, which is code execution, though files dropped in /tmp are not usually reachable over the web so on their own they are a proof of execution rather than a persistent backdoor.
What the attacker needed
Active theme has a top-level page- directory; PHP register_argc_argv enabled for pearcmd chain; PEAR installed on the server; a valid page_id that resolves to a real page
The fix
WordPress fixed the vulnerability in 7.1.2 and backported the fix as far as 4.7.37; as a stopgap, rejecting traversal sequences in the pagename parameter or disabling register_argc_argv breaks the chain.
How it was found
- Send a request to the site root or /index.php with a pagename parameter containing an encoded traversal and a core file such as wp-links-opml, plus a valid page_id, to check whether inclusion works.
- Point the inclusion at pearcmd.php and append a config-show argument to confirm PEAR is present and the argv trick works.
- Replace config-show with config-create and supply a PHP payload and a target path under /tmp to write a file to disk.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A local file inclusion bug lets an attacker trick a website into loading a file from the server's own disk instead of the page it meant to show. Here, by adding special encoded characters to a page name, an attacker could make WordPress load internal files. If a particular helper file (part of a PHP library called PEAR) was installed, attackers could then use it to save their own PHP script on the server, which the server might later run as code.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.