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

 All Forums
 Announcements
 Announcements: Security Related Bug Fixes
 Everyone Please Read (Updated)
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic   

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 February 2002 :  22:38:48  Show Profile
This only applies to v3.3.03, if you are using an older version, the fix is to upgrade to v3.3.03 and then use the fix below

Or, a quick fix is to just turn off the ability for your users to post images.

Everyone needs to replace the Function ReplaceImageTags(fString) in their inc_functions.asp file with the one below:

Function ReplaceImageTags(fString)
Dim oTag, cTag
Dim roTag, rcTag
Dim oTagPos, cTagPos
Dim nTagPos
Dim counter1, counter2
Dim strUrlText
Dim Tagcount
Dim strTempString, strResultString
TagCount = 7
Dim ImgTags(7,2,2)
Dim strArray, strArray2

ImgTags(1,1,1) = "[img]"
ImgTags(1,2,1) = "[/img]"
ImgTags(1,1,2) = "<img src="""
ImgTags(1,2,2) = """ border=0>"

ImgTags(2,1,1) = "[IMG]"
ImgTags(2,2,1) = "[/IMG]"
ImgTags(2,1,2) = ImgTags(1,1,2)
ImgTags(2,2,2) = ImgTags(1,2,2)

ImgTags(3,1,1) = "[image]"
ImgTags(3,2,1) = "[/image]"
ImgTags(3,1,2) = ImgTags(1,1,2)
ImgTags(3,2,2) = ImgTags(1,2,2)

ImgTags(4,1,1) = "[img=right]"
ImgTags(4,2,1) = "[/img=right]"
ImgTags(4,1,2) = "<img align=right src="""
ImgTags(4,2,2) = """ id=right border=0>"

ImgTags(5,1,1) = "[image=right]"
ImgTags(5,2,1) = "[/image=right]"
ImgTags(5,1,2) = ImgTags(4,1,2)
ImgTags(5,2,2) = ImgTags(4,2,2)

ImgTags(6,1,1) = "[img=left]"
ImgTags(6,2,1) = "[/img=left]"
ImgTags(6,1,2) = "<img align=left src="""
ImgTags(6,2,2) = """ id=left border=0>"

ImgTags(7,1,1) = "[image=left]"
ImgTags(7,2,1) = "[/image=left]"
ImgTags(7,1,2) = ImgTags(6,1,2)
ImgTags(7,2,2) = ImgTags(6,2,2)

strResultString = ""
strTempString = fString

for counter1 = 1 to TagCount

oTag = ImgTags(counter1,1,1)
roTag = ImgTags(counter1,1,2)
cTag = ImgTags(counter1,2,1)
rcTag = ImgTags(counter1,2,2)
oTagPos = InStr(1, strTempString, oTag, 1)
cTagPos = InStr(1, strTempString, cTag, 1)

if (oTagpos > 0) and (cTagPos > 0) then

strArray = Split(strTempString, oTag, -1)
for counter2 = 0 to Ubound(strArray)
if (Instr(1, strArray(counter2), cTag) > 0) then
strArray2 = split(strArray(counter2), cTag, -1)
strUrlText = strArray2(0)
strUrlText = replace(strUrlText, """", " ") ' ## filter out "
'## Added to exclude Javascript and other potentially hazardous characters
strUrlText = replace(strUrlText, "&", " ", 1, -1, 1) ' ## filter out &
strUrlText = replace(strUrlText, "#", " ", 1, -1, 1) ' ## filter out #
strUrlText = replace(strUrlText, ";", " ", 1, -1, 1) ' ## filter out ;
strUrlText = replace(strUrlText, "+", " ", 1, -1, 1) ' ## filter out +
strUrlText = replace(strUrlText, "(", " ", 1, -1, 1) ' ## filter out (
strUrlText = replace(strUrlText, ")", " ", 1, -1, 1) ' ## filter out )
strUrlText = replace(strUrlText, "[", " ", 1, -1, 1) ' ## filter out [
strUrlText = replace(strUrlText, "]", " ", 1, -1, 1) ' ## filter out ]
strUrlText = replace(strUrlText, "=", " ", 1, -1, 1) ' ## filter out =
strUrlText = replace(strUrlText, "*", " ", 1, -1, 1) ' ## filter out *
strUrlText = replace(strUrlText, "'", " ", 1, -1, 1) ' ## filter out '
strUrlText = replace(strUrlText, "javascript", " ", 1, -1, 1) ' ## filter out javascript
strUrlText = replace(strUrlText, "jscript", " ", 1, -1, 1) ' ## filter out jscript
strUrlText = replace(strUrlText, "vbscript", " ", 1, -1, 1) ' ## filter out vbscript
strUrlText = replace(strUrlText, "mailto", " ", 1, -1, 1) ' ## filter out mailto
'## End Added
strUrlText = replace(strUrlText, "<", " ") ' ## filter out <
strUrlText = replace(strUrlText, ">", " ") ' ## filter out >
strResultString = strResultString & roTag & strUrlText & rcTag & strArray2(1)
else
strResultString = strResultString & strArray(counter2)
end if
next

strTempString = strResultString
strResultString = ""
end if
next

ReplaceImageTags = strTempString
end function

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 28 February 2002 :  00:09:39  Show Profile
I updated the v3.3.03 download file to include the above change.

If you have modified your inc_functions.asp file, you can just copy the function from the file in the .zip file and paste it into your inc_functions.asp file.

The download link is: http://forum.snitz.com/download.asp

And since I updated the download file, I decided to also included another small security fix in the pop_pword.asp file, just replace yours with the one in the .zip file.

The only changes I made are the ReplaceImageTags function and the pop_pword.asp file.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 May 2002 :  07:37:30  Show Profile
This fix is included in v3.3.04
Go to Top of Page
  Previous Topic Topic   
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07