1118
ParentOf 601 URL Redirection to Untrusted Site ('Open Redirect') 1345
ParentOf 611 Improper Restriction of XML External Entity Reference 1367
PeerOf 386 Symbolic Name not Mapping to Correct Object 942
Relevant to the view "Weaknesses for Simplified Mapping of Published
Vulnerabilities" (CWE-1003)
Nature Type ID Name Page
ParentOf 384 Session Fixation 936
ParentOf 601 URL Redirection to Untrusted Site ('Open Redirect') 1345
ParentOf 611 Improper Restriction of XML External Entity Reference 1367
ParentOf 918 Server-Side Request Forgery (SSRF) 1820
ParentOf 1021 Improper Restriction of Rendered UI Layers or Frames 1860
Relevant to the view "Architectural Concepts" (CWE-1008)
Nature Type ID Name Page
MemberOf 1015 Limit Access 2430
Common Consequences
Scope Impact Likelihood
Confidentiality
Integrity
Read Application Data
Modify Application Data
Demonstrative Examples
Example 1:
The following code is a Java servlet that will receive a GET request with a url parameter in the
request to redirect the browser to the address specified in the url parameter. The servlet will
retrieve the url parameter value from the request and send a response to redirect the browser to
the url address.
Example Language: Java (Bad)
public class RedirectServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String query = request.getQueryString();
if (query.contains("url")) {
String url = request.getParameter("url");
response.sendRedirect(url);
}
}
}
The problem with this Java servlet code is that an attacker could use the RedirectServlet as part
of an e-mail phishing scam to redirect users to a malicious site. An attacker could send an HTML
CWE Version 4.14
CWE-610: Externally Controlled Reference to a Resource in Another Sphere
CWE-610: Externally Controlled Reference to a Resource in Another Sphere