Search

[PHP Object Injection] CVE-2025-22510

Categories
Tags
작성일
2025/01/08
1 more property

1️⃣ Component type

WordPress plugin

2️⃣ Component details

Component name WC Price History for Omnibus
Vulnerable version <= 2.1.4
Component slug wc-price-history

3️⃣ OWASP 2017: TOP 10

Vulnerability class A3: Injection
Vulnerability type PHP Object Injection

4️⃣ Pre-requisite

Shop manger(Administrator +)

5️⃣ Vulnerability details

👉 Short description

WC Price History for Omnibus 플러그인 2.1.4 버전 이하에서는 WooCommerce 대시보드의 'Price History' 메뉴(/wp-admin/admin.php?page=wc-price-history)에서 'Import debug data' 섹션을 통해 JSON 파일을 업로드할 수 있습니다. 업로드된 JSON 파일은 wc_price_history_import_file 페이로드로 전송되며, JSON 데이터의 'serialized' 키 값에서 PHP Object Injection 취약점이 발생합니다. 이 취약점을 통해 Shop Manager 권한을 가진 공격자는 PHP 객체를 주입할 수 있습니다.
이 플러그인 자체에는 알려진 POP Chain이 존재하지 않지만, 대상 워드프레스 사이트의 다른 플러그인이나 테마에서 POP 체인이 발견될 경우 공격자는 임의 파일 삭제, 민감 정보 탈취, 코드 실행이 가능합니다.

👉 How to reproduce (PoC)

1.
WC Price History for Omnibus 플러그인 2.1.4 이하 버전이 설치 및 활성화된 워드프레스 사이트를 준비합니다.
해당 플러그인을 활성화하려면 WooCommerce 플러그인이 먼저 설치되어 있고 활성화되어 있어야 합니다.
2.
PHP Object Injection 취약점을 테스트하기 위해 아래의 클래스 PoC_POP_Chain_Objectwp-config.php 파일 하단에 추가합니다.
class PoC_POP_Chain_Object { public $message = ""; public function __destruct() { echo "<mark>Success PoP Chain</mark>"; echo "<br>"; echo "<mark>msg: ". $this->message ."</mark>"; } }
PHP
복사
3.
그 다음 아래의 Json 데이터를 가지는 파일을 생성합니다.
해당 Json 데이터 중 serialized 키에 입력된 데이터는 PHP 직렬화된 객체 포맷으로, 이전에 wp-config.php 파일에 추가한 클래스 PoC_POP_Chain_Object의 인스턴스를 생성하고 message 프로퍼티에 문자열 ‘Exploit !!’ 를 할당한 것입니다.
{ "serialized": "O:20:\"PoC_POP_Chain_Object\":1:{s:7:\"message\";s:10:\"Exploit !!\";}" }
JSON
복사
4.
이후, WooCommerce 대시보드에서 'Price History' 메뉴(/wp-admin/admin.php?page=wc-price-history)로 이동합니다. 해당 메뉴 내 'Import debug data' 섹션에서 파일 업로드 폼을 통해 앞서 생성한 Json 파일을 선택하고 'Import' 버튼을 클릭하여 업로드 합니다.
5.
업로드 요청에 대한 결과로, 응답 데이터에 wp-config.php 에 추가한 클래스 PoC_POP_Chain_Object 의 매직 메서드 __destruct() 가 실행되어 아래와 같은 메시지가 출력되는 것을 확인할 수 있습니다.
<mark>Success PoP Chain</mark> <br> <mark>msg: Exploit !!</mark>
HTML
복사

👉 Additional information (optional)

[취약점 발생 원인]

WooCommerce 대시보드의 'Price History' 메뉴(/wp-admin/admin.php?page=wc-price-history)에서 'Import debug data' 섹션을 통해 JSON 데이터를 업로드하고 'Import' 버튼을 클릭하면
/wp-content/plugins/wc-price-history/app/PriorPrice/Import.php 파일의 Import 클래스에 정의된 import_file() 함수가 실행됩니다. 해당 함수는 Json 파일이 담긴 요청 페이로드 wc_price_history_import_file 를 가져온 뒤, 해당 Json 데이터에 키가 serialized인 데이터를 가져와 함수 maybe_unserialize 를 통해 역직렬화를 수행합니다.
따라서, 요청 페이로드 wc_price_history_import_file 는 Json 형식의 데이터로 해당 데이터에 키가 serialized 인 직렬화된 데이터를 검증 없이 역직렬화하는 과정에서 PHP Object Injection 취약점이 발생하게 됩니다.

👉 Attach files (optional)

6️⃣ References