Automatic Connection to an Untrusted URL

Automatic Connection to an Untrusted URL

Overview

Open redirects happen when an application redirects users to a URL supplied by an attacker.

Impact

They can support phishing, token theft, and trust abuse because the redirect starts from a legitimate site.

Countermeasures

Allow only trusted destinations, map redirect IDs to server-side URLs, and reject external or malformed targets.

Examples

<html>
<head>
</head>
<body>
    URL : ${param.url}
  <%
       if (request.getParameter("url") != null)
           response.sendRedirect(request.getParameter("url"));
  %>
</body>
</html>