vpnbug.tar.gz (3.2 KB)
I've found a reproducible issue on my Flint 3 (4.9.0 release) that in the worst case takes down all VPN connections on the router.
Starting point: a NordVPN group in the VPN client profile with three servers, plus Tunnel 1 on the VPN dashboard using kr102.nordvpn.com as its profile, source is a custom interface (krlan), target "all destinations". The tunnel connects and works fine.
Reproduction: disconnect the tunnel, go to the VPN client profile and add one more server to the existing group via the server selection (ca1214 in my case). Back on the dashboard, Tunnel 1 shows "Please select a configuration" — the entire tunnel configuration is gone.
I exported the UCI configs before and after and compared them. Here's what happens:
In /etc/config/wireguard, adding a server doesn't just create the new peer — all peers of the group are deleted and recreated with new IDs (peer_2006–2010 before, peer_2011–2016 after). In the process, existing peers lose all of their credentials. Before:
config peers 'peer_2007'
option name 'kr102.nordvpn.com'
option host_id '1003516'
option private_key '[REDACTED]'
option address_v4 '10.5.0.2/16'
option public_key '[REDACTED]'
option end_point 'seoul.kr.wg.nordhold.net:51820'
...
After, the very same server (identical host_id) is reduced to an empty stub without private_key, address or endpoint:
config peers 'peer_2012'
option name 'kr102.nordvpn.com'
option host_id '1003516'
option location 'South Korea,Seoul'
In /etc/config/network, the wgclient1 interface remains but still points to the no-longer-existing peer_2007 and gets set to disabled. On top of that, the related sections rt_wgclient1, wgclient1_blackhole and their IPv6 counterparts disappear from the config entirely.
In /etc/config/route_policy, the tunnel rule loses its via_type, group_id, peer_id and mark options and is set to enabled '0'. The referenced profile file /etc/vpn_profiles.d/profile4260 still exists but has been truncated to 0 bytes. And — this is what I consider the most critical part — in the global section, enabled and instance_on both flip from 1 to 0. So adding a server to a group switches off the entire policy routing engine, which would affect every other tunnel as well.
Since NordVPN WireGuard keys can only be re-fetched through the token API, the damage is not trivially repairable if token validation happens to act up at the same time (which it did in my session: "token not ok" on a token that has no expiry date — possibly a separate issue). I also suspect the same mechanism was responsible for an earlier case on my router where a tunnel was left with an empty PrivateKey after changes to the server group.
Expected behaviour would be: new peers get added to the group without recreating existing ones — or at the very least, credentials, interface binding and tunnel assignment survive the rewrite. I have complete before/after exports of wireguard, network and route_policy and I'm happy to provide them.
