Application Security Resources

Sub Text of Application Security Resources

Insecure Redirect in .NET Form Authentication -Redirect From Login Mechanism

February 8, 2012

Tiny Url for this post: http://tinyurl.com/p3jfnsg

Seeker Research Center
By Irene Abezgauz febuary 16th, 2012
This vulnerability was discovered by Seeker™;

Overview

An Insecure Redirect vulnerability has been identified in the .NET Form Authentication – in the Redirect From Login mechanism. This vulnerability allows an attacker to craft links that contain redirects to malicious sites in the ReturnURL parameter.

The exploitation technique detailed in this document bypasses the CrossAppRedirects restriction and was successfully performed on applications that do not have EnableCrossAppRedirects in the web.config (false by default), or have the EnableCrossAppRedirects attribute explicitly set to false in web.config.

Details

The .NET Forms Authentication Redirect From Login mechanism is vulnerable to insecure redirect attacks.

http:///Login.aspx?ReturnURL=

By sending specially crafted input containing a backslash (“\”) at the end of the URL as the value of the ReturnURL parameter it is possible to bypass the CrossAppRedirects restrictions and embed links that lead to sites outside the current application.

Once a victim follows the specially crafted link he indeed arrives at the login screen of the vulnerable application. Once he submits his username and password and performs a successful login instead of being redirected to the URL in the DefaultURL property he will be redirected to the URL in the value of the ReturnURL parameter.

To reproduce, a simple Login page can be created, for example Login.aspx, and the following lines added in web.config:

Exploit

An attacker can embed any link that terminates with the “\” (backslash) character, for example:

http:///Login.aspx?ReturnURL=http://www.seekersec.com\

 

Solution

Microsoft has released a fix for this vulnerability, see http://technet.microsoft.com/en-us/security/bulletin/MS11-100 for further information

Affected Systems

.NET frameworks 2.0, 3.5 and 4.0 were tested and found vulnerable to this flaw in simple login that has Form Authentication web.config configuration with default parameters.

Credit

The vulnerability was discovered by Irene Abezgauz, Seeker Research Center.

This post is also available in: Anglais

Learn more about Seeker

More Avis de sécurité