I maintain a small Chrome extension, VPN Leak Guard, that checks a VPN connection for IP, WebRTC and DNS leaks from its popup. On 20 November 2026 the DNS row showed "DNS test unavailable" for every user of version 1.0.8. Nothing in the extension had changed. The public service behind the test had.
How the DNS leak test works
The test uses bash.ws, a free service that logs which resolvers ask it for names under a test id:
-
GET https://bash.ws/idreturns a fresh id, for example2236326d47073e59. - The browser requests
https://1.<id>.bash.ws/up to5.<id>.bash.ws/. Those HTTPS requests fail and that is fine: only the DNS lookups matter, and they reach bash.ws through whatever resolver your system really uses. -
GET https://bash.ws/dnsleak/test/<id>?jsonlists the resolvers it saw, with their ISP and country, plus a conclusion line.
If the resolvers belong to your home ISP while you are on a VPN, your DNS leaks.
What broke: one endpoint lost its CORS header, the other kept it
A popup page runs on a chrome-extension:// origin, so its fetch() calls are cross-origin and need CORS, unless the extension holds a host permission for the target. Version 1.0.8 had no host permission for bash.ws and relied on CORS.
Measured with curl on 20 November 2026, sending an extension origin:
curl -s -D - -o /dev/null -H 'Origin: chrome-extension://abc' https://bash.ws/id
# HTTP/1.1 200 OK (no Access-Control-Allow-Origin)
curl -s -D - -o /dev/null -H 'Origin: chrome-extension://abc' \
'https://bash.ws/dnsleak/test/abc?json'
# HTTP/1.1 200 OK
# Access-Control-Allow-Origin: *
A preflight OPTIONS on /id returns no CORS header either. So the results endpoint is still open to any origin, but the first step, getting an id, is blocked in the browser. The whole test fails at step 1 and the popup's catch turned it into "unavailable". My earlier tests only checked that the popup threw no JavaScript error, and it did not throw any: the failure was caught, so the row looked like a temporary outage.
Why I did not just add host_permissions
The obvious fix is "host_permissions": ["https://bash.ws/*"] in the manifest. With a host permission, an extension page can fetch that host without CORS.
The cost is on update. A new host permission comes with a new install warning ("Read and change your data on bash.ws"), and Chrome disables an extension on update when the new version asks for permissions with new warnings, until the user accepts them. For a privacy tool that a user installed for one reason, a disabled extension and a scary prompt is a good way to lose that user.
The fix: an optional host permission, asked on click
optional_host_permissions declares the host without granting it at install or update time:
"optional_host_permissions": [
"https://bash.ws/*"
]
The popup checks for it before running the DNS test:
const DNS_ORIGIN = { origins: ["https://bash.ws/*"] }
async function dnsAllowed() {
try { return await chrome.permissions.contains(DNS_ORIGIN) } catch (e) { return false }
}
Without it, the DNS row shows "TAP" and an explanation of what bash.ws is. The request has to happen inside the click handler, because chrome.permissions.request() only works from a user gesture:
dnsRow.onclick = async () => {
let ok = false
try { ok = await chrome.permissions.request(DNS_ORIGIN) } catch (e) { ok = false }
if (ok) runTest()
}
Once granted, the popup fetches /id with the host permission and the CORS header no longer matters. In my test under Chromium, the row went from "TAP" to "NO LEAK, 2 resolvers" with the resolver ISP and country listed. The IP and WebRTC rows never depended on bash.ws and kept working for everyone in the meantime.
Two things I check now
- The state of every row, not just the console. A caught error and a real "service down" look identical in the UI. I now load the packaged extension under xvfb and read the text of each result row, so "unavailable" on a row that should work counts as a failure.
-
CORS per endpoint, not per host. On bash.ws one path sends
Access-Control-Allow-Origin: *and the other sends nothing. Checking the host once with any URL would have said "CORS is fine".
If your extension or web page depends on a third-party endpoint with no contract, the curl lines above take a second to run in CI with your real origin.
The extension's source is on GitHub. If you just want to check your own connection in a normal tab, the IP and WebRTC leak test on VPNSmith runs the same IP and WebRTC checks in the page (I run that site too, and it carries affiliate links).
Top comments (0)