Skip to content
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

WSL2 Traffic not getting blocked #52

Open
subvert0r opened this issue Oct 30, 2024 · 6 comments
Open

WSL2 Traffic not getting blocked #52

subvert0r opened this issue Oct 30, 2024 · 6 comments

Comments

@subvert0r
Copy link

I'm not sure if I'm missing something or not, but it seems like this project is claiming to be able to block WSL2 VMs connections.

I have set the TinyWall to block all connections, but still the WSL2 ubuntu machine that I am testing it with doesn't get blocked?

And WSL2 is not in the exception list of the app (special exceptions).

Are you guys sure that TinyWall is able to filter WSL2 VMs connections?

Screenshot from 2024-10-30 19-42-51

@subvert0r
Copy link
Author

Same for Windows 10..

Screenshot from 2024-10-31 20-04-01

@pylorak
Copy link
Owner

pylorak commented Nov 4, 2024

It should be able to block it indeed. This will need further testing and possibly a fix.

@9ao9ai9ar
Copy link

9ao9ai9ar commented Nov 4, 2024

If you try with domain names instead of IPs, the connections do seem to be blocked. I also remember reading articles about the risks of enabling WSL 2 because it completely bypasses Windows Firewall, so I'm unsure how TinyWall can block it in the first place, but maybe I'm just misinformed.

@subvert0r
Copy link
Author

If you try with domain names instead of IPs, the connections do seem to be blocked. I also remember reading articles about the risks of enabling WSL 2 because it completely bypasses Windows Firewall, so I'm unsure how TinyWall can block it in the first place, but maybe I'm just misinformed.

But if TinyWall can't block WSL2, then what's the point of having these WSL2 stuff in it such as WSL 2 exception and what not, what's the point, why not remove these altogether?

@9ao9ai9ar
Copy link

But if TinyWall can't block WSL2, then what's the point of having these WSL2 stuff in it such as WSL 2 exception and what not, what's the point, why not remove these altogether?

@subvert0r Good point, it's giving users a false sense of security, but it is Microsoft who introduced this backdoor, which you can read in this official "discussion" (read: it's a feature not a bug, they even locked the original issue to tell you this). If you follow the instructions provided there for Windows 11, you might be able to block WSL traffic using Windows Firewall, which might be transferable to TinyWall, too.

@pylorak
Copy link
Owner

pylorak commented Nov 28, 2024

@9ao9ai9ar Very good find, thanks! I suspect this is the reason this feature is broken now. According to this article, there is a new HyperV option called firewall on Win11 that you can set to true to make the firewall rules apply to WSL. Setting networkingMode=mirrored may also help. I haven't tested these options yet.

@subvert0r The point of having this option in TinyWall is that it used to work, and I didn't know Microsoft broke it until you reported it (I am not using WSL2 myself so I didn't notice, I only tested it once when the feature in TinyWall was developed). The way it used to work is that all WSL2-traffic also ran through the Windows Filtering Platform (let's just say the "Windows Firewall"), and Microsoft routed all traffic from/to WSL2 containers through a virtual ethernet adapter called "vEthernet (WSL)". TinyWall blocked or allowed traffic from/to this adapter based whether the special exception for WSL2 was enabled or not in TinyWall. The issue and discussion found by 9ao9ai9ar leads me to believe that Microsoft updated WSL2 since then, in a way that it now completely bypasses the Windows Filtering Platform unless you use one or more of the above mentioned options in Windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants