Skip to content
Path traversal Write-up Advanced

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.

Dave Jong Follow

Published on patchstack.com

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,

Dave Jong, on patchstack.com

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

  1. 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.
  2. Point the inclusion at pearcmd.php and append a config-show argument to confirm PEAR is present and the argv trick works.
  3. 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.

More by Dave Jong

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.