Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security NTBugtraq
[Top] [All Lists]

Security bug in .NET Forms Authentication

Subject: Security bug in .NET Forms Authentication
Date: Tue, 14 Sep 2004 12:42:28 +0100
Hi

We believe we have discovered a serious flaw in .NET forms authentication
when used to secure sub folders.

A standard forms authentication setup requires the presence of "web.config"
to set the authentication method and login procedure. The presence of this
file prevents access to certain files (.aspx files for example) unless
authenticated.

Example
-------

The webroot for your website is:

c:\inetpub\wwwroot\mysite

You want to secure files in a sub directory "secure"

c:\inetpub\wwwroot\mysite\secure\web.config

A request to http://localhost/secure/somefile.aspx would then redirect the
user to a predefined authentication page, as defined in web.config, before
allowing the user access to "somefile.aspx".

Bug
---

1. Using Mozilla not IE, you make a request to
http://localhost/secure\somefile.aspx The use of a backslash rather than a
forward slash appears to bypass the expected authentication model invoked in
.NET forms authentication

2. Using IE, you make a request to http://localhost/secure\somefile.aspx -
IE automatically replaces the backslash "\" with a forward slash "/" and
everything appears fine. However, replace the backslash "\" with %5C (%5C
being hex value for \) and all is not so fine:

http://localhost/secure%5Csomefile.aspx

----

Interestingly (and I guess now somewhat amusingly) Microsoft point out in
the article "Design Guidelines for Secure Web Applications"
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/h
tml/THCMCh04.asp):

"Be Careful with Canonicalization Issues:

Data in canonical form is in its most standard or simplest form.
Canonicalization is the process of converting data to its canonical form.
File paths and URLs are particularly prone to canonicalization issues and
many well-known exploits are a direct result of canonicalization bugs. For
example, consider the following string that contains a file and path in its
canonical form."

And then goes on to define the exploit ;-)

(Russ - I have not posted this message anywhere as yet, nor have I contacted
Microsoft. If you indeed confirm this exploit, you are the first to know).

Regards,

==
Toby Beaumont
Director of Technology
Creator

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

This email and any attached files are for the exclusive use of the addressee
and may contain privileged and/or confidential information. If you receive
this email in error you should not disclose the contents to any other person
nor take copies but should delete it and telephone us immediately.

Creator makes no warranty as to the accuracy or completeness of this email
and accepts no liability for its contents or use. Any opinions expressed in
this email are those of the author and do not necessarily reflect the
opinions of Creator. 

If you or your employer does not consent to the receipt of emails of this
kind then please notify us immediately.

Creator
4 Grafton Mews
London
W1T 5JE
United Kingdom

Tel: 020 7391 5151
DDI: 020 7391 5128
Fax: 020 7391 5152

Web: http://www.creator.co.uk
****************************************************************************
*****
 

-----
NTBugtraq Editor's Note:

Want to reply to the person who sent this message? This list is configured such 
that just hitting reply is going to result in the message coming to the list, 
not to the individual who sent the message. This was done to help reduce the 
number of Out of Office messages posters received. So if you want to send a 
reply just to the poster, you'll have to copy their email address out of the 
message and place it in your TO: field.
-----

<Prev in Thread] Current Thread [Next in Thread>
  • Security bug in .NET Forms Authentication, Toby Beaumont <=