-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remediate TunnelVision, TunnelCrack and fix "Exclude Local Networks" #3460
Conversation
if !settings.enforceRoutesForceEnabledOnce { | ||
settings.enforceRoutesForceEnabledOnce = true | ||
settings.excludeLocalNetworks = true | ||
settings.enforceRoutes = true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first time the VPN is started with the feature flag ON, we'll enable enforce routes. But the setting can be overridden by internal users in case there's trouble.
.onTapGesture { | ||
viewModel.toggleExcludeLocalNetworks() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was not really working at all, and adding to the overall problems.
DuckDuckGo/IPC/VPNCommander.swift
Outdated
func restartAdapter() async throws { | ||
guard let activeSession = await AppDependencyProvider.shared.networkProtectionTunnelController.activeSession(), | ||
activeSession.status == .connected else { | ||
|
||
return | ||
} | ||
|
||
try? await activeSession.sendProviderRequest(.command(.restartAdapter)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about instead putting this in NetworkProtectionTunnelController
? (I wonder whether the tunnel controller should have a function like sendProviderRequest
that abstracts the fetching of the session etc., since we have similar logic in a few places.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I was avoiding it because this forces the change on macOS (as I need to modify the TunnelController
protocol) which requires some thinking.
That said, I think it makes sense so I pushed the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit harder to test the exploit on iOS but I've validated it's remediated and couldn't find any issues with it. Code looks clear too. ✅
…1039) Task/Issue URL: https://app.asana.com/0/1206580121312550/1208686409805161/f Tech Design URL: https://app.asana.com/0/481882893211075/1208643192597095/f iOS PR: duckduckgo/iOS#3460 macOS PR: duckduckgo/macos-browser#3422 What kind of version bump will this require?: Major ## Description Remediate TunnelVision, TunnelCrack and fix "Exclude Local Networks".
…3422) Task/Issue URL: https://app.asana.com/0/1206580121312550/1208686409805161/f Tech Design URL: https://app.asana.com/0/481882893211075/1208643192597095/f iOS PR: iOS PR: duckduckgo/iOS#3460 BSK PR: duckduckgo/BrowserServicesKit#1039 ## Description Remediate TunnelVision, TunnelCrack and fix "Exclude Local Networks".
# By Daniel Bernal (1) and others # Via Federico Cappelli (1) and GitHub (1) * main: Remediate TunnelVision, TunnelCrack and fix "Exclude Local Networks" (#3460) Sync: Send pixels for account removal + decoding issues (#3557) Release 7.145.0-0 (#3560) [DuckPlayer] Base Overlay Pixel Implementation (#3545) Refresh toast updates (#3552) point to BSK branch (#3559) Remove ATB from attribution pixel (#3550) # Conflicts: # DuckDuckGo.xcodeproj/project.pbxproj # DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
Task/Issue URL: https://app.asana.com/0/1206580121312550/1208686409805161/f
Tech Design URL: https://app.asana.com/0/481882893211075/1208643192597095/f
macOS PR: duckduckgo/macos-browser#3422
BSK PR: duckduckgo/BrowserServicesKit#1039
Description
Remediate TunnelVision, TunnelCrack and fix "Exclude Local Networks".
Testing
Test 1: External Users aren't affected
Prerequisites:
Steps:
enforceRoutes
is OFF, you'll be able to access your local network devices, but when it's ON you won't be able to access those devices.Test 2: Internal Users get new routing
Prerequisites:
enforceRoutes
remote feature flag is ON.Steps:
2. Star the VPN (the first time you start the VPN as an internal user, "Enforce routes" should be enabled).
3. Make sure you can access the internet.
4. Make sure you cannot access local devices.
Test 3: Internal Users can override enforce routes.
Prerequisites:
Steps:
Test 4: TunnelVision fixed when enforceRoutes is ON.
Prerequisites:
Steps:
Test 5: TunnelCrack blocks all VPN traffic.
Prerequisites:
Steps:
Please note: I'm suggesting we show a warning here, but this will be tackled as a follow-up task.
Internal references:
Software Engineering Expectations
Technical Design Template