Skip to main content

Blackbox, non-intrusive detector for wp2shell (WordPress core pre-auth RCE, CVE-2026-63030 / CVE-2026-60137).

Project description

wp2shell-detect

Blackbox, non-intrusive detector for wp2shell — the pre-authentication RCE chain in WordPress core disclosed on 2026-07-17:

  • CVE-2026-63030 — route confusion in the REST batch endpoint (/wp-json/batch/v1): a sub-request whose path fails wp_parse_url() lands in the validation array but not the handler array, desynchronising the two.
  • CVE-2026-60137 — SQL injection in WP_Query's author__not_in handling, reachable pre-auth through that route confusion.

Chained, they let an anonymous attacker forge an administrator account and drop a plugin webshell — on a default install, no plugin or theme required.

Full technical writeup: https://own2pwn.fr/articles/appsec/wp2shell-wordpress-rce

What this tool does (and does not)

It detects exposure. It does not exploit anything. Every request it makes is a normal, read-only request a crawler could send:

  1. Fingerprints the WordPress core version from many public sources, so a hardened install that strips the generator tag is still identified: the generator meta tag, core asset ?ver= (on /wp-includes/ and /wp-admin/ assets, which track core), the RSS feed generator (?v=), /wp-links-opml.php, the login page assets, /wp-includes/version.php, readme.html, and the /wp-json/ index. Sources are cross-checked and a confidence (high when ≥2 agree) is reported.
  2. Compares the version to the known-vulnerable ranges.
  3. Checks the REST batch route with a benign OPTIONS request (and the REST index) — which returns the route schema without ever invoking the handler — to tell whether an edge mitigation is in place.
  4. Discovers headless WordPress back-ends. If the target front isn't WP but references a WordPress host on the same domain (via CSP, the Link header or asset URLs — common with headless/Next.js fronts), the tool reports it, and --discover scans it too.

No request triggers the vulnerability. No POST /wp-json/batch/v1, no author_exclude, no SQL. If the core version is hidden, the tool says so rather than guessing (confirming wp2shell blindly would require exploiting it).

Resilience: retries with backoff, gzip/deflate decoding, https→http fallback, cross-host redirect following, a browser-like User-Agent (overridable), and parallel multi-target scanning.

Vulnerable ranges

Range Exposure Fixed in
6.8.0 – 6.8.5 SQL injection only (no RCE) 6.8.6
6.9.0 – 6.9.4 pre-auth RCE 6.9.5
7.0.0 – 7.0.1 pre-auth RCE 7.0.2

Usage

Zero dependencies. Python 3.8+.

./wp2shell_detect.py https://example.com
./wp2shell_detect.py --json https://a.example https://b.example
./wp2shell_detect.py --targets hosts.txt --workers 16   # parallel sweep
./wp2shell_detect.py --discover https://front.example   # follow headless WP

Options: --json, --discover, --workers N, --timeout S, --user-agent UA, --insecure, --targets FILE. Exit code 2 if any target is found vulnerable (handy in CI / cron sweeps).

Headless WordPress

Modern sites often serve a JS/Next.js front on www. and keep WordPress on a sibling host (wordpress., wp., cms.). Scanning www. then returns not WordPress — correctly, because that host isn't WordPress. Point the scan at the WordPress host, or pass --discover to have the tool find and scan it from the front's CSP / Link header / asset URLs automatically.

Example:

[!!] https://blog.example.com  ->  VULNERABLE (pre-auth RCE)
      version : 6.9.3  (generator meta tag=6.9.3, RSS feed generator=6.9.3)
      batch   : reachable  (/wp-json/batch/v1)
      cves    : CVE-2026-63030, CVE-2026-60137
      note    : WordPress 6.9.3 is in the wp2shell pre-auth RCE range. REST batch endpoint reachable — no edge mitigation.

Mitigation

Patch WordPress core to 6.8.6 / 6.9.5 / 7.0.2 or later. If patching must wait, block the batch route at the edge (/wp-json/batch/v1 and ?rest_route=/batch/v1) or via a must-use plugin hooking rest_pre_dispatch, then audit for rogue admin accounts and unknown plugins.

Legal

For authorised assessment only. Running this against systems you neither own nor are mandated to test may be illegal in your jurisdiction. You are responsible for how you use it.

License

MIT — see LICENSE. By own2pwn.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wp2shell_detect-1.0.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wp2shell_detect-1.0.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file wp2shell_detect-1.0.0.tar.gz.

File metadata

  • Download URL: wp2shell_detect-1.0.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for wp2shell_detect-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62b21a3fe711216bd468980bc770e48ff0adb7e1b95c02cc8d116ca0111f0e23
MD5 d5387217799d0dee6667c647ccd71c87
BLAKE2b-256 c3d6556ba0a88425f28494c526660734b77515622bb8a41997e1d43e599d93a3

See more details on using hashes here.

File details

Details for the file wp2shell_detect-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wp2shell_detect-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e535664304f9039ded4a550fd30b50517db41f5953aafa84e73f5ffb2139fec5
MD5 a8807bbdf6ba65c02096e01d884bf68b
BLAKE2b-256 466b8080f7caf1fd5efacc5c6aef1502aceaba18a35b803cbc293c2cb5c487cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page