Click here to Skip to main content
11,805,604 members (52,921 online)
Click here to Skip to main content

Security: Protect against POET Attacks with Custom Errors!

, 21 Sep 2010 CPOL 8.5K 3
Rate this:
Please Sign up or sign in to vote.
Protect against POET Attacks with Custom Errors!

There’s been a big deal made of a serious security flaw in ASP.NET which potentially affects a lot of .NET sites, that allows a 3rd Party to trick ASP.NET into serving sensitive files within a web application folder.  Microsoft has released an official advise on how to temporarily patch the problem which revolves around forcing Error and Page Not found pages to return the same status page. This would need to stay in place until a permanent fix is released.

This workaround clearly introduces an usability issue, which the client may not accept.

Fortunately a quick amend to my Custom Error Module can secure your site against the attack with minimal impact to usability.

 using System;
 using System.Web;
 using System.Net;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Web.Configuration;
 namespace MartinOnDotNet.Website.Support
     /// <span class="code-SummaryComment"><summary>

The amendments hinge on the fact that the exploit only really affects the WebResource.axd and ScriptResource.axd so any error relating to these handlers is automatically given an 500 status (Internal Server Error) and treated as a normal error. This is an acceptable compromise for me as all references to these handlers should be programmatically generated and by your site and therefore ‘correct’.

As per Scott Gu’s recommendation, I’ve added a random <500ms delay to the processing of all errors to help muddy the waters and added support for the ResponseRewrite property on the CustomErrors element.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Martin Jarvis
Software Developer (Senior) Freestyle Interactive Ltd
United Kingdom United Kingdom
I'm a lead developer for Freestyle Interactive Ltd where we create many wonderful websites built on Microsofts ASP.Net and Ektron CMS.

I've been developing .Net applications (both Windows and Web) since 2002.

You may also be interested in...

Comments and Discussions

General500ms delay Pin
burntass29-Nov-10 8:24
memberburntass29-Nov-10 8:24 
GeneralRe: 500ms delay Pin
Martin Jarvis29-Nov-10 8:29
memberMartin Jarvis29-Nov-10 8:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151002.1 | Last Updated 22 Sep 2010
Article Copyright 2010 by Martin Jarvis
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid