The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I have a asp operated photo gallery that permitted .gif files to be uploaded (that's been changed!)
A hacker uploaded and used a file named zor.asp;.gif to get in.
Here's a text copy for anyone interested: link Original file was named: zor.asp;.gif
A hacker uploaded and used a file named zor.asp;.gif to get in.
Here's a text copy for anyone interested: link Original file was named: zor.asp;.gif
Posted
Disabling gifs won't help it, as any other extensions are prone to the same problem. You will need to change the upload code to remove any ';' characters from the file name used to save the file.
Posted
Sometimes when you go to Google images and just click on those images, be it .jpg, .gif, .png and others they are not in actual fact images, but scripts that install stuff and then redirect you to this wonderful page that tells you that you have a virus installed and you need to purchase their software to remove it.
The point is that you need to know it is not restricted to .gif's and the only way to avoid it in the future is to disable uploads (or as Ruirib says).
The point is that you need to know it is not restricted to .gif's and the only way to avoid it in the future is to disable uploads (or as Ruirib says).
Cheers,
David Greening
David Greening
Posted
Is this a new one?! We already had the null-attack a while ago, which we fixed in the upload code....didn't we also take out the other possible attacks?
portfolio - linkshrinker - oxle - twitter
Posted
Crap...confirmed that this works: http://oxle.com/uploaded/18/9/hello.asp;.gif
Seems to be an IIS loophole... All Snitz sites that allow people to upload even avatars are possibly vulnerable....ouch.
I fixed it by adding a line to the upload code (uploadengine.asp if I recall correctly).
where I first had only this:
I now have this:
If I now try to upload a file using the semicolon trick, I get a nice error.
Seems to be an IIS loophole... All Snitz sites that allow people to upload even avatars are possibly vulnerable....ouch.
I fixed it by adding a line to the upload code (uploadengine.asp if I recall correctly).
where I first had only this:
Code:
faname = Replace(objUpload.Files.Item(0).FileName,vbNullChar,"")Code:
faname = Replace(objUpload.Files.Item(0).FileName,vbNullChar,"")
faname = Replace(objUpload.Files.Item(0).FileName,";","") portfolio - linkshrinker - oxle - twitter
Last edited by MarcelG on 12 September 2011, 07:58
Posted
That depends on the mod that you are using. The versions I have seen with Mike's attachment mod, use a function IsValidString that won't allow file names with characters such as ";". I am not sure whether this was added by me, though.
Posted
Random thought, but would checking the MIME type sent by the browser help?
The only issue I know of is that Chrome has a disappearing/reappearing bug where it will/won't send the MIME type information with the upload. It's an interesting mix of funny/sad to see the same bug report get opened and closed like that...
The only issue I know of is that Chrome has a disappearing/reappearing bug where it will/won't send the MIME type information with the upload. It's an interesting mix of funny/sad to see the same bug report get opened and closed like that...
Posted
The problem is not when you upload the file, as that brings no issues. However, if you try to view a file with a name of .asp;.gif, seems IIS uses just the part of the name until the semicolon and executes the file as an asp script. So I have to agree with Marcel when he says this must be an IIS issue.
Posted
this issue affects Apache as well, so is not just an IIS issue. and mimetypes can be spoofed so checking mimetype wouldn't help, the only way to ensure it is an image is to read the file header and check that.
Posted
Didn't know about Apache.
I think the main concern is to avoid the execution of any script. For that purpose, restricting characters that can be used in filenames seems to work well.
Posted
would need to check what happens with say something like file.asp.gif no illegal characters in that. so a check for multiple . would probably also be a good idea
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...