PhotoPost Photo Gallery Sales PhotoPost Sales Toll Free Phone Number
Mon-Fri 9am-4pm EST
  PhotoPost Photo Sharing Photo Gallery    Visualize community tm
| | | | | | | | |
Old February 2nd, 2012, 02:19 PM   #1 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
Exploit in VB Gallery 2.5.1

For some reason I cannot post in the vbgallery support forums so here is the only place I could put it..

There is an exploit in photopost VBGallery 2.5.1 in the email to friend feature. A malicious user can use it to send spam because none of the fields are sanitized properly in misc.php:

Code:
Content visible to verified customers only.
The sendtoname and subject fields need to be sanitized beyond just HTML, carriage returns, etc..

A guest on our site pumped out massive amounts of spam with this. Fortunately for us, we log all email sent by the mail() function and log message headers and exact time. With that we were able to trace it back in the apache logs to the user using this feature.

We have disabled it on our sites, but it is still vulnerable in the current download.
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 02:33 PM   #2 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
Hmm, I don't really have time to trace everything back in the code, but I think even if you disable this in the CP, it is still there if a bot posts to it.. It LOOKS like the only thing the perm change does is not to display the form...
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 03:43 PM   #3 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
HMM well no idea why you say it is not sanitized looks fine to me as it is indeed ran through the vbulletin sanitizer function.

You can try changing TYPE_NOHTML to TYPE_STR but I really can not say whether it would make any difference as you really have not provided any direct examples as to the specific problem your having.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 2nd, 2012, 04:45 PM   #4 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
TYPE_NOHTML or TYPE_STR does not remove carriage returns or other characters that can be used to change the mail headers... It is open to email injection attacks...

More:

http://www.damonkohler.com/2008/12/email-injection.html

Last edited by Andy R; February 2nd, 2012 at 04:57 PM.
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 05:09 PM   #5 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
I hear what your saying I just do not see in vbulletin what option they use for that is what I am saying. Obviously we are using the common normal vb santitation routines in vb which is what vbgallery does.

I checked vbulletin sendmessage.php script and this is what they do

Code:
Content visible to verified customers only.
Therefore from what I see using TYPE_STR would be the same as vbulletin forum is using to sanitize email message or sender email.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 2nd, 2012, 05:18 PM   #6 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
Vbulletin doesn't allow the user to create the TO user.. Yours does..

**Edited, changed FROM to TO
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 05:26 PM   #7 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
Try to use sendtofriend vb feature and put something like this in the to line:

joe@schmoe.com, bob@bill.com, etc@etc.com.. Doesn't work does it?

This is why:

Code:
Content visible to verified customers only.
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 05:40 PM   #8 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
Actually a little different as you would need to use vbGallery variables should look like this in misc.php

Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 2nd, 2012, 07:11 PM   #9 (permalink)
Member
 
Join Date: Feb 2002
Posts: 167
Not sure, all I see is "Content visible to verified customers only." I guess I am not verified anymore lol..
Andy R is offline   Reply With Quote
Old February 2nd, 2012, 08:10 PM   #10 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
PhotoPost Community - Announcements in Forum : General Discussion

That should explain how to get access to support.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 12th, 2012, 12:45 AM   #11 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Location: Florida
Posts: 318
Please lend a hand to place the above code exactly into misc.php

Code:
Content visible to verified customers only.
oldengine is offline   Reply With Quote
Old February 12th, 2012, 08:30 AM   #12 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
You are replacing that if clause with the one I have in bold in my example it is around line 245 of misc.php
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 12th, 2012, 11:33 AM   #13 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Location: Florida
Posts: 318
The script still sent out the email.

I have now commented out...

Do Send to Friend

and

Email Friend

I will wait for the next upgrade.

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

NOT logged in

Code:
Content visible to verified customers only.
where i=16 is any valid image number
oldengine is offline   Reply With Quote
Old February 12th, 2012, 12:12 PM   #14 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
imageid is simply the image id

The email to friend link is going to appear to any group you have given permission to use the feature. As long as they enter a valid email and enter a valid message sure any message would be sent out.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 12th, 2012, 12:46 PM   #15 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Location: Florida
Posts: 318
I'm referring to users not logged in. This is the way the exploit was used.

Nothing to do with permissions.
oldengine is offline   Reply With Quote
Old February 12th, 2012, 01:06 PM   #16 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
If you are allowing a usergroup to use the send to friend link they would indeed be allowed to send an email is what I am saying.

I would bet on your setup the send to friend link appears for all right?
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 12th, 2012, 01:16 PM   #17 (permalink)
Member
Verified Customer
 
Join Date: Oct 2004
Location: Florida
Posts: 318
No, the drop down link was not there.

This spam outfit obviously knew about the exploit. They were NOT logged in, nor had they ever registered.

They simply used the same URL each time:

Code:
Content visible to verified customers only.
Which worked for them to send hundreds of spam emails while NOT logged in until I commented out code in misc.php. Now they'll get a white screen.



The other thing about this exploit was that HUNDREDS of email addresses could be placed in the To: line.

inetnum: 124.107.69.88 - 124.107.69.88
netname: SLITES
country: PH
descr: 322367987_Edago Dexter Cyberzone Co.

Last edited by oldengine; February 12th, 2012 at 01:21 PM.
oldengine is offline   Reply With Quote
Old February 12th, 2012, 01:23 PM   #18 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
I will pass it along but the way it is designed from what I see is the actual permissions are applied before the link appears so maybe applying those same permissions to that part will stop things. I would have to see
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Old February 15th, 2012, 08:01 AM   #19 (permalink)
Photopost Developer
Verified Customer
 
Chuck S's Avatar
 
Join Date: Jun 2002
Location: Abingdon,MD
Posts: 68,070
You can try this as what this should do only send an email if you give the usergroup permission to use the feature.

Other than that there is no way to stop from using a feature you permit users to use.

You can compare the function here to the one in your misc.php file to see what I did.
Code:
Content visible to verified customers only.
__________________
Photopost Developer and Support Engineer

Please do not PM me for support or sales questions. Thank you for your understanding.
Chuck S is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error or exploit attempt Ocean44 How Do I? - vBulletin 3.7x / 3.8x 4 January 12th, 2010 10:44 PM
Can't upload pics after patching exploit (functions_gallery_imageedit) Swamper Bugs - vBulletin 3.6x 17 February 3rd, 2008 08:43 AM
Upgrade & Exploit Prevention Question ldk Photopost Pro Installation & Upgrades 1 August 24th, 2007 05:22 PM
Is this exploit or etc ? Lizard King Bugs From 1.0.0 13 June 13th, 2005 03:03 PM


All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0