100 Commits
Author SHA1 Message Date
David Lönnhager 493198790b Merge branch 'desktop-e2e-ui-fixes' 2026-10-09 17:58:56 +02:00
David Lönnhager 45f50427a8 Move out new helper functions from tunnel-state.spec.ts 2026-10-09 16:47:53 +02:00
David Lönnhager c225b0e222 Reset obfuscation to auto after Shadowsocks UI test
The Shadowsocks test used to finish by connecting with obfuscation
turned off, which left it off for the remaining tests. Restore the
default instead.
2026-10-09 16:40:55 +02:00
David Lönnhager 6646c93889 Retrieve out IP from CLI in UI test
This applies to the tunnel-state tests
2026-10-09 16:40:55 +02:00
David Lönnhager 9840199144 Remove unexpected disconnect in tunnel-state.spec.ts 2026-10-09 16:40:55 +02:00
David Lönnhager 6e8248a8ee Reconnect explicitly when changing settings in tunnel-state.spec
`expectConnected` could resolve for the old tunnel
2026-10-09 16:40:55 +02:00
David Lönnhager 60d9f366bd Get hostname details from CLI in tunnel-state.spec tests 2026-10-09 16:40:55 +02:00
David Lönnhager 0aed90d38e Merge branch 'test-remove-mount' 2026-10-09 12:39:43 +02:00
David Lönnhager 4de1f88d83 Remove mounted disk support from the test framework
We no longer use the "noop" provisioning method, so delete it.
2026-10-09 12:35:45 +02:00
David Lönnhager d817fc7b61 Merge branch 'keep-min-version' 2026-10-09 12:21:40 +02:00
David Lönnhager a71e7659d0 Keep metadata_version from stale version cache
This fixes the advisory GHSA-fh82-c53h-gfvf, where technically a
compromised API could be used to serve old metadata after a reinstall.

However, the app never accepted downgrades, and new installs are mostly
installing the latest version, so this is mostly theoretical.
2026-10-09 12:19:26 +02:00
David Lönnhager 2320dc6f88 Merge branch 'desktop-e2e-fixes' 2026-10-08 10:35:05 +02:00
David Lönnhager 836e9cc79f Wait for the new tunnel in the in-tunnel IPv6 test
Toggling in-tunnel IPv6 while connected restarts the tunnel, so
the second connect_and_wait in test_wireguard_ipv6_in_ipvx sometimes
observed the old tunnel's Connected state and ran the connection
checks while the new tunnel was still coming up.

This could cause `assert_secure` to fail.
2026-10-08 10:24:30 +02:00
David Lönnhager 22ab808c9d Keep the multihop entry constraint in constrain_to_relay
constrain_to_relay rebuilt the relay settings from a singlehop query,
which reset the multihop entry location to Any.

This caused multihop to use any relay as entry if multihop was enabled
afterwards. It should be set to some one of the relays in
the test locations.
2026-10-08 10:24:30 +02:00
David Lönnhager f10e25f689 Merge branch 'remove-unused-qemu-dev' 2026-10-08 10:17:11 +02:00
David Lönnhager 2e67346396 Remove unused virtio-serial-pci device from QEMU VMs
virtio-serial was never used (we simply used -serial). The Windows 10
VM no longer boots with this after being updated, so let's remove it.
2026-10-08 10:12:51 +02:00
David Lönnhager 412e0a8a4f Merge branch 'macos-daemon-spawn-constraint' 2026-10-06 15:04:31 +02:00
David Lönnhager 0ea0e0ec2c Update changelog for macOS LPE 2026-10-06 15:04:07 +02:00
David Lönnhager 05ec268c54 Add spawn constraint to macOS launch daemon
On some machines, the app bundle can be replaced by any admin user,
so mullvad-daemon can be replaced with a malicious binary that the
launch daemon runs as root.

This adds a spawn constraint that refuses to run any binary that does
not match the expected cdhash of mullvad-daemon. The hash is disabled
for unsigned builds since they don't have this hash embedded.
2026-10-06 15:04:07 +02:00
David Lönnhager cd2bb1afaf Merge branch 'desktop-e2e-test-filters' 2026-10-05 17:58:42 +02:00
David Lönnhager 5a0df3e810 Exclude de-fra-wg-001 from staging tests 2026-10-05 16:59:15 +02:00
David Lönnhager c97b97e9d3 Merge branch 'simplify-test-relay' 2026-10-05 11:21:17 +02:00
David Lönnhager 2b9a37d55d Make test-manager relay not depend on TUN device
This removes a lot of the platform-specific device setup and teardown,
which is occasionally flaky.
2026-10-05 11:20:54 +02:00
David Lönnhager 9ffa3e88b4 Merge branch 'conncheck-tcp-connect' 2026-10-05 09:49:18 +02:00
David Lönnhager 40e1060a29 Send a TCP SYN to the gateway when establishing connectivity
The connectivity check relies on an ICMP ping to prod WireGuard into
handshaking and to get some traffic back through the tunnel. If ICMP is
blocked, e.g. by a third-party firewall, no reply is received and the
check times out.

Blocking ICMP was never intentionally supported but it happened to work
because the ephemeral peer exchange used the same tunnel. This hack
makes it work again by connecting a TCP socket when checking the
connection.

The TCP connection itself does not need to succeed. It is enough for
the handshake to succeed. So we don't wait for it.
2026-10-05 09:48:23 +02:00
David Lönnhager 8fcbcd553e Merge branch 'desktop-e2e-environments-file' 2026-10-02 16:23:29 +02:00
David Lönnhager e646003ac5 Let only staging/prod be used as environments in desktop e2e framework 2026-10-02 15:42:49 +02:00
David Lönnhager 298deb5a14 Read e2e test environments from checked in configs
The settings of the `prod` and `staging` environments used by the
desktop end-to-end workflow, `mullvad_host` and `test_locations`, were
previously only stored in the test-manager config on each runner.

They are now defined in `test/environments.json`, which is embedded in
test-manager at compile-time.

An environment in the config file overrides built-in ones.
2026-10-02 15:42:49 +02:00
David Lönnhager 485e8e8eab Merge branch 'test-add-windows-ssh' 2026-10-02 11:47:58 +02:00
David Lönnhager 3ba1123e4b Do not set executable bit for Windows VM 2026-10-02 11:38:50 +02:00
David Lönnhager 9f9489468c Correct test-runner filename for Windows in test utils 2026-10-02 11:38:50 +02:00
David Lönnhager e647448250 Support SSH provisioning of Windows test runners
Previously, the test-runner had to be mounted at `E:`, but this seems
to cause issues with files appearing corrupted at times. It also
requires building a scheduled task into the OS image.

With this change, the only prerequisite is that the OS image contains
sshd.
2026-10-02 11:38:50 +02:00
David Lönnhager e9e0abae5a Merge branch 'desktop-e2e-account-secrets' 2026-10-02 11:29:50 +02:00
David Lönnhager 2923d3fd4f Read desktop e2e account tokens from GitHub secrets
The account used by the end-to-end tests now comes from the
`DESKTOP_<ENV>_TEST_ACCOUNT_<OS>` secrets, where <ENV> is `PROD` or
`STAGING` and <OS> is `WINLINUX` or `MACOS`. Previously, it was always
read from the test-manager config on the runner.
2026-10-02 11:13:24 +02:00
David Lönnhager 1d3d03df08 Merge branch 'fix-test-macro-feat' 2026-10-01 10:43:40 +02:00
David Lönnhager af8562c06e Exclude test_macro from test framework lint check on Windows 2026-10-01 10:42:16 +02:00
David Lönnhager 504c2c077b Merge branch 'add-test-flavor' 2026-09-30 21:53:36 +02:00
David Lönnhager ec46a730ac Use production config for e2e tests in releases 2026-09-30 21:52:00 +02:00
David Lönnhager e462e69bd8 Select test environment in desktop e2e workflow
The environment defaults to staging (used for nightly runs)
2026-09-30 21:52:00 +02:00
David Lönnhager 991f45a1d2 Support multiple environments in test-manager config
This also makes it possible to specify the account token in the config
2026-09-30 21:52:00 +02:00
David Lönnhager 6cec7bafda Merge branch 'win-wait-for-busy-pipe' 2026-09-30 17:27:14 +02:00
David Lönnhager ba31ff3228 Add pipe fix to changelog 2026-09-30 17:26:41 +02:00
David Lönnhager 7eb2316747 Wait for named pipe to become available
Opening a named pipe can fail if the pipe is temporarily unavailable.
This commits handles this by waiting for it to become available in that
case.
2026-09-30 17:26:36 +02:00
David Lönnhager 7f7fe0a182 Merge branch 'investigate-leak-checker-fails-due-to-encoding-issue-and-des-2776' 2026-09-23 10:27:13 +02:00
David Lönnhager e12b5b9a29 Merge branch 'fix-cgroup2-vuln' 2026-09-23 10:01:55 +02:00
David Lönnhager c78d774357 Ignore TALPID_CGROUP2_FS and TALPID_NET_CLS_MOUNT_DIR if setuid bit
Without this, mullvad-exclude could be used to open and write to
cgroup.procs anywhere on the filesystem, as its setuid bit is set.

In reality, this only affected cgroup2, which is feature-gated and
is disabled right now.

This fixes the advisory GHSA-6m4p-ggr4-5f76.
2026-09-23 10:00:34 +02:00
David Lönnhager c823dd0b84 Merge branch 'add-missing-verbs' 2026-09-22 16:11:04 +02:00
David Lönnhager 5c51aaf92a Add some missing verbs to commit message workflow 2026-09-22 16:05:37 +02:00
David Lönnhager 3a4b49a662 Merge branch 'use-pq-userspace-net' 2026-09-22 15:52:10 +02:00
David Lönnhager 2fbf25e8f5 Log obfuscation start on iOS 2026-09-22 15:51:11 +02:00
David Lönnhager 716f93d13c Log more details about ephemeral exchange 2026-09-22 15:51:10 +02:00
David Lönnhager adef9f9144 Add network stack change to changelog 2026-09-22 15:51:09 +02:00
David Lönnhager 26afc6189a Log rx and tx bytes when smoltcp stream is dropped 2026-09-22 15:51:07 +02:00
David Lönnhager 31d83ffaad Add TCP timeout to netstack 2026-09-22 15:51:06 +02:00
David Lönnhager 527ccf4a49 Add back suspend, wake and recycle sockets on iOS 2026-09-22 15:51:04 +02:00
David Lönnhager c721f44eef Drop the LWO client key from the GotaTun FFI 2026-09-22 15:51:02 +02:00
David Lönnhager 4b69fe6b17 Obfuscate iOS tunnel traffic in place
This likely improves performance by halving the number of send/recv
syscalls. This is particularly relevant for LWO if or when iOS supports
batched send/recv.
2026-09-22 15:51:01 +02:00
David Lönnhager 6ab869a70a Reuse obfuscator for iOS tunnel 2026-09-22 15:50:59 +02:00
David Lönnhager dc09ba117e Allow negotiate_pq to be stopped on iOS 2026-09-22 15:50:58 +02:00
David Lönnhager 3a308baa8c Add separate timeout for ephemeral peer WG handshake 2026-09-22 15:50:56 +02:00
David Lönnhager 3a74a24617 Negotiate ephemeral peers without a local proxy socket on iOS
The iOS tunnel itself still goes through the local proxy.
2026-09-22 15:50:55 +02:00
David Lönnhager ce139350be Move GotaTun obfuscation transports to tunnel-obfuscation 2026-09-22 15:50:53 +02:00
David Lönnhager 9f5a3e54fd Use thiserror for Error type in talpid-tunnel-config-client 2026-09-22 15:50:51 +02:00
David Lönnhager d1c010a71f Add iOS license exception for talpid-netstack 2026-09-22 15:50:49 +02:00
David Lönnhager 558c414dea Update changelog for ephemeral peer change on Android 2026-09-22 15:50:47 +02:00
David Lönnhager 536291d4f3 Remove the socket-based config service client 2026-09-22 15:50:46 +02:00
David Lönnhager 9a0e0a7d9c Negotiate ephemeral peers before opening the tunnel
This unifies the ephemeral peer setup across platforms.
2026-09-22 15:50:45 +02:00
David Lönnhager efe4baa921 Share ephemeral peer negotiation with iOS
Move code shared with iOS to `talpid_tunnel_config_client::negotiation`
2026-09-22 15:50:43 +02:00
David Lönnhager 3973ad4a73 Request ephemeral peers over any stream (AsyncRead/AsyncWrite)
This lets us use `talpid-netstack` instead of a `TcpStream`.
2026-09-22 15:50:42 +02:00
David Lönnhager e8cccc81ec Move the iOS userspace network stack to talpid-netstack 2026-09-22 15:50:37 +02:00
David Lönnhager 66015c49af Merge branch 'check-pipe-ownership' 2026-09-22 09:46:35 +02:00
David Lönnhager 8b9d65a2f8 Remove duplicate changelog header 2026-09-22 09:45:35 +02:00
David Lönnhager f1a4f57dc8 Update changelog for named pipe check 2026-09-22 09:45:35 +02:00
David Lönnhager e47c82ea29 Fix missing check on pipeIsAdminOwned
The admin bool was simply discarded. Throw an error instead
2026-09-22 09:45:35 +02:00
David Lönnhager cf20277850 Merge branch 'drop-private-ips-using-tun-config' 2026-09-21 10:06:27 +02:00
David Lönnhager 47c1caec2e Remove the LAN filter and the LAN-in-tunnel firewall rules
We no longer need this now as private IPs are pruned from allowed IPs
instead.

Also move `ALLOWED_IN_TUNNEL_LAN_NETS` to `mullvad-daemon`, since it's
specific to Mullvad relays.

This fixes an issue where we blocked all private IPs in custom tunnels.
2026-09-21 10:04:57 +02:00
David Lönnhager 264e298190 Subtract disallowed private IP ranges from allowed IPs 2026-09-21 10:04:56 +02:00
David Lönnhager 44bf15459e Add a routes field to the WireGuard connection config
This allows the config to decouple allowed IPs from routing.
2026-09-21 10:04:54 +02:00
David Lönnhager 326bb16e3c Move IpNetworkSub to talpid-types 2026-09-21 10:04:34 +02:00
David Lönnhager 0a5bc2cd7c Merge branch 'multiplexer-obfuscated-transport' 2026-09-15 11:42:09 +02:00
David Lönnhager fab4185484 Remove ObfuscatedTransport::endpoint
The source address we report when implementing `UdpRecv` should not
actually matter. Let `talpid-wireguard` take care of it and just set it
to the wireguard endpoint instead.
2026-09-15 11:35:22 +02:00
David Lönnhager 85668c680e Remove local socket obfuscation
All types of obfuscation, including the multiplexer/FWT, now support the
`ObfuscatedTransport` trait. So get rid of socket-based obfuscation.

I haven't removed it fully from `tunnel-obfuscation`, as iOS still
depends on it.
2026-09-15 11:35:22 +02:00
David Lönnhager 122ea16cdf Make the multiplexer an obfuscated transport
It no longer pays the large cost of having a local UDP socket in front
of it. The `ObfuscatedTransport` does do some work on each `recv` to
handle different multiplexer phases. I didn't attempt to optimize this
because the cost was negligible compared to the socket syscalls.

The socket interface is still available by wrapping the multiplexer in a
`LocalSocketRunner`, as with other obfuscation types.
2026-09-15 11:35:22 +02:00
David Lönnhager e140ea4e00 Merge branch 'fix-lwo-transport-pubkey' 2026-09-14 16:02:03 +02:00
David Lönnhager b4ac2024fc Update changelog to mention LWO fix 2026-09-14 16:01:23 +02:00
David Lönnhager fb433c0d3b Update LWO transport pubkey when private key changes 2026-09-14 16:01:23 +02:00
David Lönnhager a43fee3a83 Merge branch 'reuse-tun-interface' 2026-09-10 17:20:53 +02:00
David Lönnhager f6b3ed3469 Release the tunnel IP addresses of an unused adapter
Since both the GotaTun and wireguard-nt adapter survive between
connections, we have to make sure they don't assign the same IP
addresses.

Either adapter is destroyed if its addresses cannot be removed, since
that releases them as well.
2026-09-10 17:19:47 +02:00
David Lönnhager 06557a8e89 Create a new tunnel adapter when retrying a connection
This is a precaution in case the tunnel breaks in some non-recoverable
way. Discarding it is relatively cheap.
2026-09-10 17:19:46 +02:00
David Lönnhager c1d33ce3b5 Give the wintun and wireguard-nt adapters unique names
Both adapters were named "Mullvad". That was fine while they only
existed for the duration of a connection, but both are now kept alive
between connections, and Windows renames an interface whose name is
already taken. The wintun adapter is therefore named "Mullvad GotaTun",
and wireguard-nt keeps "Mullvad".

This means switching between wireguard-nt and GotaTun no longer costs an
adapter creation.
2026-09-10 17:19:44 +02:00
David Lönnhager 0759efd3a0 Reuse the wireguard-nt adapter between connections
Like the previous commit but for wireguard-nt.
2026-09-10 17:19:42 +02:00
David Lönnhager 6a503a9fb2 Reuse the wintun adapter between connections
This creates a wintun adapter only on first use, and reuses it after
that. This saves about ~0.2 s on reconnects, but only if using GotaTun.
The tunnel device is destroyed when the daemon is killed or when reusing
it fails.

Five iterations on a Windows 11 host (`tun_timing` example):

    adapter        min      median   max
    destroyed      187.9ms  207.5ms  275.1ms
    kept alive      16.1ms   17.4ms   21.5ms
2026-09-10 17:19:38 +02:00
David Lönnhager fe2f6dffa8 Merge branch 'drop-lan-traffic' 2026-09-08 15:53:30 +02:00
David Lönnhager 740c58379a Update security.md to mention blocking in-tunnel private ranges 2026-09-08 15:51:15 +02:00
David Lönnhager 6aeb72c647 Enable opt-level=3 for talpid-wireguard & talpid-types
This makes is_ip_allowed_in_tunnel faster
2026-09-08 15:51:13 +02:00
David Lönnhager 8b6df89da0 Add LAN leak fix to changelog 2026-09-08 15:51:11 +02:00
David Lönnhager 0c04454d74 Drop LAN traffic on the tunnel interface on Windows 2026-09-08 15:51:09 +02:00
David Lönnhager 1f4510e5ab Drop LAN traffic on the tunnel interface on Linux 2026-09-08 15:51:06 +02:00
David Lönnhager 91965e46b0 Prevent LAN traffic from leaking into the GotaTun device
This prevents unintentional LAN traffic leaks on Android and macOS.
2026-09-08 15:51:05 +02:00
David Lönnhager 72736f68b9 Add private networks reachable inside the tunnel
These must be exempted from any private addresses that are blocked.
2026-09-08 15:50:47 +02:00