WPAD (Web Proxy Auto-Discovery)
What is WPAD (Web Proxy Auto-Discovery)?
WPAD (Web Proxy Auto-Discovery) is the mechanism browsers and Windows use to find a proxy auto-configuration (PAC) file automatically, by looking up its URL through DHCP or DNS instead of asking the user. AdminKit explains how WPAD works and why a spoofed WPAD answer can redirect a machine's web traffic through an attacker's proxy.
By AdminKit team, Netbase JSC · Updated
WPAD answers one question for a client that is about to make a web request: should it go through a proxy server, and if so which one? Corporate networks often route web traffic through a proxy, and WPAD saves administrators from configuring every browser by hand. Microsoft’s WinHTTP AutoProxy documentation calls it “the same protocol that web browsers implement to automatically discover the proxy configuration without requiring an end-user to specify a proxy server manually”, and notes that its specification never progressed beyond an Internet-Draft, which expired in May 2001.
How does WPAD work?
The same Microsoft page describes the steps:
- The client discovers the URL of a proxy auto-configuration (PAC) file using DHCP and/or DNS.
- It downloads the PAC file, which is a small JavaScript program, and may cache it.
- For every HTTP request it calls the PAC file’s
FindProxyForURLfunction with the URL and host, which returns either one or more proxies to use or a direct connection.
MDN’s reference on the PAC file format documents that function and the helpers a PAC script can call, and the MIME type a server should send it with:
function FindProxyForURL(url, host) { ... }
Content-Type: application/x-ns-proxy-autoconfig
The name being resolved is wpad itself: one workaround in Microsoft’s MS16-077 bulletin (below) is a hosts-file entry that points wpad at an unusable address, which stops automatic proxy discovery on that machine:
255.255.255.255 wpad
Why is WPAD a security risk?
A PAC file decides where a machine’s web traffic goes, so whoever can answer the WPAD lookup can steer that traffic through a proxy they control. On networks with no legitimate WPAD host, a lookup that fails in DNS can fall back to local name resolution, where any machine on the link can answer. Microsoft’s security bulletin MS16-077 fixed exactly this class of problem in 2016: for CVE-2016-3213 it states that “an attacker could respond to NetBIOS name requests for WPAD”, and it describes a second flaw that could let an attacker “access and control network traffic”. The bulletin’s workaround was to disable WINS/NetBT name resolution, the NetBIOS Name Service that also answers such lookups, alongside LLMNR.
Practical steps:
- Turn off automatic proxy detection on clients where no proxy is used.
- Where WPAD is used, publish the PAC location yourself so the name is always answered by your own server.
- Disable NetBIOS and LLMNR name resolution where nothing depends on them, and keep Windows patched.
WPAD is a local-network concern: AdminKit does not offer a WPAD or PAC test, and its port check only probes a fixed list of nine TCP ports on your own public IP.
AdminKit groups WPAD under its DNS cluster — browse the AdminKit glossary index for other related terms.
Frequently asked questions
What does WPAD actually find?
The URL of a proxy auto-configuration (PAC) file. Microsoft's WinHTTP documentation describes the flow: discover the PAC URL through DHCP and/or DNS, download the PAC file, then run its FindProxyForURL function for each request to decide which proxy, if any, to use.
Is WPAD an internet standard?
No. Microsoft's WinHTTP documentation notes that although Internet Explorer and WinHTTP both support WPAD, the specification never progressed beyond the Internet-Draft stage and expired in May 2001.
Why is WPAD a security risk?
Whoever answers the WPAD lookup chooses the proxy. In security bulletin MS16-077, Microsoft fixed WPAD flaws including one an attacker could exploit by responding to NetBIOS name requests for WPAD, and another that could let an attacker access and control network traffic.
How do I reduce WPAD risk?
If your network does not use automatic proxy discovery, turn off automatic proxy detection on clients. If it does, publish your own PAC location through DHCP or DNS so nothing else on the network can claim it, and keep systems patched.