Click here to Skip to main content
12,819,738 members (33,851 online)
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 21 Sep 2010

Security: Protect against POET Attacks with Custom Errors!

, 21 Sep 2010 CPOL
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 9:24
memberburntass29-Nov-10 9:24 
GeneralRe: 500ms delay Pin
Martin Jarvis29-Nov-10 9:29
memberMartin Jarvis29-Nov-10 9:29 
By adding a random delay into the error page response time, you make it harder for an attacker to analyse the response time to determine the type of exception being thrown.

GeneralMy vote of 5 Pin
Xmen W.K.22-Sep-10 16:19
memberXmen W.K.22-Sep-10 16:19 

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

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

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