OauthApplinksServlet Open Redirect

Type atlassian
Reporter danh
Modified 2017-02-20T00:44:33


The OauthApplinksServlet servlet has an open redirect vulnerability in the doGet that will allow phishers to lure users away from legitimate JIRA hosted sites. An open redirect vulnerability is caused by an attacker having control over a request parameter that hasn’t been validated before redirect. Using a relative URL or validating the argument before use should fix the issue.

File: applinks-plugin\src\main\java\com\atlassian\applinks\core\auth\Oauth\OAuthApplinksServlet.java

{code:title=OAuthApplinksServlet.java|borderStyle=solid} @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { ... catch (Exception e) { ... String redirectUrl = getRedirectUrl(req); if (redirectUrl == null) { redirectUrl = "#"; } context.put("redirectUrl", redirectUrl); templateRenderer.render(TEMPLATE, context, resp.getWriter()); ... private String getRedirectUrl(HttpServletRequest req) { return req.getParameter(REDIRECT_URL_PARAM); } {code}