Information Technology
SecurityTop 10 Application Security Vulnerabilities in Web.config Files - Part Two
Author: Bryan Sullivan | Category: Security | Comments (0)Table of Contents
Top 10 Application Security Vulnerabilities in Web.config Files - Part Two
Failure to Require SSL for Authentication Cookies
Sliding Expiration Used
Non-Unique Authentication Cookie Used
Hardcoded Credentials UsedNon-Unique Authentication Cookie Used
9. Non-Unique Authentication Cookie Used
Over the last few sections, I hope I have successfully demonstrated the importance of application security and of storing your application's authentication token in a secure cookie value. But a cookie is more than just a value; it is a name-value pair. As strange as it seems, an improperly chosen cookie name can create an application security vulnerability just as dangerous as an improperly chosen storage location.
Vulnerable configuration: <configuration> <system.web> <authentication mode="Forms"> <forms name=".ASPXAUTH">
Secure configuration: <configuration> <system.web> <authentication mode="Forms"> <forms name="{abcd1234…}">
The default value for the name of the authentication cookie is .ASPXAUTH. If you have only one Web-based application on your server, then .ASPXAUTH is a perfectly secure choice for the cookie name. In fact, any choice would be secure. But, when your server runs multiple ASP.NET Web-based applications, it becomes critical to assign a unique authentication cookie name to each application. If the names are not unique, then users logging into any of the Web-based applications might inadvertently gain access to all of them. For example, a user logging into the online shopping site to view his order history might find that he is now able to access the administration application on the same site and change the prices of the items in his shopping cart.
The best way to ensure that all Web-based applications on your server have their own set of authorized users is to change the authentication cookie name to a unique value. Globally Unique Identifiers (GUIDs) are excellent choices for application security since they are guaranteed to be unique.
Microsoft Visual Studio helpfully includes a tool that will automatically generate a GUID for you. You can find this tool in the Tools menu with the command name "Create GUID". Copy the generated GUID into the name attribute of the forms element in the configuration file.
Next Page: Hardcoded Credentials Used
