[GH-ISSUE #3375] WG/AWG site allowlist becomes a full tunnel with IPv4-only or reordered AllowedIPs #3234

Open
opened 2026-11-07 17:57:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @makkoar on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3375

Describe the bug

I reproduced a configuration-generation bug in the desktop WG/AWG path on Windows: Only the sites listed here will be accessed through the VPN still produces a full IPv4 tunnel when the profile contains only 0.0.0.0/0. Reordering the IPv4 and IPv6 defaults has the same effect.

LocalSocketController::activate() compares the native list against the exact JSON array ["0.0.0.0/0", "::/0"]. IPv4-only, reordered and duplicated defaults enter the custom-route branch, which bypasses the site allowlist. This comparison remains in dev at 3f6ecacff15e0ada890f6cf5174602d2b6b899c5.

Reproduction without changing a live VPN

I compiled the actual controller source and captured its activation message through an isolated QLocalServer/QLocalSocket pair. The test does not contact the real VPN service or alter routes.

Input with dummy endpoint information and no credentials:

{
  "protocol": "awg",
  "awg_config_data": {
    "allowed_ips": ["0.0.0.0/0"],
    "hostName": "192.0.2.1"
  },
  "splitTunnelType": 1,
  "splitTunnelSites": ["198.51.100.0/24", "203.0.113.7"]
}

Also reproducible with protocol: "wireguard" and wireguard_config_data.

Actual activation message:

"allowedIPAddressRanges": [
  {"address": "0.0.0.0", "range": 0, "isIpv6": false}
]

Expected:

"allowedIPAddressRanges": [
  {"address": "198.51.100.0", "range": 24, "isIpv6": false},
  {"address": "203.0.113.7", "range": 32, "isIpv6": false}
]

Using ["::/0", "0.0.0.0/0"] also incorrectly selects the native/full-tunnel branch. IPv6 entries in that branch additionally receive isIpv6: false.

Environment and verification limits

  • Windows x64, Qt 6.10.1, MSVC 19.53.
  • Reproduced against the source used by my local 5.0.3.2 build, based on upstream 5.0.3.1. The relevant comparison remains unchanged in current dev.
  • This establishes the generated daemon configuration; I have not switched my live VPN to allowlist mode for an end-to-end traffic test.
  • A focused regression suite covers both protocols, all site route modes, native profile variants and application-exclusion passthrough: 26 failures before the fix, 0 afterwards, across 60 data cases plus setup/cleanup.

Honor the site allowlist whenever the profile permits the IPv4 default route, independently of IPv6 presence, order or duplicates. Preserve restricted native AllowedIPs; normalize serialized prefixes, retain the correct address family and deduplicate routes.

The fix and regression tests are now isolated in #3379 (01f19433), extracted from the former combined #3030. The standalone branch is based directly on dev at 3f6ecacf; rerunning the suite still gives 26 failures before and none after. Umbrella tracker: #3378. The other parts are #3380 / #3376 (hostnames and DNS) and #3030 / #3377 (Windows route application). There is overlap with #3011, which already addresses the IPv4-only allowlist branch; #3097 addresses the earlier eligibility check. #2907 and #3314 report related macOS symptoms, but this reproduction does not establish that all their observations share the same cause.

This concerns site split tunneling, not application allowlist support on Windows.

Originally created by @makkoar on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3375 ## Describe the bug I reproduced a configuration-generation bug in the desktop WG/AWG path on Windows: **Only the sites listed here will be accessed through the VPN** still produces a full IPv4 tunnel when the profile contains only `0.0.0.0/0`. Reordering the IPv4 and IPv6 defaults has the same effect. `LocalSocketController::activate()` compares the native list against the exact JSON array `["0.0.0.0/0", "::/0"]`. IPv4-only, reordered and duplicated defaults enter the custom-route branch, which bypasses the site allowlist. This comparison remains in `dev` at `3f6ecacff15e0ada890f6cf5174602d2b6b899c5`. ## Reproduction without changing a live VPN I compiled the actual controller source and captured its activation message through an isolated QLocalServer/QLocalSocket pair. The test does not contact the real VPN service or alter routes. Input with dummy endpoint information and no credentials: ```json { "protocol": "awg", "awg_config_data": { "allowed_ips": ["0.0.0.0/0"], "hostName": "192.0.2.1" }, "splitTunnelType": 1, "splitTunnelSites": ["198.51.100.0/24", "203.0.113.7"] } ``` Also reproducible with `protocol: "wireguard"` and `wireguard_config_data`. **Actual activation message:** ```json "allowedIPAddressRanges": [ {"address": "0.0.0.0", "range": 0, "isIpv6": false} ] ``` **Expected:** ```json "allowedIPAddressRanges": [ {"address": "198.51.100.0", "range": 24, "isIpv6": false}, {"address": "203.0.113.7", "range": 32, "isIpv6": false} ] ``` Using `["::/0", "0.0.0.0/0"]` also incorrectly selects the native/full-tunnel branch. IPv6 entries in that branch additionally receive `isIpv6: false`. ## Environment and verification limits - Windows x64, Qt 6.10.1, MSVC 19.53. - Reproduced against the source used by my local 5.0.3.2 build, based on upstream 5.0.3.1. The relevant comparison remains unchanged in current dev. - This establishes the generated daemon configuration; I have **not** switched my live VPN to allowlist mode for an end-to-end traffic test. - A focused regression suite covers both protocols, all site route modes, native profile variants and application-exclusion passthrough: **26 failures before the fix, 0 afterwards**, across 60 data cases plus setup/cleanup. ## Proposed fix and related work Honor the site allowlist whenever the profile permits the IPv4 default route, independently of IPv6 presence, order or duplicates. Preserve restricted native AllowedIPs; normalize serialized prefixes, retain the correct address family and deduplicate routes. The fix and regression tests are now isolated in #3379 ([01f19433](https://github.com/makkoar/amnezia-client/commit/01f1943324171e8be1eaca7f7f150c0897681b74)), extracted from the former combined #3030. The standalone branch is based directly on dev at `3f6ecacf`; rerunning the suite still gives 26 failures before and none after. Umbrella tracker: #3378. The other parts are #3380 / #3376 (hostnames and DNS) and #3030 / #3377 (Windows route application). There is overlap with #3011, which already addresses the IPv4-only allowlist branch; #3097 addresses the earlier eligibility check. #2907 and #3314 report related macOS symptoms, but this reproduction does not establish that all their observations share the same cause. This concerns **site** split tunneling, not application allowlist support on Windows.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3234
No description provided.