ÎÜñ|‹ø\/\/ñ [ÐëÞrëçã†ëð]'s Blog

Amit Bahree's insight into stuff...

News

And God said "Let there be light". But then the program crashed because he was trying to access the 'light' property of a NULL universe pointer.

blog roll

calendar

intersting finds

reading

techy finds

What you should know about a new Vulnerability in ASP.NET

Microsoft is currently investigating a reported vulnerability in ASP.NET (does not affect ASP) where an attacker can send specially crafted requests to the server and view secured content without providing the proper credentials. This issue affects anyone running any version of ASP.NET on Microsoft Windows 2000 Professional, 2000 Server, XP Professional, and 2003 Server.

The issue at hand really is that asp.net does not perform a proper canonicalization (will get to what it is in a minute) of some URLs.

So what should you do? Good question, to begin add additional canonicalization safeguards to your Web application. To easily do this add the Application_BeginRequest event handler in your Global.asax file. Since, this event handler executes for each Web request, it is a convenient location to insert code to help safeguard against canonicalization issues. Here is a sample:

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");
    }
}

What is Canonicalization? It is the process by which various equivalent forms of a name can be resolved to a single, standard name - the so-called canonical name. 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:
c:\temp\somefile.dat

The following strings could also represent the same file:

  • somefile.dat
  • c:\temp\subdir\..\somefile.dat
  • c:\  temp\   somefile.dat
  • ..\somefile.dat
  • c%3A%5Ctemp%5Csubdir%5C%2E%2E%5Csomefile.dat

In example above, characters have been specified in hexadecimal form:

  • %3A is the colon character.
  • %5C is the backslash character.
  • %2E is the dot character.

You should generally try to avoid designing applications that accept input file names from the user to avoid canonicalization issues. Consider alternative designs instead. For example, let the application determine the file name for the user.

If you do need to accept input file names, make sure they are strictly formed before making security decisions such as granting or denying access to the specified file.

More Information:

Comments

Amit Bahree said:

I really enjoyed reading an article on the birth of Pacific Poker School, and I followed to experience Pacific Poker School http://pacific-poker.p8.org.uk/ Pacific Poker School live. Think of every <a href="http://pacific-poker.p8.org.uk/">Pacific Poker School</a> you know - they do not match!
# December 25, 2005 11:47 AM

Amit Bahree said:

Look at <a href="http://pacific-poker.p8.org.uk/">play">http://pacific-poker.p8.org.uk/">play pacific poker</a> - the most trusted site in the business. Do not miss play pacific poker http://pacific-poker.p8.org.uk/ play pacific poker.
# December 26, 2005 7:41 AM

Amit Bahree said:

Great site! Visit also <a href="http://poker.rtq2.com/">poker">http://poker.rtq2.com/">poker tournament</a>, it is probably the best on net! The most exciting site poker tournament http://poker.rtq2.com/ poker tournament is for you.
# December 26, 2005 9:39 PM

Amit Bahree said:

I thought I have already seen anything but <a href="http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">ESPN-com-World-Series-of-Poker</a>">http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">ESPN-com-World-Series-of-Poker</a> truely puzzled me. ESPN-com-World-Series-of-Poker http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html ESPN-com-World-Series-of-Poker with others from around the world. Having to choose one from the many possible ESPN-com-World-Series-of-Poker sites on net have truely become a difficult task these days. Select ESPN-com-World-Series-of-Poker http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html">http://casino.rtq2.com/ESPN-com-World-Series-of-Poker.html ESPN-com-World-Series-of-Poker and the choice will be obvious.
# December 27, 2005 10:19 AM

Amit Bahree said:

Playing the best <a href="http://www.slot-machines-888.com/directory">Slot">http://www.slot-machines-888.com/directory">Slot Machines 888 Directory</a> on the web is fun and exciting. Why wait? Have Slot Machines 888 Directory http://www.slot-machines-888.com/directory Slot Machines 888 Directory fun.
# December 27, 2005 10:36 PM

Amit Bahree said:

Not necessary, Mark! Look at pacific-poker-school http://pacific-poker.p8.org.uk/pacific-poker-school/index.html pacific-poker-school. I really enjoyed reading an article on the birth of pacific-poker-school, and I followed to experience <a href="http://pacific-poker.p8.org.uk/pacific-poker-school/index.html">pacific-poker-school</a> live.
# December 28, 2005 11:42 PM

Amit Bahree said:

Only at party-poker http://pacific-poker.8bit.co.uk/party-poker.html party-poker you can really play. A superb <a href="http://pacific-poker.8bit.co.uk/party-poker.html">party-poker</a>, with great playing and gambling.
# January 1, 2006 2:01 PM

Amit Bahree said:

Only at <a href="http://888.typo7.com/pacific-poker.html">pacific">http://888.typo7.com/pacific-poker.html">pacific poker reviews</a>, the leader of pacific poker reviews. Playing the best pacific poker reviews http://888.typo7.com/pacific-poker.html pacific poker reviews on the web is fun and exciting.
# January 2, 2006 3:29 AM

Amit Bahree said:

Look at <a href="http://888.typo7.com/pacific-poker.html">http://888.typo7.com/pacific-poker.html">pacific">http://888.typo7.com/pacific-poker.html">http://888.typo7.com/pacific-poker.html">pacific poker reviews</a> - the most trusted site in the business. When you truely want to play pacific poker reviews http://888.typo7.com/pacific-poker.html">http://888.typo7.com/pacific-poker.html pacific poker reviews look no further. Think of every pacific poker reviews http://888.typo7.com/pacific-poker.html">http://888.typo7.com/pacific-poker.html pacific poker reviews you know - they do not match!
# January 2, 2006 3:29 AM

Amit Bahree said:

Thanks for the information, Alex. See also play with the stars summary at play with the stars http://stars-poker.p6.org.uk play with the stars. Have Fun! I thought I have already seen anything but <a href="http://stars-poker.p6.org.uk">play with the stars</a> truely puzzled me.
# January 2, 2006 4:11 PM

Amit Bahree said:

<a href="http://pacific-poker.p8.org.uk">pacificpoker</a>">http://pacific-poker.p8.org.uk">pacificpoker</a>, secure, fun, pleasure to gamble and win. Look at pacificpoker http://pacific-poker.p8.org.uk pacificpoker - the most trusted site in the business. Only at <a href="http://pacific-poker.p8.org.uk">pacificpoker</a>">http://pacific-poker.p8.org.uk">pacificpoker</a> you can really play.
# January 3, 2006 7:12 AM

Amit Bahree said:

The biggest <a href="http://pacific-poker.p8.org.uk">http://pacific-poker.p8.org.uk">pacificpoker</a>">http://pacific-poker.p8.org.uk">http://pacific-poker.p8.org.uk">pacificpoker</a> of all is you best bet on betting. Searching pacificpoker http://pacific-poker.p8.org.uk">http://pacific-poker.p8.org.uk pacificpoker - you have found it. Truely and amazing pacificpoker http://pacific-poker.p8.org.uk">http://pacific-poker.p8.org.uk pacificpoker site.
# January 3, 2006 7:13 AM

Amit Bahree said:

It was briling and the slythie <a href="http://slots.7p.org.uk/">online">http://slots.7p.org.uk/">online slots</a> was crankling on the brawl. The ultimate online slots http://slots.7p.org.uk/ online slots is waiting for you.
# January 6, 2006 10:11 AM

Amit Bahree said:

The biggest <a href="http://poker-party.p6.org.uk">http://poker-party.p6.org.uk">poker">http://poker-party.p6.org.uk">http://poker-party.p6.org.uk">poker party</a> of all is you best bet on betting. Why wait? Have poker party http://poker-party.p6.org.uk">http://poker-party.p6.org.uk poker party fun. The best poker party http://poker-party.p6.org.uk">http://poker-party.p6.org.uk poker party in the world.
# January 10, 2006 4:09 PM

Amit Bahree said:

Look at <a href="http://poker-star.fbhosting.com">poker">http://poker-star.fbhosting.com">poker star</a> - the most trusted site in the business. When you truely want to play poker star http://poker-star.fbhosting.com poker star look no further. Here it comes <a href="http://poker-star.fbhosting.com">poker">http://poker-star.fbhosting.com">poker star</a> pleasure gaming, betting, and gambling.
# January 11, 2006 8:17 AM

Amit Bahree said:

You are invited to visit the best sites on poker table <a href="http://www.hobbyworkshop.com/poker-tournament.html">pacific poker</a> then I wish to recommand you <a href="http://poker.rtq2.com/poker-superstars.html">poker superstars</a> online poker site. You can also find other poker and casino <a href="http://golden-palace.greenline.ru">info</a> and tips. If you love poker then <a href="http://quegu.topcities.com/">poker online</a> is what you are looking for on the web. You can also find up to $200 bonus at <a href="http://slots.7p.org.uk/slot-machines.html">slot machines</a> that can help you in your first <a href="http://golden-palace.coms.ph">poker steps</a>.
# January 22, 2006 6:46 PM