Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 v33(.0x) BUG + FIX: post.asp & post_info.asp
 Forum Locked  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

MFHOWLAND
Starting Member

6 Posts

Posted - 22 May 2002 :  12:19:45  Show Profile
The values for FORUM_ID, and CAT_ID are not properly tested as numeric. So, by passing an URL string I can create the following SQL statement:

SELECT FORUM_CATEGORY.CAT_STATUS, FORUM_FORUM.F_STATUS FROM FORUM_CATEGORY, FORUM_FORUM WHERE FORUM_CATEGORY.CAT_ID = FORUM_FORUM.CAT_ID AND FORUM_FORUM.FORUM_ID = 1 DROP TABLE MEMBERS

I beleive these need to be checked in POST.ASP and POST_INFO.ASP, as well as probably other area's.

I can send you the URL if you need to recreate this. On a SQL Server implimentation this would cause some real problems. I could also Union to your password file fairly easily using this hole and instead of listing forums potentially list passwords. (I have not tried this, but it sounds like fun.. will try it after lunch).

Thanks,
Marshall

********************************************************************

Note: Lunch was tasty.. and yes, I can get every password and user name from a Snitz system using this method. I will send the URL used to the creator of the site if he wants.

********************************************************************


Edited by - MFHOWLAND on 22 May 2002 13:43:43

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  17:56:12  Show Profile
in post.asp replace this:

'#################################################################################
'## Initialise variables
'#################################################################################
strSelectSize = Request.Form("SelectSize")
strRqMethod = Request.QueryString("method")
strRqTopicID = Request.QueryString("TOPIC_ID")
strRqForumID = Request.QueryString("FORUM_ID")
strRqCatID = Request.QueryString("CAT_ID")
strCkPassWord = Request.Cookies(strUniqueID & "User")("Pword")
'#################################################################################
'## Page-code start
'#################################################################################



with this:

'#################################################################################
'## Initialise variables
'#################################################################################
strSelectSize = Request.Form("SelectSize")
strRqMethod = chkString(Request.QueryString("method"), "SQLString")
if Request.QueryString("TOPIC_ID") <> "" then
if IsNumeric(Request.QueryString("TOPIC_ID")) = True then
strRqTopicID = cLng(Request.QueryString("TOPIC_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("FORUM_ID") <> "" then
if IsNumeric(Request.QueryString("FORUM_ID")) = True then
strRqForumID = cLng(Request.QueryString("FORUM_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("CAT_ID") <> "" then
if IsNumeric(Request.QueryString("CAT_ID")) = True then
strRqCatID = cLng(Request.QueryString("CAT_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.QueryString("REPLY_ID") <> "" then
if IsNumeric(Request.QueryString("REPLY_ID")) = True then
strRqReplyID = cLng(Request.QueryString("REPLY_ID"))
else
Response.Redirect("default.asp")
end if
end if
strCkPassWord = chkString(Request.Cookies(strUniqueID & "User")("Pword"), "SQLString")
'#################################################################################
'## Page-code start
'#################################################################################



Then you will need to do a search for: (starting after the code you just replaced)

Request.QueryString("REPLY_ID")


and replace all instances with:

strRqReplyID


in an unmodified v3.3.05 version of post.asp there are 4 instances.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  18:01:49  Show Profile
In post_info.asp replace this:

MethodType = Request.Form("Method_Type")
Cat_ID = Chkstring(Request("CAT_ID"), "SQLString")
Forum_ID = ChkString(Request("FORUM_ID"), "SQLString")
Topic_ID = ChkString(Request("TOPIC_ID"), "SQLString")
Reply_ID = ChkString(Request("REPLY_ID"), "SQLString")


with this:

MethodType = chkString(Request.Form("Method_Type"),"SQLString")

if Request.Form("CAT_ID") <> "" then
if IsNumeric(Request.Form("CAT_ID")) = True then
Cat_ID = cLng(Request.Form("CAT_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.Form("FORUM_ID") <> "" then
if IsNumeric(Request.Form("FORUM_ID")) = True then
Forum_ID = cLng(Request.Form("FORUM_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.Form("TOPIC_ID") <> "" then
if IsNumeric(Request.Form("TOPIC_ID")) = True then
Topic_ID = cLng(Request.Form("TOPIC_ID"))
else
Response.Redirect("default.asp")
end if
end if
if Request.Form("REPLY_ID") <> "" then
if IsNumeric(Request.Form("REPLY_ID")) = True then
Reply_ID = cLng(Request.Form("REPLY_ID"))
else
Response.Redirect("default.asp")
end if
end if
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 22 May 2002 :  18:11:30  Show Profile  Send ruirib a Yahoo! Message
Richard,

Shouldn't
strCkPassWord = Request.Cookies(strUniqueID & "User")("Pword")
be
strCkPassWord = ChkString(Request.Cookies(strUniqueID & "User")("Pword"), "SQLString")


-------------------------------------------------
Installation Guide | Do's and Dont's | MODs
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  18:14:59  Show Profile
We can do that. But, the only way there is going to be a password in the cookie, is if it's a valid password for the user.

made the change above..
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 22 May 2002 :  18:35:17  Show Profile  Visit crash's Homepage
is it imperative to apply those updates?



Crash's Site | Crash is from
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  18:42:45  Show Profile
I would say yes, I am not at the point that I would announce it to everyone, want to make sure that the above changes handle everything first.
Go to Top of Page

Aaron S.
Average Member

USA
985 Posts

Posted - 22 May 2002 :  19:25:02  Show Profile  Visit Aaron S.'s Homepage
Thanks for the fix!

It seems like every page is going to need this kind of change... and just about every MOD will also have this vunerability.

Is it too late in the process to remove all querystring variables?


--Aaron




DOWNLOAD GREAT NEW MODS HERE
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  19:30:04  Show Profile
We've pretty much addressed all of these type of situations in v3.4 already. The code I posted above was taken from the v3.4 versions of post.asp and post_info.asp.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 May 2002 :  19:31:02  Show Profile
oh, btw.

You can download already modified files here:

These are v3.3.05 files modified with the changes noted above:

http://forum.snitz.com/download/post.zip

http://forum.snitz.com/download/post_info.zip
Go to Top of Page

MFHOWLAND
Starting Member

6 Posts

Posted - 22 May 2002 :  19:40:06  Show Profile
Hey,

Can I help you beta test 3.4? Might be fun. (heh).

Thanks,
Marshall

BTW - The person who wants the querystrings removed.. the other way to pass variables is by POST, which doesnt help because you can create a form to post whatever you want to. The real solution (possibly) is to use an ADODB.COMMAND object and Parameter fields. This will make sure that only valid types are allowed, and they are treated correctly.


Go to Top of Page

Aaron S.
Average Member

USA
985 Posts

Posted - 22 May 2002 :  22:21:26  Show Profile  Visit Aaron S.'s Homepage
You can use POST and check that the POST came from the same domain (using server variables).

I do this on all my other webpages.

--Aaron

DOWNLOAD GREAT NEW MODS HERE
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 23 May 2002 :  00:19:45  Show Profile
quote:

You can use POST and check that the POST came from the same domain (using server variables).



Well...the problem is that the refer is optional and originates from the client. You can't trust it since the refer can be modified/hardcoded into the client to be whatever they want it to be.

More information on this can be found here:
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=26952

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 23 May 2002 :  05:04:52  Show Profile
OK, never mind, my bad, got it sorted now!

c ya in the funny books
MeTV - tvthemetunes.net
House of Design - Graphic Design Consultants

"Wise men make proverbs, but fools repeat them."

Edited by - MeTV on 23 May 2002 05:23:19
Go to Top of Page

acemi
Starting Member

16 Posts

Posted - 23 May 2002 :  06:36:43  Show Profile
quote:

in post.asp replace this:
....
....


....
if Request.QueryString("CAT_ID") <> "" then
if IsNumeric(Request.QueryString("FORUM_ID")) = True then
strRqCatID = cLng(Request.QueryString("CAT_ID"))
else
Response.Redirect("default.asp")
end if
end if
....





FORUM_ID should be CAT_ID

Go to Top of Page

acemi
Starting Member

16 Posts

Posted - 23 May 2002 :  06:58:34  Show Profile
quote:

The real solution (possibly) is to use an ADODB.COMMAND object and Parameter fields. This will make sure that only valid types are allowed, and they are treated correctly.


This will cause that Snitz Forum 2000 will be database-depend and some problem with mySQL. I think that using a function to check the variable type will be better.

Something like this:

if ChkType(VariableName, "Integer") then ...
if ChkType(VariableName, "Boolean") then ...


Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07