PAC-K003 · ex-functions-not-portable

IPv6 extension functions (isInNetEx, dnsResolveEx, myIpAddressEx)

medium · Compatibility across engines

The Ex functions come from Microsoft's IPv6 extensions to the PAC format. Chromium and WinHTTP implement them; Firefox does not. On an engine without them the call throws and the request is treated as a script failure.

Why it matters

isInNetEx, dnsResolveEx, myIpAddressEx, isResolvableEx, sortIpAddressList and getClientVersion are not part of the original PAC function set. Microsoft defined them for IPv6 support; Chromium added implementations; Firefox has declined to. A PAC that calls them unconditionally fails on Firefox with a ReferenceError (silent DIRECT). If they are needed, guard the call with typeof isInNetEx === "function" and provide a fallback path.

How to fix

Prefer the portable v1 functions; if an Ex function is required, guard it with typeof checks and provide a fallback branch.

Examples

Bad

function FindProxyForURL(url, host) {
  if (isInNetEx(host, "fd00::/8")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open bad example in checker

Good

function FindProxyForURL(url, host) {
  if (typeof isInNetEx === "function" && isInNetEx(host, "fd00::/8")) {
    return "DIRECT";
  }
  if (shExpMatch(host, "fd*:*")) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open good example in checker

Engine behaviour

EngineBehaviourSource
chromiumThe Ex functions are implemented (isResolvableEx in the JS helper library, dnsResolveEx/myIpAddressEx/sortIpAddressList as native bindings in proxy_resolver_v8.cc).code, verified 2026-10-04 · ref
firefoxEx functions are not implemented; dnsResolveEx, isInNetEx, myIpAddressEx, sortIpAddressList, isResolvableEx and getClientVersion are undefined.lab, verified 2026-10-12
pacparserFour of the six are present (dnsResolveEx, isInNetEx, myIpAddressEx, isResolvableEx); sortIpAddressList and getClientVersion are undefined. Measured in 1.4.6 and 1.5.3.lab, verified 2026-10-04
winhttpAll six are present (isResolvableEx, isInNetEx, dnsResolveEx, myIpAddressEx, sortIpAddressList, getClientVersion). dnsResolveEx lists IPv4 and IPv6 addresses separated by ';' with IPv6 in brackets, and returns false for a name that does not resolve; isInNetEx needs a prefix such as /8, does not look up host names and is false for /0; getClientVersion returns "1.0".lab, verified 2026-10-11

Source: code = read in the engine's source, doc = vendor documentation, lab = observed in a lab run, expert = practitioner knowledge, not yet verified.

The PAC functions this rule is about

  • dnsResolveEx(): Microsoft IPv6 extension. Returns a semicolon-separated list of IPv4 and IPv6 addresses, or an empty string (false in Windows).
  • myIpAddressEx(): Microsoft IPv6 extension. Semicolon-separated list of the computer's addresses; which addresses and in which order depends on the engine.
  • isResolvableEx(): Microsoft IPv6 extension. True if the host resolves to any IPv4 or IPv6 address.
  • isInNetEx(): Microsoft IPv6 extension. True if ip is inside the CIDR prefix, e.g. isInNetEx(ip, "2001:db8::/32").
  • sortIpAddressList(): Microsoft IPv6 extension. Sorts a semicolon-separated IP address list.

Related rules

References

Last updated: