Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
POC-WP-XSS2Shell-CVE-2026-64638 — PoC funcional de CVE-2026-64638 (XSS2Shell): cadena pre-auth XSS a RCE en WordPress Core. Laboratorio Docker + servidor atacante Python + análisis técnico y mitigación. | Kitploit
Tools/GitHubGitHub/686f6c61/poc-wp-xss2shell-cve-2026-64638
Vulnerability AnalysisExploitationWeb Application ExploitationLearning & EducationPayload DevelopmentLabs & Practice
GitHub686f6c61/poc-wp-xss2shell-cve-2026-64638

POC-WP-XSS2Shell-CVE-2026-64638

PoC funcional de CVE-2026-64638 (XSS2Shell): cadena pre-auth XSS a RCE en WordPress Core. Laboratorio Docker + servidor atacante Python + análisis técnico y mitigación.

View Repository
121 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

XSS2Shell — PoC for CVE-2026-64638

Educational Proof of Concept for the XSS2Shell chain (CVE-2026-64638), a pre-authentication XSS → RCE vulnerability in WordPress Core discovered independently by pwn.ai and disclosed on August 7, 2026.


Table of contents

  1. Executive Summary
  2. Legal notice
  3. Chain architecture
  4. Requirements
  5. Repository structure
  6. Quick start guide
  7. Exploitation verification
  8. Additional documentation

Executive Summary

CVE-2026-64638 is a reflected, pre-authentication cross-site scripting (XSS) vulnerability in the WordPress login screen (wp-login.php). It affects all supported versions of WordPress prior to 7.0.3, released on August 6, 2026 as an emergency security release. It was assigned a CVSS v4.0 of 8.9.

The chain dubbed XSS2Shell demonstrates how, starting solely from a failed login attempt with a manipulated username, an attacker can:

  1. Inject live DOM elements into the page by exploiting a discrepancy between two syntax parsers of PHP () and of WordPress ().
login
strip_tags
wp_kses_post
  • Hijack the execution flow of WordPress's own JavaScript (user-profile.js) to make a REST JSONP request to the same origin.
  • Turn the JSONP response into JavaScript execution on the WordPress origin via jQuery.globalEval().
  • Chain all of this with Paulos Yibelo's (2022) Same Origin Method Execution (SOME) technique to automatically click the Application Passwords approval button within an administrator's authenticated session.
  • Capture the resulting Application Password credential, publish a page with malicious JavaScript, and finally upload a ZIP-format plugin that executes PHP on the server.
  • The result is remote code execution (RCE) on the WordPress server, under the web process user (typically www-data), starting from a single click by the administrator on an attacker-controlled link.


    Legal notice

    This repository contains strictly educational and defensive material.

    • Purpose: demonstrate the exploitation chain for training, self-auditing, and patch validation.
    • Authorized use: run it only against WordPress installations that you own or for which you have explicit written authorization.
    • Prohibited: any use against third-party systems without consent. The repository author is not responsible for misuse of the material included here.
    • Responsibility: the operator is solely responsible for compliance with applicable legislation (LOPD/GDPR in Spain, CFAA in the US, etc.).

    The PoC comes with a self-contained Docker environment whose sole purpose is to serve as a local and reproducible target.


    Chain architecture

    root@kitploit:~
    ┌─────────────────────────────────────────────────────────────────────┐
    │  1. XSS pre-auth en wp-login.php                                    │
    │     log=< area id=ajaxurl href=/?rest_route=/&_jsonp=...>           │
    │     (discrepancia strip_tags ↔ wp_kses_post)                        │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  2. user-profile.js dispara .trigger('click')                       │
    │     DOM clobbering de ajaxurl → petición POST al origen             │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  3. REST JSONP responde application/javascript                      │
    │     jQuery.globalEval() ejecuta el callback en el origen WP         │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │  callback = window.opener
                                               │            .approve.click
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  4. SOME: click() cruza la frontera opener→admin                    │
    │     authorize-application.php#approve se pulsa en sesión admin      │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  5. WP crea Application Password → redirige a success_url           │
    │     El atacante captura user_login + password en callback.php       │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │  HTTP Basic REST
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  6. POST /wp-json/wp/v2/pages  → publica página con <script>        │
    │     El admin visita la página → JS en origen WP con sesión admin    │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  7. fetch update.php?action=upload-plugin  → sube payload.zip       │
    │     PHP del plugin es accesible directamente sin activarlo          │
    └──────────────────────────────────────────┬──────────────────────────┘
                                               │
                                               ▼
    ┌─────────────────────────────────────────────────────────────────────┐
    │  8. RCE confirmada: GET /wp-content/plugins/payload/shell.php       │
    └─────────────────────────────────────────────────────────────────────┘
    

    Requirements

    The PoC is built to run on macOS or Linux with:

    • Docker 24+ and Docker Compose v2 (for the local target).
    • Python 3.9+ (for the optional orchestrator).
    • PHP 8.1+ with the zip extension (to build the payload manually, optional; the pre-built ZIP is included in payload/).
    • A modern Chromium-based or Firefox browser.

    There is no need to install WordPress manually: the docker-compose.yml starts a vulnerable WordPress 7.0.2 (the latest version before the patch) along with MariaDB.


    Repository structure

    root@kitploit:~
    POC XSS2Shell (CVE-2026-64638)/
    ├── README.md                       ← Este archivo
    ├── docker-compose.yml              ← Blanco: WordPress 7.0.2 + MariaDB
    ├── .env.example                    ← Variables de configuración
    ├── exploit.py                      ← Orquestador en Python (opcional)
    ├── attacker/                       ← Infraestructura del atacante
    │   ├── index.html                  ← Página cebo con la cadena SOME
    │   ├── callback.php                ← Receptor de la Application Password
    │   └── server.py                   ← Servidor estático + PHP embebido
    ├── payload/                        ← Plugin ZIP malicioso
    │   ├── build_payload.py            ← Generador del ZIP
    │   ├── shell.php                   ← Webshell mínimo
    │   └── payload.zip                 ← ZIP preconstruido (listo para usar)
    └── docs/
        ├── ANALISIS.md                 ← Análisis técnico detallado
        └── MITIGACION.md               ← Guía de mitigación y hardening
    

    Quick start guide

    1. Start the target (vulnerable WordPress 7.0.2)

    root@kitploit:~
    cp .env.example .env
    docker compose up -d
    

    WordPress will be available at http://localhost:8080. Follow the installation wizard and create an administrator user (for example admin / admin-password).

    The Dockerfile pins the image to wordpress:7.0.2-php8.2-apache, which is the latest version prior to patch 7.0.3.

    2. Start the attacker infrastructure

    root@kitploit:~
    # En otro terminal, dentro de attacker/
    python3 server.py
    

    The attacker server listens on http://localhost:9000 and exposes:

    • / → index.html (the decoy page).
    • /callback.php → receiver of the Application Password.

    3. Simulate the administrator's click

    1. Log in as administrator at http://localhost:8080/wp-admin.
    2. In the same browser session, open a new tab and visit http://localhost:9000/.
    3. You will see a single "Approve Application" button. Clicking it runs the whole chain automatically.

    4. Observe the credential capture

    In the terminal where server.py runs, a line like the following will appear:

    root@kitploit:~
    [+] Application Password recibida para el usuario 'admin':
        XXXX XXXX XXXX XXXX XXXX XXXX
    

    The credential is also saved in attacker/captured_credentials.txt.

    5. See the RCE

    After a few seconds, the index.html orchestrator will have:

    • Published a page that executes JavaScript on the WordPress origin.
    • Uploaded the payload.zip plugin to wp-content/plugins/payload/.

    Verify code execution with:

    root@kitploit:~
    curl -sI http://localhost:8080/wp-content/plugins/payload/shell.php
    

    A Hacked: true header and a JSON body confirm the RCE.


    Exploitation verification

    Once the chain is complete, the following endpoints serve as evidence:

    RecursoEvidencia esperada
    GET /wp-content/plugins/payload/shell.phpHeader Hacked: true + JSON {"rce":true,"user":"www-data"}
    attacker/captured_credentials.txtCaptured Application Password
    wp-admin → Aplicaciones → Contraseñas de aplicaciónA new entry named "SomeApp"

    Additional documentation

    • docs/ANALISIS.md — Detailed technical analysis of each phase of the chain, with references to the WordPress source code.
    • docs/MITIGACION.md — Recommended mitigations, hardening, and verification of patch 7.0.3.

    Credits

    • Original research and disclosure: pwn.ai — https://pwn.ai/blog/xss2shell
    • Underlying SOME technique: Paulos Yibelo (2022), published on the pwn.ai blog and nominated for Top Web Hacking Techniques of 2022.
    • PoC and packaging of this repository: own work for educational purposes.

    License

    Distributed under the MIT license. See the LICENSE file for more details.

    Download Tool