Library tutorials & articles
Top 10 Application Security Vulnerabilities in Web.config Files - Part One
Custom Errors Disabled
Vulnerable configuration:
<configuration>
<system.web>
<customErrors mode="Off">
Secure configuration:
<configuration>
<system.web>
<customErrors mode="RemoteOnly">
In itself, knowing the source of an error may not seem like a risk to application security, but consider this: the more information a hacker can gather about a Web site, the more likely it is that he will be able to successfully attack it. An error message can be a gold mine of information to an attacker. A default ASP.NET error message lists the specific versions of ASP.NET and the .NET framework which are being used by the Web server, as well as the type of exception that was thrown. Just knowing which Web-based applications are used (in this case ASP.NET) compromises application security by telling the attacker that the server is running a relatively recent version of Microsoft Windows and that Microsoft Internet Information Server (IIS) 6.0 or later is being used as the Web server. The type of exception thrown may also help the attacker to profile Web-based applications; for example, if a "SqlException" is thrown, then the attacker knows that the application is using some version of Microsoft SQL Server.
You can build up application security to prevent such information leakage by modifying the mode attribute of the <customErrors> element to "On" or "RemoteOnly." This setting instructs Web-based applications to display a nondescript, generic error message when an unhandled exception is generated. Another way to circumvent this application security issue is to redirect the user to a new page when errors occur by setting the "defaultRedirect" attribute of the <customErrors> element. This approach can provide even better application security because the default generic error page still gives away too much information about the system (namely, that it's using a Web.config file, which reveals that the server is running ASP.NET).
Related articles
Related discussion
-
Not able to launch the web application
by NaseemAhmed (0 replies)
-
Impersonation failing for a user.
by mittalpa (0 replies)
-
SharePoint Is Confusing
by dass ooo (1 replies)
-
Error Capture
by Slicksim (4 replies)
-
AJAX: SimpleWebServices is not defined
by Freon22 (2 replies)
Related podcasts
-
Episode 36: Scott Watermasysk
This week, the Herding Code cast talks shop with Scott Watermasysk about cloud computing, blogging platforms, Internet Explorer, the DotNetOpenId project and much more: Scott W, Scott K and Jon discuss Azure, Amazon Web Services and Google App Engine. Jon asks Scott W to share his thoughts on bl...
Events coming up
-
Dec
2
Web Standards Group (Sydney)
North Sydney, Australia
TBA
This thread is for discussions of Top 10 Application Security Vulnerabilities in Web.config Files - Part One.