This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org

Difference between revisions of "Execution After Redirect (EAR)"

From OWASP
Jump to: navigation, search
(Examples)
(Examples: - fixed code example formatting)
Line 24: Line 24:
 
Using the "How to Test for EAR Vulnerabilities" section or by disabling JavaScript in the browser, the same request is repeated without following the JavaScript redirect and the "Admin" section is accessible without authentication.  
 
Using the "How to Test for EAR Vulnerabilities" section or by disabling JavaScript in the browser, the same request is repeated without following the JavaScript redirect and the "Admin" section is accessible without authentication.  
  
 +
<pre>
 
<?php
 
<?php
 
if (!$loggedin) {
 
if (!$loggedin) {
Line 32: Line 33:
 
<a href=/mu>Manage Users</a><br />
 
<a href=/mu>Manage Users</a><br />
 
<a href=/ud>Update Database Settings</a>
 
<a href=/ud>Update Database Settings</a>
 +
</pre>
  
 
==References==
 
==References==

Revision as of 18:15, 2 May 2017

This article is a stub. You can help OWASP by expanding it or discussing it on its Talk page.


This is an Attack. To view all attacks, please see the Attack Category page.


Last revision (mm/dd/yy): 05/2/2017

Overview

Execution After Redirect (EAR) is an attack where an attacker ignores redirects and retrieves sensitive content intended for authenticated users. A successful EAR exploit can lead to complete compromise of the application.

How to Test for EAR Vulnerabilities

Using most proxies it is possible to ignore redirects and display what is returned. In this test we use Burp Proxy.

  1. Intercept request https://vulnerablehost.com/managment_console
  2. Send to repeater.
  3. View response.

How to Prevent EAR Vulnerabilities

Proper termination should be performed after redirects. In a function a return should be performed. In other instances functions such as die() should be performed. This will tell the application to terminate regardless of if the page is redirected or not.

Description

Examples

The following code will check to see if the parameter "loggedin" is true. If it is not true, it uses JavaScript to redirect the user to the login page. Using the "How to Test for EAR Vulnerabilities" section or by disabling JavaScript in the browser, the same request is repeated without following the JavaScript redirect and the "Admin" section is accessible without authentication.

<?php
if (!$loggedin) {
    print "<script>window.location = '/login';</script>\n\n";
}
?>
<h1>Admin</h1>
<a href=/mu>Manage Users</a><br />
<a href=/ud>Update Database Settings</a>

References