Methodology document
VPN leak testing
Seven scenarios, two capture points and one rule: a scenario passes only if no packet leaves the device outside the tunnel in any of 20 runs.
- Methodology v2.0 · effective 19 November 2026
- IDVPNL-M-02
- Last reviewed
- 8 min read
All documents · v2.0
On this page
In brief
VPN Labs leak testing checks whether any DNS, IPv4, IPv6 or WebRTC traffic leaves a device outside the VPN tunnel, both while connected and while the connection changes state. Traffic is captured upstream on a mirror port and on the device itself; a scenario passes only if zero packets are observed outside the tunnel in 20 of 20 runs.
- Runs per scenario
- 20Per settings profile
- Packets tolerated
- 0Outside the tunnel, any run
- Scenarios
- 7Steady state and six transitions
- Capture points
- 2Mirror port and on-device
What counts as a leak
A leak is any packet that originates from the device under test and leaves its physical network interface towards a non-local destination without being encapsulated in the VPN tunnel. The definition is based on observed packets, not on what a website reports.
- Tunnel traffic
- Encapsulated packets between the device and the VPN server endpoint recorded for the run — address, transport protocol and port.
- Permitted local traffic
- Traffic that never leaves the local link, declared before testing: ARP; ICMPv6 neighbour discovery, router discovery and Multicast Listener Discovery (types 130–137 and 143); IGMP; DHCP and DHCPv6; and link-local multicast or broadcast name and service discovery (mDNS, LLMNR, NetBIOS name service, SSDP).
- Leak
- Everything else: DNS queries, TCP and UDP flows, ICMP and other ICMPv6 types, QUIC and STUN.
- Resolver bypass (in-tunnel)
- DNS sent through the tunnel to a resolver other than the provider’s, for example browser DNS over HTTPS (RFC 8484). Not a leak, but reported as informational because a third party sees the queries.
The allowlist of permitted local traffic and the expected tunnel endpoint are written into the run sheet before the first run. They are never extended after a capture has been reviewed.
Capture method
Two independent capture points are used in every run, because each one can miss what the other sees. A third source — the lab’s authoritative DNS log — shows which resolver handled each query.
| Capture point | How | What it shows |
|---|---|---|
| Upstream mirror port | A managed switch copies every frame of the device’s access port to a dedicated capture host running tcpdump 4.99.4. The capture host has no IP address on the mirrored segment. | What actually left the device on the wire, independent of the device’s own software |
| On-device | Windows: pktmon and Wireshark 4.4.1. macOS and Linux: tcpdump 4.99.4 on the physical interface. Android: tcpdump on a rooted reference device. iOS: the rvictl remote virtual interface from a Mac. | Which interface and process produced traffic; timing relative to client events |
| Canary DNS log | A lab-controlled authoritative name server (BIND 9.18) logs the source of every query for unique per-run canary names. | Which recursive resolver handled the queries |
For Wi-Fi scenarios the access point’s wired port is mirrored as well. In cellular scenarios upstream capture is not possible: on-device capture is used alone and the result is labelled accordingly.
# capture host, mirrored port — one file per run
tcpdump -i eth1 -s 0 -w S2-run07.pcap
# count packets that are neither tunnel traffic nor permitted local traffic
tshark -r S2-run07.pcap -Y '!(ip.addr==203.0.113.10 && udp.port==51820) && !arp && !igmp && !(icmpv6.type in {130, 131, 132, 133, 134, 135, 136, 137, 143}) && !dhcp && !dhcpv6 && !mdns && !llmnr && !nbns && !ssdp' | wc -l
Each run uses unique canary names of the form r07.s2.<product-code>.canary.<lab-domain>, queried every 250 ms during transitions, so that even a short leak window is likely to contain at least one query.
Test scenarios
Every scenario is run in both settings profiles defined in the technical review and, where offered, with each tunnel protocol that changes kill-switch behaviour.
| ID | Scenario | Trigger | Observation window |
|---|---|---|---|
| S1 | Steady state | Connected; DNS, IPv4, IPv6, QUIC and WebRTC traffic generated | 120 s |
| S2 | Network change | Wi-Fi ↔ Ethernet; Wi-Fi ↔ cellular on mobile devices | 30 s before to 60 s after the change |
| S3 | Sleep and wake | Suspend for 5 minutes, then wake | 60 s after wake |
| S4 | Tunnel process killed | Force-terminate the tunnel process or service ( taskkill /F, kill -9, force-stop on Android) | 60 s after termination |
| S5 | Server unreachable | All packets to the VPN endpoint dropped at the lab firewall | 120 s after the block |
| S6 | Start-up | Boot or log in with auto-connect enabled | From link-up until 60 s after the tunnel is established |
| S7 | Reconnect and server switch | Change server location from the client interface | 30 s before to 60 s after the switch |
DNS leak checks
- System resolver: canary names are resolved through the operating-system resolver (
getaddrinfo,dig9.18.28 without a server argument,Resolve-DnsNameon Windows). - IPv6 resolver: the lab network advertises an IPv6 DNS server through router advertisements (RDNSS) and DHCPv6. A query sent to it outside the tunnel is a leak even when IPv4 DNS is protected.
- Browser DNS over HTTPS: current Firefox and Chrome releases, with their default secure-DNS settings and with DoH explicitly enabled. Encrypted DNS outside the tunnel is a leak; DoH inside the tunnel to a third-party resolver is a resolver bypass.
- DNS over TLS (RFC 7858): Android Private DNS in "Automatic" mode; port 853 traffic outside the tunnel is a leak.
IPv4 and IPv6 traffic outside the tunnel
Throughout every scenario a traffic generator opens TCP connections to lab echo endpoints over IPv4 and IPv6 every 500 ms and sends an ICMP echo request every second. If a VPN does not carry IPv6, it must block it: a single IPv6 packet to a global address on the physical interface fails the scenario.
WebRTC
A lab-hosted test page creates an RTCPeerConnection against the lab STUN server and lists the ICE candidates gathered (RFC 8445). It runs in the current stable releases of Chrome, Firefox and Safari; versions are recorded. The check fails if a server-reflexive candidate contains the lab uplink’s public IPv4 or IPv6 address, or if any STUN packet is captured outside the tunnel. Host candidates obfuscated as mDNS names (.local) are not leaks.
Kill-switch scenarios
Scenarios S2 to S7 test the kill switch: the mechanism that should block all traffic whenever the tunnel is not up. For every run we record the time from trigger to block from on-device timestamps and, for failures, the length of the leak window and the number of leaked packets per protocol.
A kill switch that only reacts once the client process notices a failure — rather than relying on firewall rules that persist independently of that process — typically fails S4, because the process that should react no longer exists.
Run procedure
One run, any scenario
- Reset the device to the scenario’s start state and confirm the client version and settings profile.
- Start the mirror-port and on-device captures; write a run marker (UTC timestamp, scenario ID, run number) to the run log.
- Start the traffic generators: canary DNS queries every 250 ms, IPv4 and IPv6 TCP probes every 500 ms, ICMP echo every second, and the WebRTC page in S1.
- Apply the trigger at a scripted time and record the trigger timestamp.
- Capture until the observation window ends; stop the captures and hash each file immediately, as set out in evidence handling.
- Classify packets automatically with the pre-declared filter. An assessor reviews every non-zero result and a random 10 % of zero results by hand.
- Record the outcome — leak or no leak, packet counts per protocol, leak window — in the run sheet.
Runs are executed in randomised order across scenarios, so that a slowly changing condition, such as a server under increasing load, does not cluster in one scenario.
Pass criterion and repetitions
Pass criterion
A scenario passes only if zero packets are observed outside the tunnel in N = 20 of 20 runs. One leaked packet in one run fails the scenario. Results are reported as "x of 20 runs leaked".
Why 20 runs? If no leak is observed in 20 independent runs, the one-sided 95 % upper confidence bound on the per-run leak probability is about 14 % (1 − 0.05^(1/20) ≈ 0.139). A pass therefore means the failure rate is probably low, not that it is zero: an intermittent leak that occurs in fewer than about one run in seven can be missed. Every record states this limit.
If fewer than 20 runs are possible — a device fault, or a time-limited commissioned test window — the result is labelled "reduced sample (n = x)" and cannot earn a full pass in the scoring model.
| Result | Condition | Reported as |
|---|---|---|
| Pass | 0 leaked packets in 20 of 20 runs | Finding with severity "Pass" |
| Fail | At least 1 leaked packet in at least 1 run | Finding, severity rated with CVSS v4.0 |
| Pass in hardened profile only | Fails with defaults, passes when hardened | Finding for the default profile; hardened result noted |
| Reduced sample | n < 20 and no leak observed | Not a full pass; half credit in scoring |
| Not applicable | Scenario impossible on the platform, e.g. no Ethernet on a phone | Excluded, with the reason |
Evidence produced
- One packet capture per capture point and run, hashed at capture time. Full captures are normally restricted because they contain lab addresses; redacted text extracts are published.
- The run sheet (CSV): scenario, run number, timestamps, settings profile, packet counts per protocol and outcome.
- Canary resolver log extracts for every run.
- Screenshots of client settings for each profile.
- The environment manifest: devices, builds and tool versions.
All items appear in the record’s evidence table with their SHA-256 hashes and can be checked with the file verification tool.
Frequently asked questions
Why not use a public DNS leak test website?
A leak-test website only sees the queries that reach it, at the moment the page is loaded. Our method records every packet on the wire for the whole transition, including leaks that last a fraction of a second during a reconnect, which a website cannot detect.
Is a browser using DNS over HTTPS a DNS leak?
Only if the encrypted DNS traffic leaves the device outside the tunnel. DoH sent through the tunnel to a third-party resolver is not a leak, but we report it as a resolver bypass because a party other than the VPN provider sees the queries.
Does passing 20 of 20 runs mean a VPN never leaks?
No. It means no leak was observed in 20 runs. The 95 % upper confidence bound on the per-run leak rate is then about 14 %, so rare, intermittent leaks can be missed. Records state this limit.
Records using this document
Published records that cite this document in their methodology.
Further reading
Key terms in the glossary
Document control & citation
Cite this document
VPN Network Research Labs (2026). VPN leak testing (VPNL-M-02), methodology v2.0, effective 19 November 2026. VPN Labs. https://vpn.com.de/methodology/leak-testing
Changes to this document are listed in the methodology changelog. Corrections to records follow the corrections policy.