# PAC served over plain HTTP

Source: https://findproxyforurl.net/rules/pac-over-plain-http/ · last updated 2026-10-13

Rule PAC-D001 (`pac-over-plain-http`), severity high, category: Delivery (HTTP headers), top 20 #6.

The PAC is executable routing policy fetched on every browser start. Over plain HTTP a network attacker (hostile Wi-Fi, compromised router, ISP middlebox) can rewrite it and route all web traffic through a proxy of their choice.

## Why it matters

The PAC URL is fetched unauthenticated and the body is executed as JavaScript that decides
where every connection goes. Without TLS the body can be modified in transit; the attacker
prepends `PROXY attacker:3128` to every return and becomes a full man-in-the-middle for
http and a traffic-observer and downgrade point for https. WPAD-discovered URLs are always
plain http and inherit the same exposure (PAC-D007, PAC-D008). Serve the PAC from an
https URL with a certificate the clients trust (enterprise CA or public CA) and distribute
that URL by policy (GPO, MDM) rather than by discovery.

Note on the lab finding: whether WPAD-discovered https PAC URLs are accepted differs per
client; explicit AutoConfigURL settings accept https in Chromium, Firefox and Windows.

The certificate has to be one that every client trusts without asking. A PAC download cannot
show a certificate warning, so an untrusted certificate (self-signed, expired, wrong name,
missing intermediate) makes the download fail: Chromium aborts it, and in the lab Windows
(WinHTTP) failed to download a PAC file from a server with an untrusted certificate (error
12167). The client then runs without a PAC file.


## How to fix

Publish the PAC at an https:// URL with a certificate every client trusts (complete chain, correct name) and configure clients with that URL explicitly.

## Bad

```js
# AutoConfigURL
http://pac.corp.example/proxy.pac
```

## Good

```js
# AutoConfigURL
https://pac.corp.example/proxy.pac
```

## Engine behaviour

- chromium: A certificate error on the PAC URL aborts the download; there is no warning to click through, and no PAC is used. (source: code, verified 2026-10-13)
- winhttp: An https PAC URL whose certificate the client did not trust failed to download (error 12167); no PAC was used. (source: lab, verified 2026-10-11)
