feat(killswitch): implement Windows firewall kill switch#9
Merged
wallydz-bot[bot] merged 3 commits intovpnht-rewritefrom Feb 21, 2026
Merged
Conversation
added 3 commits
February 21, 2026 20:33
…. Baseline verified. Swarm consolidated.
The previous implementation used format!() to build shell scripts, allowing potential command injection if cmd or args contained special characters like quotes, backticks, or semicolons. Fix by implementing proper shell escaping using single-quote escaping, which safely handles all special characters including embedded quotes. Before (vulnerable): do shell script "cmd args" with administrator privileges After (safe): do shell script 'cmd' 'arg1' 'arg2' with administrator privileges Also improved Command builder to use .arg() instead of .args() with mutable Vec references for cleaner code.
…advfirewall - Add setup_wfp() for Windows: blocks all outbound traffic via netsh - Add netsh advfirewall firewall add rule for block/allow rules - Use PowerShell New-NetFirewallRule for WireGuard interface filtering - Allow DHCP/DNS for essential connectivity - Implement teardown_wfp() for cleanup on disable - Add Drop impl to ensure cleanup on struct destruction - Add unit tests for interface name sanitization - Remove password requirement (assumes elevated process) netsh syntax: - Block: netsh advfirewall firewall add rule name="VPNht Kill Switch Block" dir=out action=block remoteip=any enable=yes profile=any - Delete: netsh advfirewall firewall delete rule name="VPNht Kill Switch Block" Fixes Windows kill switch implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
netsh Syntax