Mod Name / Version: Input validation mod (Security fix) 1.1.1 <br /> <br />Description: You all probably noticed that several vulnerabilities have been found in ubb.threads over the last months/weeks. Some of them have been fixed by Infopop, but that's only the tip of the iceberg. <br /> <br />There's no proper input validation in ubb.threads, which makes the door wide open for sql injections. Additionally, the output of ubb.threads isn't escaped properly also. This can be used by "hackers" to start XSS (cross site scripting attacks). <br /> <br />Both types of attacks can used to compromise your boards. Either to damage it or to gain unauthorized access. <br /> <br />During a security audit of ubb.threads, I found more than 10 vulnerabilities. <br /> <br />Infopop is aware of this problem and will "take care" of it in the next release. As this will take at least "some weeks", I created a modification that will prevent most of this attacks. <br /> <br />Note that all current installations of ubb.threads are vulnerable at the moment and that some exploits have already been published to security mailing lists (last one yesterday). <br /> <br />If the modification detects a possible attack an error message is displayed and the attack is logged to a logfile. <br /> <br />Working Under: UBB.Threads 6.3-6.4-6.5 <br /> <br />Mod Status: Finished <br /> <br />Any pre-requisites: <br /> <br />Author(s): Astaran <br /> <br />Date: 04/20/05 <br /> <br />Credits: <br /> <br />Files Altered: ubbt.inc.php <br /> <br />New Files: Validate.php <br /> <br />Database Altered: no <br /> <br />Info/Instructions: Note that there are three versions of this modification (depending on the ubb.threads version you're using). <br /> <br />Just follow the instructions in instructions.txt. <br /> <br />More experienced users can enhance this class to also validate variables that are used in installed hacks/modifications. See the readme.txt for details. <br /> <br />Disclaimer: Please backup every file that you intend to modify. <br /> <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br /> <br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
scroungr
Old Hand
Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
Thanx Astaran!
_________________________
Couchtomatoe - www.couch-tomatoe.cc My abilities are for hire for installs, upgrades, custom themes and custom modifications.
* Thanks for the mod! I installed it, and when I peep at the logfile it looks like it's validating everything just fine, but should I clean out the logfile occasionally or something. It looks like it's gonna get pretty big as the days go by.
[]AllenAyres said: <br />Any word on an 'official' fix (6.5.2) from IP yet? [/] <br /> <br />Beta testers are currently testing 6.5.2b1, which addresses many security issues.
[]ksanuk said: <br />Hi, <br /> <br />I'm running 6.4b1, so which of these 2 do I implement (attachment only has instructions for 6.3.x and 6.5.x)? <br /> <br />Sanuk! [/] <br />If you're able to modify the hack a bit you can take the version for 6.5.x Use the Validation.php from version 6.5, but the installation instructions from 6.3.x. <br />Install it, but run it with <br />define('ABORT_ON_ERROR',false); <br /> for some days. Browse the logfiles and look for unknown parameters. You can manually add them into the validation script. The the readme.txt for further details. <br /> <br />If you're not able to modify it yourself, send over the logfile and I'll have a look at it.
_________________________
Running a community? -> Keep informed and take it to the next level
[]Calpy said:<br />* Thanks for the mod! I installed it, and when I peep at the logfile it looks like it's validating everything just fine, but should I clean out the logfile occasionally or something. It looks like it's gonna get pretty big as the days go by. [/]<br /><br />Yes, delete it from time to time. Currently, there's no mechanism to do this automatically.
_________________________
Running a community? -> Keep informed and take it to the next level
Hi,<br />great script. i tried it with 6.5.1 and got an alert from the Google-Bot:<br /><br /> [] ERROR: SECURITY ALERT: POSSIBLE XSS ATTACK DETECTED!\nERROR: Script "/Cat/0/Number/23157/page/vc/1" has been called with an invalid parameter.\nERROR: parameter named "page" with a value of "vc" contained invalid characters. Valid type is: num.\nERROR: Script has been called from: 66.249.65.206\nERROR: User agent was: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\nERROR: Referer was: \nERROR: Full URI was: /FORUM/php/forum/showthreaded.php/Cat/0/Number/23157/page/vc/1\nERROR: END OF SECURITY ALERT.\nDEBUG: Data "forumbugs" contains alphanumeric characters only. Validation was successful.<br /> [/] <br /><br />Is there anything I can do to accept this request?<br /><br />My second question is:<br />How can you limit the logfile that it only shows errors and not everything.<br />The log is increasing 10KB per minute! right now.<br />I better switch logging off for a while.<br />Greetings<br />carl
_________________________
Carl Colour-Ize-Forums (test entry: user: 'test' pw: 'test2')
AllenAyres
I type Like navaho
Registered: 03/10/00
Posts: 25452
Loc: Texas
[]DLWebmaestro said:<br />[]AllenAyres said:<br />Any word on an 'official' fix (6.5.2) from IP yet? [/]<br /><br />Beta testers are currently testing 6.5.2b1, which addresses many security issues. [/]<br /><br />oh really, odd how the .threads beta testers know nothing of that <img src="http://www.ubbdev.com/forum/images/graemlins/smash.gif" alt="" />
Yes, really. <br /> <br />I was not aware Infopop still had a separate beta group for .threads. And if they don't know about it, then I agree, that is odd.
ksanuk
Member
Registered: 02/06/02
Posts: 297
Loc: Bangkok, Thailand
Hi,<br /><br />"If you're not able to modify it yourself, send over the logfile and I'll have a look at it. "<br /><br />Thanks, but seeing that I am leaving on a vacation in about 16 hrs I think this will have to wait until after I get back.<br /><br />Sanuk!
[]caymuc said:<br />Hi,<br />great script. i tried it with 6.5.1 and got an alert from the Google-Bot:<br />...<br /><br />Is there anything I can do to accept this request?<br /><br />My second question is:<br />How can you limit the logfile that it only shows errors and not everything.<br />The log is increasing 10KB per minute! right now.<br />I better switch logging off for a while.<br />Greetings<br />carl [/]<br />I'll release a new version on thursday, that will address both of it.<br />Isn't possible in the current version.<br />The new version will also include a version for ubb.threads 6.4.2
_________________________
Running a community? -> Keep informed and take it to the next level
I updated the with a new version.<br /><br />Changes in version 1.1.0:<br /><br />- added a version for ubb.threads 6.4.x<br />- fixed several small bugs in the validation routines and added some new parameters<br />- changed the login so that only errors and unknown variables are logged by default<br />- added option to notify you by mail of possible attacks or unknown vars (disabled by default, see the instructions.txt for details on how to enable it)<br />- error message is a lot nicer now and includes some extra information<br />- explained the configuration options in instructions.txt
_________________________
Running a community? -> Keep informed and take it to the next level
Upgrade instructions if you already have version 1.0 running:<br /><br />1. Extract the zip file and open the Validate.php that fits to your ubb.threads version.<br /><br />2. Adjust the path to the logfile like you did during the inital installation<br /><br />3. Optionally change the settings (see instructions.txt for a list of configuration options)<br /><br />4. Upload the new Validate.php to your server<br /><br />You don't need to alter ubbt.inc.php during the upgrade.<br />It's a good idea to delete the logfile to start fresh before doing the upgrade.
_________________________
Running a community? -> Keep informed and take it to the next level
Fixed it I think. <br /> <br />I had 7 occurences of "return $thisvar; <br />so i just left out the last one. <br /> <br />edit: how can I test the log? Make sure I got everything right.