Web Your Vyavsay Logo

Security guide

WordPress CVE-2026-87902: What to Do

CVE-2026-87902 is a critical flaw in WordPress core, not in PHP itself: an unauthenticated request can make WordPress include a PHP file it should not, which can become remote code execution on some servers. It affects WordPress 4.7.0 through 7.1.1 and was fixed on September 22, 2026. Update to 7.1.2, or the fixed release for your branch (7.0.6, 6.9.9, 6.8.10, or the 4.7.37 backport), before considering anything else.

By Web Your Vyavsay team · Published

Drafted with AI assistance. Claims are checked against the sources listed below and reviewed by our team.

Confirm the version table against the official WordPress advisory (GHSA-7hp8-65ch-5whp) before acting.

How serious is it?

  • Severity: Patchstack lists a CVSS score of 9.2 (critical); OpenCVE lists 8.1. The difference comes from the scoring version used. Both are high.
  • No login is needed to send the request.
  • Timing: the fix shipped on September 22, 2026, and the first exploitation attempt was recorded the same day, at 11:49 UTC, according to Patchstack.
  • Public scanning tools were circulating by September 23, and CISA added the flaw to its list of known exploited vulnerabilities on September 25, 2026.
  • Whether code execution works depends on server and theme setup, which is why some sites were exposed and others were not.

What to do today

  1. 1

    Check your version

    In the WordPress admin, open Dashboard, then Updates. Any version from 4.7.0 to 7.1.1 is affected.

  2. 2

    Update to the fixed release for your branch

    Use 7.1.2 if you can. Otherwise install your branch’s fixed release: 7.0.6, 6.9.9, 6.8.10, or 4.7.37 for the oldest branch. Take a backup first.

  3. 3

    Confirm the version afterwards

    Reload the Updates screen and check that the new version is shown.

  4. 4

    Check whether you were probed or compromised

    Use the indicators in the next section. Patching closes the hole but does not remove anything an attacker already left behind.

If you cannot update right away

Patchstack describes two stopgaps. They reduce risk while you arrange the update; they do not replace it.

  • Block requests whose pagename parameter contains directory-traversal sequences. A real page name never does.
  • Turn off the PHP setting register_argc_argv. It does not fix the file inclusion, but it breaks the known route to code execution through PEAR’s pearcmd.php.

Signs your site was probed or compromised

These indicators come from Patchstack’s write-up. Search your web server logs for:

  • A pagename parameter containing encoded traversal sequences, or starting with a page- directory name.
  • pagename and page_id used together on the site root or index.php.
  • Requests containing pearcmd or +config- arguments.
  • A normal page URL that returns RSS or OPML feed content, which Patchstack treats as proof the site was in the vulnerable window.

On the server, look for unexpected .php files in /tmp and /var/tmp. Patchstack says their presence means a file-write attempt succeeded and the host should be treated as compromised. Most attack traffic used spoofed user agents, so do not rely on user-agent filters.

After patching: when does moving off WordPress make sense?

WordPress is a sound choice for many sites, and this flaw is not a reason to leave it by itself. It is a reason to ask who is responsible for updates and how much code runs on your public site.

When to stay on WordPress and when to consider moving
Staying on WordPress fits whenMoving fits when
UpdatesSomeone patches core, themes and plugins within daysNobody owns updates, or sites sit unpatched for months
PluginsA few well-maintained pluginsMany plugins stacked to cover login, forms, membership and payments
Login and accessStandard roles are enoughYou need MFA, SSO, enterprise roles or custom permissions built into the product
Content editingNon-technical staff edit pages dailyContent changes rarely, or a developer team manages it

For the wider evidence, see WordPress vs a custom website: is moving safer?. If the right-hand column describes you, read WordPress to Next.js migration, including what a custom build gives up as well as what it adds.

Frequently asked questions

Is CVE-2026-87902 a PHP vulnerability?
No. The flaw is in WordPress core. PHP matters because, according to Patchstack, the code-execution path needed the PHP setting register_argc_argv to be enabled, so changing that setting breaks one known attack chain. It does not remove the flaw.
Which WordPress versions are affected, and which are fixed?
Affected: WordPress core 4.7.0 through 7.1.1. Fixed releases: 7.1.2, 7.0.6, 6.9.9, 6.8.10, with a backport to 4.7.37. Check your version under Dashboard, then Updates, and confirm it afterwards.
Do plugins or themes matter for this one?
The vulnerable code is in core, so updating core is the fix. Patchstack reports that the code-execution path needed an active theme with a top-level page- directory, which is why exposure varies from site to site. Do not rely on that: update regardless.
My host says it already protects me. Do I still need to update?
Yes. Some managed hosts added their own protections. Pantheon, for example, deployed platform-wide mitigations while still telling customers to update their sites as soon as possible.
Do I have to leave WordPress because of this?
No. A patched, well-maintained WordPress site is not unsafe because of this CVE. Moving makes sense for other reasons, covered below: heavy plugin dependence, custom login and access needs, or no one responsible for updates.

Free consultation

Running WordPress? Get a free review.

Tell us about your site. In a free consultation we recommend whether to patch and stay, or whether moving to a custom build is worth it for you.

We reply within one business day.

What you get, free:

  • 30-minute call with an engineer
  • Free review of your process or spreadsheet
  • Written recommendation: what to build or automate first
  • Rough cost estimate