DNN Blog

Sep 18

Posted by: cathal connolly
Saturday, September 18, 2010 5:55:00 PM  RssIcon

Background
A critical serious vulnerability in asp.net was publically disclosed late Friday at a security conference.  We recommend that all users immediately apply a workaround (described below) to prevent attackers from using this vulnerability against your DotNetNuke (and any other ASP.NET) applications.

We initially became aware that of the potential existence of this issue on Tuesday and reached out to the two researchers involved, who responded and made us aware that it was an asp.net issue and that they had successfully used it against a DotNetNuke install and intended to demonstrate that during a conference on Friday 17th September. They also confirmed that original reports that changing the encryption scheme in the web.config of asp.net websites were incorrect and did not stop their exploit.

The DotNetNuke security team immediately began to read all the available material on this and similar oracle padding attacks and considered potential mitigations we could create. In addition we reached out to our contacts in the asp.net team and the Microsoft Vulnerability Research (MSVR) team to let them know the additional information we had and to ensure that we would hear about any further details or workarounds they determined.

Immediately after the first public demonstration of the bug (and a related video demonstration), Microsoft determined a workaround that will protect asp.net sites (including DotNetNuke sites), whilst they work on a more permanent solution - likely a server patch to resolve this at the machine/framework level.

Determining framework version
There are two separate workarounds dependant on the .net framework version a website is using, so it's important that before applying the workaround you determine the correct version to use.

Getting framework version from DotNetNuke
To determine the version of the .net framework a DotNetNuke site is running against, please log in as host and go to host->host settings. The version will be shown under the .net framework field e.g. in this site DotNetNuke is running under .net 2.0 and should use the first version of the fix.

 
And in this site DotNetNuke is running under .net 3.5 and should use the 2nd variant of the fix.


 

Getting framework version from IIS
If you have access to internet information server (IIS), please open it and expand out the "Application pools" node. This will display a list of available application pools and their .net framework version.




If you're unsure what application pool your website is using, select the website in IIS, and then click the "Basic settings" link - a screen similar to this will appear:


 
Note: Clicking the select button will open up the application pool dialog which also contains the framework version e.g.


Getting framework version from the web.config

The version of the framework in use is also shown in the web.config file. The value is in a number of locations, but the most obvious will be the node. If it's using .net 3.5 or higher it will contain a number of entries that reference that e.g.


Applying the workaround

Note: The following is extracted from the blog at http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx

If you are using ASP.NET 1.0, ASP.NET 1.1, ASP.NET 2.0, or ASP.NET 3.5 then you should follow the below steps to enable and map all errors to a single error page:

1) Edit your ASP.NET Application’s root Web.Config file.  If the file doesn’t exist, then create one in the root directory of the application.

2) Create or modify the section of the web.config file to have the below settings:

  

3) You can then add an error.html file to your application that contains an appropriate error page of your choosing (containing whatever content you like).  This file will be displayed anytime an error occurs within the web application.

Notes: The important things to note above is that customErrors is set to “on”, and that all errors are handled by the defaultRedirect error page.  There are not any per-status code error pages defined – which means that there are no sub-elements within the section.  This avoids an attacker being able to differentiate why an error occurred on the server, and prevents information disclosure.

Enabling the Workaround on ASP.NET V3.5 SP1 and ASP.NET 4.0

If you are using ASP.NET 3.5 SP1 or ASP.NET 4.0 then you should follow the below steps to enable and map all errors to a single error page:

1) Edit your ASP.NET Application’s root Web.Config file.  If the file doesn’t exist, then create one in the root directory of the application.

2) Create or modify the section of the web.config file to have the below settings.  Note the use of redirectMode=”ResponseRewrite” with .NET 3.5 SP1 and .NET 4.0:

   

3) You can then add an Error.aspx to your application that contains an appropriate error page of your choosing (containing whatever content you like).  This file will be displayed anytime an error occurs within the web application.

Note: we highly recommend you read both the Microsoft advisory http://www.microsoft.com/technet/security/advisory/2416728.mspx and Scott Guthries blog for further details http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx and for an example of the error.aspx page.

What happens now?

We've already taken steps to protect our DotNetNuke properties to ensure that they're safe, and to ensure that no user data could be accessed. We've put together an action plan to push this message out as widely as possible, and the development team are working on a fix that we can include in the forthcoming 5.5.1 as well as a solution for people who cannot upgrade quickly for some reason, and are not confident about applying the manual workaround. We'll release more details once we have them.

*** Update - Monday 20th September ***
We've receieved a lot of emails about this so I thought I'd answer a few of the common questions about the Microsoft Oracle padding security issue:

  • Is this a DotNetNuke specific issue? No, it’s a problem in all versions of asp.net, so you’ll want to update all your asp.net sites. It’s also not webform specific, so please fix your ap.net mvc sites. Finally, it’s also easy to forget some less obvious asp.net sites so be sure to patch all your sharepoint, outlook web access and team foundation server sites.

  • Can i keep my existing custom 404 page? No, the workaround requires all HTTP exceptions to be redirected to the same page. We recommend commenting out any error status code lines so you can revert to them once Microsoft have provided a more permanent fix - 5.5.1 will automate this part.

  • Is the default DotNetNuke web.config secure enough , i’ve read that RemoteOnly is enough to stop this attack? No, it’s not enough to use RemoteOnly (or On) – you need to redirect all the http exceptions to the same file to foil the padding attacks

  • I read that changing to 3DES protects against this, is that true? No, it’s not, the attack does not depend on the ciphertext itself, so the encryption method used is irrelevant.

  • The Microsoft advisory suggest creating an error.aspx page, but i know DotNetNuke has one - is that ok to use? Theoretically it’s fine to use as it fulfils the first aim of the workaround, that of redirecting all errors to one page. However, this type of attack also commonly utilises timing as a side channel (http://en.wikipedia.org/wiki/Side_channel_attack). The Microsoft error.aspx page also adds a small time delay to further obfuscate this. Currently we’d recommend creating a file using the Microsoft example code. As part of 5.5.1 we will be updating our errorpage.aspx, so it can be reused.

  • Is this a permanent fix? No, it’s just a short-term workaround, and does mean that sites temporarily can’t run with custom pages for http exceptions (such as custom 404 pages). It’s expected that MS will have a security patch that can be deployed to resolve this correctly, allowing sites to revert to their previous customErrors settings.

*** Final update ***

  • Subsequent to the previous update, Microsoft and other security researchers realised that there were additional variants on the attack that could be used. At least one of these could not be protected via any workaround. The only valid fix for this is to install the security patch that Microsoft created to fully resolve it. This patch will be automatically deployed as a Windows Update as part of the September patches, and will resolve this issue for all versions of the .net framework on the machine (i.e. it is a server level fix, not a site level fix). Further details can be read at http://www.microsoft.com/technet/security/bulletin/ms10-sep.mspx

27 comment(s) so far...


Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Thanks for promoting this Cathal. I was out of the loop until I saw Chris and Charles' tweets late last night. My personal web server was good but the one at work....whoa boy.

By Mike Horton on   Saturday, September 18, 2010 11:49:28 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Guys, this works ok with my IIS 7.5 for non existent .aspx pages.

BUT if you search for pages with no extension for example, i still get DETAILED errors.

Any ideas ?

By Dimitris Alifragis on   Sunday, September 19, 2010 3:02:49 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Dimitris, that's fine, the error works against .net pages. Issues that occur to non .net pages such as cfm/php/asp/htm etc (including externsionless non-.net requests) are not exploitable.

By cathal connolly on   Sunday, September 19, 2010 8:08:39 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Hi - from what I gathered on ScottGu's posting, the first workaround applies to .NET Framework 1.0 to 3.5 while the second applies to 3.5 SP1 to 4.0, so in the case of your example, the second site should also use the first workaround since it's only 3.5 and not 3.5 SP1.

By Ryan Shripat on   Tuesday, September 21, 2010 1:26:00 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

The host settings for my DNN installation show that my .NET Framework is 3.5
My server shows Microsoft .NET Framework 3.5 SP1 is installed in Add/Remove Programs.
The Web.config System.Core has Version=3.5.0.0
Since I am running IIS 6.0 it is not showing the .NET version. (The example is for IIS 7)

So, with the information from above it is not clear whether I should use the workaround for 3.5 or 3.5 SP1. My guess is 3.5 SP1 but I hate to guess.

I also have another installation on a hosted server where I cannot access IIS. Is there any other way to distinguish 3.5 from 3.5 SP1 that is clearer?

If I cannot tell the difference, which workaround should I use?

By Lance Prager on   Tuesday, September 21, 2010 1:26:21 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

We have created a package to help users patch their installations. In addition to Microsoft recommendations, the package also protects against forged auth cookies. You can find more information in the install.txt inside the zip file: bit.ly/cZsVyA

We'll try to find some time to make an auto installer for this. You can follow us on Twitter @PremiumDNN

By Etienne Richard on   Tuesday, September 21, 2010 1:36:52 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Quick question. My customerErrors currently states "mode=RemoteOnly". Should that be replaced with the "defaultRedirect="? or do I keep that there and just add the defaultRedirect?

Thanks for staying on top of this!

By Mark Gordon on   Tuesday, September 21, 2010 4:06:46 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

If you host with PowerDNN it has been taken care of for you.

By Greg Brown on   Tuesday, September 21, 2010 4:06:21 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Ryan , the fixes are in the correct order, the application does not show the difference between 3.5 and 3.5sp1. You can check yourself by looking in the web.config for system.data.linq - if it's there it's 3.5 sp1. Please note, the 3.5sp1/4.0 fix will cause an exception in older versions of the framework.

By cathal connolly on   Tuesday, September 21, 2010 4:13:19 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Lance, check your web.config for system.data.linq it was only introduced in .net 3.5 sp1.

By cathal connolly on   Tuesday, September 21, 2010 4:14:50 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Etienne Richard , thanks for the useful option -however you should let people know that it uses sessions as that will not work correctly with some web farm setups.

By cathal connolly on   Tuesday, September 21, 2010 4:17:53 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Mark, the mode is fine (either RemoteOnloy or On), you need to add the defaultRedirect attribute.

By cathal connolly on   Tuesday, September 21, 2010 4:18:52 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Pretty sure the "e" in

By ron dyar on   Wednesday, September 22, 2010 12:52:47 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

replaced my actual



with









An error appear

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized element 'configuration'.

Source Error:

Line 167:
Line 168:
Line 169:
Line 170:
Line 171:

By Rino Martini on   Wednesday, September 22, 2010 12:59:47 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Rino, i can't see your actual error as it's been stripped - i recommend you back out your changes and upgrade to 5.5.1 when it's released (it will apply the changes) or else email the full web.config and error details to security@dotnetnuke.com

By cathal connolly on   Wednesday, September 22, 2010 1:01:31 PM
Gravatar

Error when applying this fix.

When I try to apply this fix to my website, I get a 500 error for the whole site. Has anybody else had this problem and if so how did you solve it.

By Greg Hiszczynskyj on   Wednesday, September 22, 2010 2:25:34 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

How does the "Use Custom Errors" setting in DNN itself affect this fix? Does that checkbox need to be cleared as well?

By Jeff B on   Wednesday, September 22, 2010 2:27:23 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Greg - AFAIK you can get that message if you use the .net 3.5sp1/.net 4.0 version of the fix against a .net 2.0 - please try using the 1st version of the fix (that use a htm page as the error). Also, this can happen if the xml is not well-formed, please check all your angle brackets in the web.config

By cathal connolly on   Wednesday, September 22, 2010 2:28:53 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Jeff B - the custom errors setting is used for errors processing modules - the oracle padding attack works against the page, so it's not affected by the setting value (it relies on page level http status exceptions)

By cathal connolly on   Wednesday, September 22, 2010 2:35:37 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Jeff B, see my answer above (comments ordering incorrectly) and please stop posting the same question.

By cathal connolly on   Wednesday, September 22, 2010 3:20:38 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

My comment above got chopped off for some reason - if you are copy and pasting directly from the above code for the custom errors part, I think the e in errors should be a capital E - otherwise you will get a 500 error - like Greg above possibly. For me customErrors worked, but customerrors like above through the 500 error.

By ron dyar on   Thursday, September 23, 2010 5:19:11 PM
Gravatar

Error when applying this fix

500 error: You can temprarily use remoteErrors=RemoteOnly if you can login locally or use remoteErrors=Off to view the actual cause of the error. Oncs the issue is resolved, then change remoteErrors to the recommended setting based on your platform.

By Dwayne Baldwin on   Thursday, September 23, 2010 3:27:58 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Jeff B, see my answer above (comments ordering incorrectly) and please stop posting the same question.

By cathal connolly on   Thursday, September 23, 2010 12:48:52 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@ron, thanks. I copied the entries from Scott Guthries blog and didn't notice that his were wrong (he's since updated). I've updated the references here to the correct customErrors value.

By cathal connolly on   Thursday, September 23, 2010 8:26:29 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

Thanks for the response...as for posting the same question, I posted my question once. Something isn't right with your blog commenting as you can see by the incorrect ordering of the comment timestamps.

By Jeff B on   Monday, October 18, 2010 10:01:26 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

I couplet to the letter shown to protect my site, however, still get the error in event viewer. Any ideas?
A critical ASP.NET Oracle Padding vulnerability has been identified in your website. We recommend that you patch your site immediately. For more information on this issue and instructions on how to patch your site refer to www.dotnetnuke.com/aspnetpoet.aspx

By Jose Maldonado on   Monday, October 18, 2010 10:01:42 PM
Gravatar

Re: ASP.NET Security Vulnerability workaround for DotNetNuke sites

@Jose Maldonado, no, i'm not sure why this should be showing - please send an email with a copy of your web.config to security@dotnetnuke.com

By cathal connolly on   Monday, October 18, 2010 10:03:19 PM
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
Charlotte DoDNN

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Exact Target Exec Alert
PowerDNN
r2integrated

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.