Core Security Principles
The main purpose of the app is to allow users to make all network and internet traffic to and from the device travel via an encrypted VPN tunnel. The app achieves this through:- Tight firewall integration on desktop platforms (WFP, PF, nftables)
- Always-on kill switch that prevents leaks during connection changes
- Atomic firewall rule transactions with no inconsistent time windows
- State machine-driven security that enforces policies in every state
The app employs different security mechanisms on desktop versus mobile platforms due to OS API limitations. Desktop systems use direct firewall manipulation, while mobile platforms use VPN Service APIs.
Platform-Specific Security
Desktop Security (Windows, macOS, Linux)
Desktop operating systems provide the strongest security guarantees through direct firewall integration:- Windows: Uses Windows Filtering Platform (WFP) with sublayer-based design
- macOS: Uses Packet Filter (PF) with atomic rule transactions
- Linux: Uses nftables with atomic rule transactions and early-boot protection
Mobile Security (Android, iOS)
Android
On Android, the VPN Service API routes all traffic through the app by setting the routes0/0 and ::0/0. The app blocks all traffic in connecting, disconnecting, and error states.
Known Android Limitations:
- Connectivity checks (DNS and HTTP(S)) are exempt by the system
- Network-provided time (NTP) bypasses VPN
- Traffic to/from hotspot clients may leak
- These exemptions occur even with “Block connections without VPN” enabled
iOS
On iOS, a designated packet tunnel process handles network packet flow. The iOS implementation delegates traffic handling to WireGuard-go, which works directly with the tun interface. All traffic flows through the tunnel via routing rules configured by the packet tunnel extension.Security Through State Management
The app uses a tunnel state machine to enforce security policies. Each state has specific security guarantees:- Disconnected: No firewall rules (unless lockdown mode is enabled)
- Connecting: Only allows traffic to the VPN server endpoint
- Connected: All traffic flows through the encrypted tunnel
- Disconnecting: Maintains previous state’s security policy during teardown
- Error: Blocks all traffic when tunnel cannot be established
Always-Allowed Traffic
Regardless of tunnel state, certain traffic is always permitted:- Loopback traffic: All traffic on loopback adapters is always allowed
- DHCPv4 and DHCPv6: Required for network configuration
- Subset of NDP: Neighbor Discovery Protocol for IPv6 operation
- Mullvad API: Allowed in all states for key updates and account management
DNS Security
DNS requests reveal detailed information about user activity, making DNS leak protection critical:- All DNS requests are sent inside the VPN tunnel
- DNS queries only go to the VPN relay server by default
- Custom DNS servers can be configured (queries still go through tunnel)
- DNS to non-tunnel addresses is blocked in the Connected state
- Private/loopback custom DNS addresses bypass the tunnel
API Security
All Mullvad API connections use:- TLS 1.3 with certificate pinning
- Bundled Let’s Encrypt root certificate
- Validation of certificates issued to
api.mullvad.net - API bypass in non-connected states (Windows restricts to Mullvad processes)
Kill Switch
Mullvad VPN has an always-on kill switch that cannot be disabled. This is not a red button engaged when problems arise—it’s a proactive security feature:- Firewall rules are applied atomically with no time windows of vulnerability
- Traffic is blocked if the tunnel fails, rather than “failing open”
- Prevents leaks during server changes or unexpected tunnel loss
Regular Security Audits
Mullvad performs third-party security audits of the entire app every two years, plus specialized audits for specific features:- 2018: Cure53 & Assured (7 issues found)
- 2020: Cure53 (7 issues found, rated as “very positive”)
- 2022: Atredis Partners (5 findings, no high/critical severity)
- 2024: X41 D-Sec (6 vulnerabilities, 3 high severity, all fixed)
- 2025: NCC Group MASA certification (Android app passed all controls)
Threat Model
The app is designed to protect against:- Network-based attacks: Preventing traffic leaks and deanonymization
- Traffic analysis: Encrypted tunnel prevents ISP/network monitoring
- DNS leaks: All DNS queries go through the tunnel
- Kill switch failures: Always-on protection during connection issues
- Locally running malicious programs with local access
- Malware with root/administrator privileges
- Physical access to the device
Next Steps
Leak Protection
Learn how Mullvad prevents traffic leaks in all scenarios
Firewall Integration
Technical details on WFP, PF, and nftables implementation
Kill Switch
Understand the always-on kill switch and lockdown mode
Tunnel States
Explore the state machine and security guarantees
Related Documentation
- Architecture Overview - System design and components
- Security Audits - External security assessments
- Known Issues - Platform-specific limitations