Raised This Month: $ Target: $400
 0% 

Security Advisory: LFI exploit in SourceBans 1.4.*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jsifuentes
New Member
Join Date: Dec 2014
Old 12-02-2014 , 19:09   Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #1

Hi everyone,

I recently discovered a LFI exploit in SourceBans 1.4.* in the Demos functionality. I reported this to GameConnect a few days ago, but haven't received much of an update.

Basically, the vulnerability allows for any authorized user of your SourceBans system to download any file on the server, within permissions of the web server, through the demos module.

I wrote up a walk through of the exploit as an attacker on my personal website here. I also provided a patch near the bottom.

If you don't... want to patch it, here's some advice:

I would highly suggest being careful with any SourceBans passwords. If any are compromised and have access to add or edit bans, they can exploit this fairly easily.

If you allow remote connections to your database, play it safe and whitelist only the IPs that should connect remotely. When I say they can download any files within permissions, that means config.php too.

Thanks.

Last edited by jsifuentes; 12-02-2014 at 19:10.
jsifuentes is offline
Phaiz
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-02-2014 , 21:08   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #2

Don't take this the wrong way, and not that I think AM is full of hackers, and not that I don't appreciate you finding an issue, but wouldn't this had been better left private so that the sb devs could release an update without making the issue largely public?
__________________
Phaiz is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 12-02-2014 , 21:39   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #3

Quote:
Originally Posted by Phaiz View Post
Don't take this the wrong way, and not that I think AM is full of hackers, and not that I don't appreciate you finding an issue, but wouldn't this had been better left private so that the sb devs could release an update without making the issue largely public?
I agree, now the hackers can use it, normally, they post the exploit after it has been fixed, I advise that you blank the first post for now, and people should use SSL on their SB, it sounds stupid, but there is a company called StartSSL which gives out free SSL certs, or use CloudFlare's Flexible Option, since I see SSL the only way to bypass this issue!

See, I use SSL: https://www.v33r.cf

EDIT: I am releasing SourceBans 1.4.13 to the public with this fix!
__________________

Last edited by Sarabveer; 12-02-2014 at 21:52.
Sarabveer is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 12-02-2014 , 22:09   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #4

Quote:
Originally Posted by Sarabveer View Post
SourceBans 1.4.13 has been released.

Changes:
Quote:
(02/12/14): Version 1.4.13
-----------------------
01. ! Fixed LFI EXPLOIT //Thanks jsifuentes
02. ? Optimized and updated IpToCountry.csv
Ok, Your Fix has been added to my Fork!
__________________

Last edited by Sarabveer; 12-02-2014 at 22:10.
Sarabveer is offline
dotexe
Senior Member
Join Date: Aug 2013
Old 12-02-2014 , 22:33   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #5

Can you post the code that we have to replace? My line 1753 is "$reason,"
dotexe is offline
jsifuentes
New Member
Join Date: Dec 2014
Old 12-02-2014 , 22:36   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #6

Quote:
Originally Posted by dotexe View Post
Can you post the code that we have to replace? My line 1753 is "$reason,"
Try looking at 1758.

The code you need to replace is
Code:
	if($dname && $dfile)
jsifuentes is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-02-2014 , 22:46   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #7

Throwing responsible disclosure right out the top floor window I see.

EDIT: To all the people reporting this thread, and those thinking of doing so, it's absolutely pointless (and actually harmful) to remove this now.
__________________

Last edited by asherkin; 12-02-2014 at 22:50.
asherkin is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 12-02-2014 , 23:09   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #8

Quote:
Originally Posted by asherkin View Post
Throwing responsible disclosure right out the top floor window I see.

EDIT: To all the people reporting this thread, and those thinking of doing so, it's absolutely pointless (and actually harmful) to remove this now.
It would be pointless since I have already included the fix in my fork.
__________________
Sarabveer is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Old 12-02-2014 , 23:22   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #9

Hey, also, can you change "It affects SourceBans 1.4.*" to "It affects SourceBans 1.4-1.4.12"

EDIT: Thanks
__________________

Last edited by Sarabveer; 12-03-2014 at 14:32.
Sarabveer is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-06-2014 , 16:30   Re: Security Advisory: LFI exploit in SourceBans 1.4.*
Reply With Quote #10



AFAIK there was no way to even disable demos, so i just did like
chmod
along with
ALTER TABLE `sourcebans`.`sb_demos`
ENGINE = BLACKHOLE ;

also helps setting protests and to that engine.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 12-06-2014 at 16:34.
friagram is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 10:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode