Skip to content

Open Redirect Vulnerability #78

Description

@NinjaGPT

Summary

In the latest version 6.0.0, the OAuth logout functionality performs a URL redirect action when clearing tokens. However, this parameter is user-controllable and lacks security validation, allowing attackers to exploit this vulnerability to launch phishing and other attacks against users.

Details

  • src/main/java/com/central/oauth/handler/OauthLogoutSuccessHandler.java
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException {
    if (securityProperties.getAuth().getUnifiedLogout()) {
       unifiedLogoutService.allLogout();
    }

    String redirectUri = request.getParameter(REDIRECT_URL);
    if (StrUtil.isNotEmpty(redirectUri)) {
       //重定向指定的地址
       redirectStrategy.sendRedirect(request, response, redirectUri);
    } else {
       ResponseUtil.responseWriter(objectMapper, response, "登出成功", 0);
    }
}

POC

http://localhost:9900/api-uaa/oauth/remove/token?redirect_url=http://google.com/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions