Whoever controls a device's proxy auto-configuration file controls where its web traffic goes. Web Proxy Auto-Discovery (WPAD) lets clients find a Proxy Auto-Configuration (PAC) script through DHCP or DNS, and the client then runs that script for every request. On a network where an attacker can answer those lookups, auto-discovery becomes a route to intercepting traffic and capturing credentials. This guide explains how PAC and WPAD work, the attack paths at a conceptual level, and how to disable or deliver proxy configuration safely on Windows, macOS and managed browsers. It is for network and endpoint administrators. Operating system and browser defaults change, so settings below cite vendor documentation checked in November 2026.
Key takeaways
- WPAD was never standardised: the IETF draft expired in 1999, yet DHCP option 252 and DNS lookups for a host named wpad are still implemented by major clients.
- Discovery trusts the local network: any party that can answer DHCP, DNS or fallback name resolution can supply a PAC file, and the PAC file decides the proxy.
- Turn it off where unused: set DisableWpad for WinHTTP, switch off automatic detection in system and browser settings, and keep wpad in the DNS global query block list.
- Where you need a PAC file, pin it: configure an explicit HTTPS URL on a trusted host through policy, rather than letting clients discover one.
- Watch the name: queries for wpad in DNS, LLMNR or NBT-NS, and PAC downloads from unexpected hosts, are reliable signals of misconfiguration or abuse.
How PAC files and WPAD work
A PAC file is a standalone JavaScript file that defines one function, FindProxyForURL(url, host). For each request the client calls it and receives a string such as DIRECT, PROXY host:port or SOCKS host:port, or a semicolon-separated list tried from left to right. The file is served with the MIME type application/x-ns-proxy-autoconfig and can call helper functions including dnsDomainIs, isInNet, dnsResolve, myIpAddress and shExpMatch.
WPAD is the discovery step that finds the PAC file. The expired Internet-Draft (draft-ietf-wrec-wpad-01) describes it, and Microsoft's WinHTTP documentation confirms that WinHTTP discovers the PAC URL using DHCP and DNS, downloads the file, optionally caches it, and runs it on each HTTP request. WinHTTP accepts only http: and https: PAC URLs.
| Configuration method | How the client gets the proxy | Trust basis | Risk level |
|---|---|---|---|
| Explicit proxy | Fixed host and port set by policy | Administrator policy | Low |
| Pinned PAC URL over HTTPS | Policy sets the PAC URL; file fetched over TLS from a named host | Policy plus server certificate | Low, if the host and file are controlled |
| Pinned PAC URL over HTTP | Policy sets the URL; file fetched in clear text | Policy only; file can be altered in transit | Medium |
| WPAD via DHCP option 252 | DHCP server supplies the PAC URL | Whoever answers DHCP | High on untrusted segments |
| WPAD via DNS | Client looks up a wpad host in its domain and parent domains | Whoever answers or registers the name | High |
DNS and DHCP discovery risks
DHCP option 252
The draft defines DHCP option code 252 as a string containing the URL of the configuration file, for example http://server.domain/proxyconfig.pac. A rogue DHCP server on the same segment can hand out its own URL. The draft notes that WPAD inherits the known weaknesses of DHCP and DNS and recommends unicast DHCPINFORM over broadcast because broadcast is easier to spoof.
DNS devolution
Without a DHCP answer, the client tries a host named wpad in its own domain and then each parent domain. For a host in development.example.com it would try wpad.development.example.com and then wpad.example.com. The default URL path is /wpad.dat on port 80. Three problems follow:
- Internal names that leak: laptops off the corporate network, or using an internal domain that is also a public suffix or registrable name, can send wpad lookups to public DNS, where someone else may own the answer.
- Dynamic registration: if a DNS zone accepts unauthenticated dynamic updates, a host can register the name wpad. See the Active Directory Integrated DNS Security guide.
- Fallback resolution: when DNS has no answer, Windows can fall back to LLMNR and NBT-NS, which any host on the segment can answer. See LLMNR and NBT-NS Poisoning.
The DNS global query block list
Windows Server DNS keeps a global query block list of names it will not resolve. Microsoft documents that the DNS Server service creates and enables the list by default on first start, with the entries ISATAP and WPAD, because these protocols are particularly vulnerable to hijacking. If a zone already contains those names on first start, the service removes them from the list. Get-DnsServerGlobalQueryBlockList shows the current state, and Set-DnsServerGlobalQueryBlockList -List replaces the whole list, so include every existing name when adding one. Other DNS products need an equivalent deny or sinkhole rule for wpad in every internal zone.
Attack paths: rogue WPAD and PAC tampering
These are described at the level a defender needs to prioritise controls. ATT&CK groups them under T1557 Adversary-in-the-Middle, with name resolution poisoning covered by T1557.001 Name Resolution Poisoning and SMB Relay. See MITRE ATT&CK T1557 Adversary-in-the-Middle.
| Attack class | Precondition | Effect | Primary control |
|---|---|---|---|
| Rogue PAC via name poisoning | Attacker on the local segment; LLMNR or NBT-NS enabled; no wpad record | Client routes traffic through attacker proxy; proxy authentication may expose NTLM credentials | Disable WPAD and LLMNR/NBT-NS; block wpad in DNS |
| Rogue DHCP option 252 | Attacker can answer DHCP | Client fetches attacker PAC URL | DHCP snooping on switches; disable WPAD |
| Public wpad name collision | Internal suffix resolvable in public DNS; roaming devices | Off-network clients fetch a PAC file from the internet | Disable auto-detect on roaming devices; own or avoid internal suffixes |
| PAC file tampering | Write access to the PAC host or file served over HTTP | All managed clients follow modified rules | HTTPS delivery, change control, integrity monitoring |
| Rogue dynamic DNS record | Insecure dynamic updates allowed | wpad resolves to an attacker host | Secure-only dynamic updates; block list |
PAC JavaScript risks
- Code runs on every request: a PAC file is code supplied by the network. Clients run it in a restricted engine with only the helper functions, but its output still steers all traffic.
- Information exposure: PAC files reveal internal domains, subnets and proxy hosts to anyone who can fetch them. Treat the file as internal data.
- URL leakage: historically the full URL was passed to the PAC script. MDN records that the path and query of
https://URLs are now stripped before being passed, and that in Chrome 75 and later this cannot be disabled. Do not write rules that depend on HTTPS paths. - DNS side effects:
dnsResolve,isInNetandisResolvabletrigger DNS queries for every evaluated host. Order rules so simple string matches come first. - Fail-open behaviour: a trailing
DIRECTlets traffic bypass a security proxy when the proxy is down. Decide deliberately whether that is acceptable.
Safe configuration on Windows, macOS and browsers
| Platform | Setting | Purpose |
|---|---|---|
| Windows (WinHTTP) | HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp, DWORD DisableWpad = 1 (Windows 10 1809, Server 2019 and later) | Stops WinHTTP auto-discovery. Microsoft notes it affects WinHTTP only, so also turn off automatic detection in Settings |
| Windows (user proxy) | Settings, Proxy, "Automatically detect settings" off, managed by policy | Stops WinINet and applications that follow system settings from discovering a PAC file |
| Windows (benchmark) | CIS Microsoft Windows 11 Enterprise benchmark item 18.11.1 "Disable HTTP proxy features: Disable WPAD" | Audit baseline for the same control |
| Windows (proxy auth) | DisableProxyAuthenticationSchemes (Windows 11, Server 2022) | Turns off proxy authentication schemes you do not use, such as NTLM, reducing credential exposure to a rogue proxy |
| Chrome and Chromium browsers | ProxySettings policy: ProxyMode set to direct, fixed_servers or pac_script with ProxyPacUrl; ProxyPacMandatory where fail-closed is wanted | Locks the mode so users and the network cannot switch to auto-detect |
| Firefox | Enterprise Proxy policy with the mode set explicitly and locked | Firefox can keep its own proxy settings separate from the system |
| macOS, iOS, iPadOS | Global HTTP Proxy payload (com.apple.proxy.http.global): Manual, or Auto with a PAC URL; decide on "Allow direct connection if PAC is unreachable" | Pins the proxy on devices enrolled through Automated Device Enrollment |
| Windows Server DNS | Global query block list containing wpad and isatap | Prevents the DNS server answering wpad lookups |
Decision guidance
- No proxy in use: disable auto-detection everywhere and keep wpad blocked in DNS. This is the right answer for most cloud-first and remote-first organisations.
- Explicit proxy or cloud security gateway: push a fixed proxy or a PAC URL by policy. Prefer an HTTPS PAC URL on a host you control, with the file under change control.
- Legacy dependency on WPAD: if some devices cannot be configured by policy, publish a deliberate wpad record that points to a controlled server, keep DHCP snooping on, and plan migration. Never leave the name unanswered.
- Small organisations: a policy that disables auto-detection on endpoints and browsers covers most of the risk. Large organisations also need DNS controls across every zone, DHCP snooping, and monitoring.
Rollout
- Inventory: find where WPAD is relied on. Search DHCP scopes for option 252, DNS zones for wpad records, and proxy logs for PAC downloads by user agent.
- Decide per segment: explicit proxy, pinned PAC or direct.
- Pilot ring: apply DisableWpad, the Settings policy and browser policies to IT devices first; check that web access, software updates and line-of-business apps still work through the intended path.
- Broaden: roll out by ring, then remove option 252 from DHCP scopes that no longer need it.
- Harden DNS and the network: confirm the block list on every DNS server, require secure dynamic updates, enable DHCP snooping, and disable LLMNR and NBT-NS.
- Roll back: if an application breaks, assign it an explicit proxy or pinned PAC URL rather than re-enabling auto-detection for the whole device.
Monitoring for WPAD abuse
- DNS queries for wpad: DNS server logs, or Sysmon Event ID 22 (DNSEvent) on endpoints, show which hosts still look up wpad. After rollout these should fall to near zero.
- LLMNR and NBT-NS traffic: UDP 5355 and UDP 137 queries for wpad, and especially responses from workstations, suggest poisoning. Network sensors detect this well.
- Unexpected PAC downloads: HTTP requests for
/wpad.dator.pacfiles to hosts other than the approved PAC server. - Rogue DHCP: DHCP offers from unauthorised servers, or offers carrying option 252 on segments where it is not configured.
- Proxy authentication to unknown hosts: NTLM authentication to hosts that are not approved proxies.
- PAC file integrity: alert on any change to the published PAC file outside change control.
Metrics
- Percentage of managed endpoints with WPAD disabled (WinHTTP, system and browser).
- Daily count of internal wpad DNS queries, trending to zero.
- Number of DNS servers with wpad in the block list or an equivalent deny rule (target: all).
- Segments with DHCP snooping enabled.
- Unapproved PAC file changes detected per quarter (target: zero).
Framework mapping
| Framework | Reference | Application |
|---|---|---|
| NIST SP 800-53 Rev 5 | CM-6 Configuration Settings; CM-7 Least Functionality | Disable auto-discovery where unused; enforce proxy settings by policy |
| NIST SP 800-53 Rev 5 | SC-7 Boundary Protection; SI-4 System Monitoring | Controlled proxy path; monitoring wpad lookups and rogue DHCP |
| NIST CSF 2.0 | PR.PS-01 configuration management; DE.CM-01 network monitoring | Baselines and detection |
| MITRE ATT&CK | T1557 Adversary-in-the-Middle; T1557.001 Name Resolution Poisoning and SMB Relay | Threat model for rogue WPAD |
| CIS Benchmark | Windows 11 Enterprise 18.11.1 Disable WPAD | Audit check |
Common failure patterns
- Registry fix only: setting DisableWpad but leaving "Automatically detect settings" on, so WinINet and browsers keep discovering.
- Clearing the block list: replacing the global query block list with a single name and silently dropping wpad.
- Unanswered wpad name: no record and no block, so the lookup falls through to LLMNR, NBT-NS or public DNS.
- PAC over HTTP from a shared web server: anyone with write access to that server, or on the path, can redirect all traffic.
- Roaming laptops forgotten: devices that leave the corporate network keep auto-detect enabled and send wpad lookups to hotel and home networks.
- Browser policy gaps: system settings locked but a second browser left on its own auto-detect setting.
Practitioner checklist
- Inventory option 252 in DHCP, wpad records in DNS and PAC downloads in proxy logs.
- Set DisableWpad = 1 for WinHTTP and turn off automatic detection in Windows proxy settings by policy.
- Lock proxy mode in every managed browser with enterprise policy.
- Deliver any required PAC file from a pinned HTTPS URL on a controlled host, under change control.
- Confirm wpad and isatap are in the global query block list, or an equivalent rule, on every internal DNS server.
- Disable LLMNR and NBT-NS, require secure dynamic DNS updates and enable DHCP snooping.
- Disable proxy authentication schemes you do not use.
- Alert on wpad lookups, rogue DHCP offers and PAC file changes, and track the metrics above.
Standards and references
- IETF: Web Proxy Auto-Discovery Protocol, draft-ietf-wrec-wpad-01 (expired Internet-Draft)
- Microsoft Learn: WinHTTP AutoProxy Support
- Microsoft Learn: Disable HTTP proxy authentication features (DisableWpad)
- Microsoft Learn: Set-DnsServerGlobalQueryBlockList
- MDN: Proxy Auto-Configuration (PAC) file
- Google: Chrome Enterprise ProxySettings policy
- Apple: Global HTTP Proxy payload settings
- MITRE ATT&CK: T1557.001 Name Resolution Poisoning and SMB Relay
Related NHI Mgmt Group resources: LLMNR and NBT-NS Poisoning · NTLM Relay Guide · Active Directory Integrated DNS Security · DNS Security Guide · How to make developer tools trust a TLS-inspecting corporate proxy safely