ValidateRequest question

D

Dilip

I have a question on the ValidateRequest directive at the Page level.
I ran into a case where my querystring was filled with some value that
contained the '<', '>' symbols. I promptly got this error back from
IIS:

===============
403: Access Forbidden

Due to the presence of characters known to be used in Cross Site
Scripting attacks, access is forbidden. This web site does not allow
Urls which might include embedded HTML tags.
=================

What I do not understand about this error is, who is throwing it? Is
it ASP.NET or IIS? If my querystring is rejected because
ValidateRequest directive is kicking in, then the wording of the error
happens to be different in that case, right? (something starting with
"A potentially dangerous value was detected....").

On another note -- in my laptop I have set ValidateRequest to true at
the page level but a similar URL with a '<' filled querystring value
goes through just fine.

What is happening?

thanks
--Dilip
 
B

Brock Allen

D

Dilip

Brock

I understand that. I guess you didn't read my post completely.

I have validateRequest set to true at the page level on my laptop --
the request URL, even if some querystring values contain dubious chars
like '<', '>', works just fine. It looks like ASP.NET doesn't bother
to check these at all.

However, on production, I get this access forbidden error I mentioned
in my original post. That leads me to believe something else (perhaps
an ISAPI filter?) is intercepting the request before it can reach my
ASP.NET app.

Another friend pointed out that it could be because of the IIS lock
down tool which employs Urlscan to filter creepy looking requests.
That is starting to make sense to me :)
 
B

Brock Allen

Hmm, my first reaction would be to see if there's a diff version of ASP.NET
on the two diff machines. The implementation has varied over different versions.
In ASP.NET 2.0 the rules have been relaxed quite a bit; there were odd patterns
that would be rejected by v1.1 that wouldn't pose a threat.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top