PAC helper called with the wrong number of arguments
high
A built-in PAC helper is called with too few or too many arguments. In the browsers missing arguments are undefined, which makes the helper return false or an unexpected value for every host. Windows (WinHTTP) raises an error for many such calls, which ends the script.
Why it matters
A wrong argument count is not caught when the file is loaded. In the browsers the helpers are
plain JavaScript functions: dnsDomainIs(host) compares against undefined and
shExpMatch(host, "a", "b") ignores the third argument, so the branch is silently wrong.
isInNet(host, "10.0.0.0") depends on the engine: Chrome, Edge and Firefox return false,
while pactester (pacparser) and Windows (WinHTTP) throw an error that ends the whole
evaluation (lab, 2026-10-11). In the same lab run Windows also threw for an extra argument,
for example isPlainHostName("a", "b") and isInNet with four arguments, and for a missing
one, for example isPlainHostName(). Either way the rule does not do what it says.
How to fix
Check the helper signature (isInNet needs host, network, mask; dnsDomainIs and shExpMatch need host and pattern).
Examples
Bad
function FindProxyForURL(url, host) {
if (isInNet(host, "10.0.0.0")) {
return "DIRECT";
}
return "PROXY proxy.corp.example:8080";
}
Open bad example in checkerGood
function FindProxyForURL(url, host) {
if (isInNet(host, "10.0.0.0", "255.0.0.0")) {
return "DIRECT";
}
return "PROXY proxy.corp.example:8080";
}
Open good example in checkerEngine behaviour
| Engine | Behaviour | Source |
|---|---|---|
| winhttp | isPlainHostName, isInNet and weekdayRange raised an error that ends the script when an argument was missing, extra or null, for example isPlainHostName(), isPlainHostName("a", "b"), isInNet with two or four arguments and weekdayRange(null). dateRange() and timeRange() without arguments returned false. | lab, verified 2026-10-11 |
Related rules
- isInNet called with an invalid address, mask or argument count PAC-E010
- isInNet arguments in the wrong order PAC-C016