Reputation: 21
While I was on my site I mistyped a symbol and the page came back with a "error(?)."
browse.asp?A=0000 <-- That is the folder, I placed a backwards slash at.
Here is my issue, when that happened this is what appeared "System Folder - Do Not Delete" is this a vulnerability(?) or is this just a error nothing to really worry about?
Upvotes: 2
Views: 778
Reputation: 33578
This could be a directory traversal vulnerability.
This is when a malicious user can enter ..
or /
characters to a parameter that your application uses to locate a file. This can be more tricky than expected to defend against, as filtering the ..
and /
characters may not always be enough. Attacks can bypass the filters of certain languages by double encoding these characters or swapping /
for \
or by passing null bytes (%00
) or a combination of these thereof.
To defend against this your page should check the following (in order).
/
, \
and null bytes. If the parameter value contains any, you should fail with an error (do not attempt to try and "clean" the parameter as the sanitization routine could be something for the attacker to attempt to bypass). e.g. /bar/../foo.jpg
should be normalised as foo.jpg
as the ..
characters are moving the current directory outside of the bar
directory. Basically you are attempting to create a single normalized path for each file that can be referenced by your parameter so you can compare like for like.GetAbsolutePathName
function in ASP). Have a look at this article for more information: How to test for directory (path) traversal.
Upvotes: 2