Join our Newsletter — 33% off our NHI Course
Home› Guides› PAC Files and WPAD Security Guide: Proxy Auto-Discovery…
Guide Network Security

PAC Files and WPAD Security Guide: Proxy Auto-Discovery Risks and Safe Configuration

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

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 methodHow the client gets the proxyTrust basisRisk level
Explicit proxyFixed host and port set by policyAdministrator policyLow
Pinned PAC URL over HTTPSPolicy sets the PAC URL; file fetched over TLS from a named hostPolicy plus server certificateLow, if the host and file are controlled
Pinned PAC URL over HTTPPolicy sets the URL; file fetched in clear textPolicy only; file can be altered in transitMedium
WPAD via DHCP option 252DHCP server supplies the PAC URLWhoever answers DHCPHigh on untrusted segments
WPAD via DNSClient looks up a wpad host in its domain and parent domainsWhoever answers or registers the nameHigh

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 classPreconditionEffectPrimary control
Rogue PAC via name poisoningAttacker on the local segment; LLMNR or NBT-NS enabled; no wpad recordClient routes traffic through attacker proxy; proxy authentication may expose NTLM credentialsDisable WPAD and LLMNR/NBT-NS; block wpad in DNS
Rogue DHCP option 252Attacker can answer DHCPClient fetches attacker PAC URLDHCP snooping on switches; disable WPAD
Public wpad name collisionInternal suffix resolvable in public DNS; roaming devicesOff-network clients fetch a PAC file from the internetDisable auto-detect on roaming devices; own or avoid internal suffixes
PAC file tamperingWrite access to the PAC host or file served over HTTPAll managed clients follow modified rulesHTTPS delivery, change control, integrity monitoring
Rogue dynamic DNS recordInsecure dynamic updates allowedwpad resolves to an attacker hostSecure-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, isInNet and isResolvable trigger DNS queries for every evaluated host. Order rules so simple string matches come first.
  • Fail-open behaviour: a trailing DIRECT lets traffic bypass a security proxy when the proxy is down. Decide deliberately whether that is acceptable.

Safe configuration on Windows, macOS and browsers

PlatformSettingPurpose
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 policyStops 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 browsersProxySettings policy: ProxyMode set to direct, fixed_servers or pac_script with ProxyPacUrl; ProxyPacMandatory where fail-closed is wantedLocks the mode so users and the network cannot switch to auto-detect
FirefoxEnterprise Proxy policy with the mode set explicitly and lockedFirefox can keep its own proxy settings separate from the system
macOS, iOS, iPadOSGlobal 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 DNSGlobal query block list containing wpad and isatapPrevents 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

  1. 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.
  2. Decide per segment: explicit proxy, pinned PAC or direct.
  3. 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.
  4. Broaden: roll out by ring, then remove option 252 from DHCP scopes that no longer need it.
  5. 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.
  6. 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.dat or .pac files 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

FrameworkReferenceApplication
NIST SP 800-53 Rev 5CM-6 Configuration Settings; CM-7 Least FunctionalityDisable auto-discovery where unused; enforce proxy settings by policy
NIST SP 800-53 Rev 5SC-7 Boundary Protection; SI-4 System MonitoringControlled proxy path; monitoring wpad lookups and rogue DHCP
NIST CSF 2.0PR.PS-01 configuration management; DE.CM-01 network monitoringBaselines and detection
MITRE ATT&CKT1557 Adversary-in-the-Middle; T1557.001 Name Resolution Poisoning and SMB RelayThreat model for rogue WPAD
CIS BenchmarkWindows 11 Enterprise 18.11.1 Disable WPADAudit 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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.