The WPAD Name Collision Vulnerability

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 ‘WPAD attack’, maliciously intercepting and redirecting the victim’s web traffic by delivering a malformed proxy configuration.

□ How does it work

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’ requests to more internally protected destination servers and then relaying the responses back to the respective client devices.

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.

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.

Moreover, the malicious actor can eavesdrop on the device’s requests, gaining access to sensitive information such as login credentials, credit card numbers, and passwords.

So, how can one avoid falling victim to this type of attack?

□ Always prevent that your browser automatically connected to attacker’s proxy server:

1) If you are using old Windows and Internet Explorer:

Open the “Internet Options” dialog, click “Connections” tab then click “LAN Settings”, and uncheck “Automatically detect settings”.

2) If you are using Windows 10:

Open the Start menu and click on Settings, Select Network & Internet, Click on Proxy in the left-hand pane, toogle the Automatic proxy setup Off, then Save.

3) If you are using Windows 11:

Open the Start menu and click on Settings, Select Network & Internet, Click on Proxy in the left-hand pane, Toggle the Automatically detect settings option to Off.

□ Always be cautious about security warnings from your browser:

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.

More specifically, if you encounter a certificate error page that warns about privacy, like the one shown below, never click the “Advanced” button to forcefully visit the site.

□ If you want to know about technical details :

When a device configured to connect ‘Corp.AD’ network in default (e.g. A Windows PC joined in Active Directory), the device will looking for ‘wpad.dat’ file from a host with the domain name, using http protocol:

GET http://corp.ad/wpad.dat

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:

function FindProxyForURL(url, host) 
{
	if (shExpMatch(url,"*.corp.ad/*")) {
		return "PROXY proxy.corp.ad:8080";
	} 
	return "DIRECT";
}

If an attacker wants all victim’s web traffic redirected to his site and spy on the victim’s Internet traffic, will use this kind of wpad.dat :

function FindProxyForURL(url, host) 
{
	return "PROXY evil.corp.ad:8080";
}

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.

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.

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’s server that using the public domain name. This means a private network that use a ‘Not legitimately owned’ domain name is also possibly vulnerable to WPAD attacks.

□ The Public Corp.AD Server

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 ‘corp.ad’ as a private network domain name, this public corp.ad server does not response to any /wpad.dat request.

It is explicitly denied on httpd conf.d with following configuration:

$cat /etc/httpd/conf.d/nowpad.conf
<Location /wpad.dat>
 Deny from All
</Location>

Since “corp.ad” 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.

Please find more information about this vulnerability at :

https://www.cisa.gov/news-events/alerts/2016/05/23/wpad-name-collision-vulnerability

What is Domain Name Collision?

This issue is officially referred to as a ‘Name Collision’ problem by ICANN, the organization responsible for managing the Internet.

To understand what is the name collision problem, imagine planning a party named “The Grand Celebration” to invite friends to your home. However, a government event organizer has already planned a public event with the same name at the city park. When your friends receive your invitation title ‘Please come to the grand celebration’, they might assume it’s for the public event and expect to meet you at the city hall.
To prevent that you stay at your home party alone, you should explicitly let your friends know that the party will be held at your home, not the city hall.

This situation illustrates a name collision, where two or more organizations use the same name in the connected network, causing confusion and directing devices to the wrong destination.

IANA, the global administrator of Internet domains, authorizes who can use a domain name as a public unique identifier on the Internet. When a device connect to Internet-connected network, it will look up IANA’s public directory (Root Name Server) to decide which destination to go for a domain name, not a private network.

Anyone can use any domain name at private network without IANA’s approval. However, to prevent that device within the private network try to visit the IANA’s destination, the device should be explicitly configured to visit the private network only.

The site you are currently visiting is a site with public domain name, registered to IANA and Andorra NIC (the administrator of the ‘.AD’ domain).

If you’ve reached this page after encountering a 404 Not Found error on this site, it’s likely that your network is using the same ‘Corp.AD’ domain name as an private Microsoft Active Directory domain name.

To visit a page at your internal network, just ensure that the subdomain (e.g., myhome.corp.ad) is entered correctly and that your device is properly connected to your organization’s network.

‘Corp.AD’ is frequently used Active Directory root domain

Traditionally, since the early days of Active Directory, Microsoft has been advising IT administrators to create a new root domain name starting with ‘corp’ as an example when setting up a new Active Directory server.

For instance, if you enter an invalid DNS name during the configuration process for Microsoft Windows’s Active Directory Domain Services, a pop-up alert will suggest using ‘corp.whatever.com’ as a naming convention.

Considering that coming up with a unique and appropriate domain name can be challenging, using a more general term to indicate an Active Directory server might seem like a reasonable approach. However, ‘Active Directory server’ is quite lengthy for a domain name, and IT professionals often prefer using abbreviations like AD, DS, DC, DNS, OS, and so on. Therefore, whoever set up your network, possibly a long time ago, might have decided to use ‘corp.ad’ as your internal network root domain, combining ‘corp’ from the tradition and ‘ad’ from Active Directory.

Since Active Directory doesn’t require the use of an officially registered Internet domain name for a private network’s root domain, your network is likely using a private ‘corp.ad’ domain, possibly since the time your IT administrator chose to implement it for the reasons mentioned. It may be, or may not be.