====================================================================== Security Corporation Security Advisory [SCSA-021] Anonymous Mail Forwarding Vulnerabilities in vbPortal ====================================================================== PROGRAM: vbPortal HOMEPAGE: http://www.vbportal.com VULNERABLE VERSIONS: 2.0 alpha 8.1 and Prior ? RISK: Low IMPACT: Allows Unauthorized Users to Send Mail Anonymously RELEASE DATE: 2003-11-22 ====================================================================== TABLE OF CONTENTS ====================================================================== 1..........................................................DESCRIPTION 2..............................................................DETAILS 3.............................................................EXPLOITS 4............................................................SOLUTIONS 5...........................................................WORKAROUND 6..................................................DISCLOSURE TIMELINE 7..............................................................CREDITS 8...........................................................DISCLAIMER 9...........................................................REFERENCES 10............................................................FEEDBACK 1. DESCRIPTION ====================================================================== "vBPortal is a addon to the already popular message board software called vB developed by www.vbulletin.com. vBPortal has came a long way, and the new version 3.0 has a lot of great features and functions. Intergrating phpnuke's functions and abilities to easily add modules and addons has added greater abilities. Simply it adds a frontpage, and utilizies vb's abilities and expands on that" (direct quote from http://www.vbportal.com) 2. DETAILS ====================================================================== - Anonymous Mail Forwarding : A vulnerability has been discovered in the friend.php file that allows unauthorized users to send spam (junk mail) anonymously. Vulnerable code : [...] function SendStory($sid, $yname, $ymail, $fname, $fmail) { global $sitename, $nukeurl, $prefix; $result2=mysql_query("select title, time, topic from $prefix"._stories." where sid=$sid"); list($title, $time, $topic) = mysql_fetch_row($result2); $result3=mysql_query("select topictext from $prefix"._topics." where topicid=$topic"); list($topictext) = mysql_fetch_row($result3); $subject = ""._INTERESTING." $sitename"; $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._CONSIDERED."\n\n\n$title\n("._FDATE." $time)\n"._FTOPIC." $topictext\n\n"._URL.": $nukeurl/article.php?sid=$sid\n\n"._YOUCANREAD." $sitename\n$nukeurl"; mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: PHP/" . phpversion()); $title = urlencode($title); $fname = urlencode($fname); Header("Location: friend.php?op=StorySent&title=$title&fname=$fname"); } [...] function SendSite($yname, $ymail, $fname, $fmail) { global $sitename, $slogan, $nukeurl; $subject = ""._INTSITE." $sitename"; $message = ""._HELLO." $fname:\n\n"._YOURFRIEND." $yname "._OURSITE." $sitename "._INTSENT."\n\n\n"._FSITENAME." $sitename\n$slogan\n"._FSITEURL." $nukeurl\n"; mail($fmail, $subject, $message, "From: \"$yname\" <$ymail>\nX-Mailer: PHP/" . phpversion()); Header("Location: friend.php?op=SiteSent&fname=$fname"); } [...] switch($op) { case "SendStory": SendStory($sid, $yname, $ymail, $fname, $fmail); break; [...] case "SendSite": SendSite($yname, $ymail, $fname, $fmail); break; [...] } ?> Both functions SendStory () and SendSite () send emails. Two variables are (yname and ymail) modifiable in the headers. An attacker can so inject what he wants, by using the character LF (line feed), %0A in ASCII. 3. EXPLOITs ====================================================================== - Anonymous Mail Forwarding : Here is an example of simple application that changes the mail via variables ymail and fname. We can here choose the sender, the name of the sender, the addressee, the type of the message, the message and add a subject while having the choice between both vulnerable functions. if (!isset($Send)){ ?>
}else{ echo "URL : ".$url."