ASP.NET security issue - Ed's Blog
in

dotnet.org.za

South African .NET Developer Portal

Ed's Blog

Object reference not set to an instance of an object

ASP.NET security issue

Hot of the press, Microsoft advises that you stick this :

void Application_BeginRequest(object source, EventArgs e) {
    if (Request.Path.IndexOf('\\') >= 0 ||
        System.IO.Path.GetFullPath(Request.PhysicalPath) != Request.PhysicalPath) {
        throw new HttpException(404, "not found");
    }
}

in your global.asax to avoid unautherized access to files via “canonicalization” - this is stuff like http://dotnet.org.za/../../../mysecretfile.doc etc.

check out the KB article

Published Oct 07 2004, 08:47 AM by eduard
Filed under: ,

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Powered by Community Server (Commercial Edition), by Telligent Systems