evilsocket / opensnitch

OpenSnitch is a GNU/Linux interactive application firewall inspired by Little Snitch.
GNU General Public License v3.0
9.88k stars 490 forks source link

GUI uses xorg instead of wayland #794

Closed Pheidologeton closed 1 year ago

Pheidologeton commented 1 year ago

Please, check the FAQ and Known Problems pages before creating the bug report: https://github.com/evilsocket/opensnitch/wiki/FAQs https://github.com/evilsocket/opensnitch/wiki/Known-problems

Describe the bug A clear and concise description of what the bug is.

Include the following information:

To Reproduce Gui uses xorg instead of wayland, QT_QPA_PLATFORM=wayland variable is system wide.

Steps to reproduce the behavior:

  1. Set env variable QT_QPA_PLATFORM=wayland
  2. Start gui

Post error logs: If it's a crash of the GUI:

If the daemon doesn't start:

If the deb or rpm packages fail to install:

Expected behavior (optional) If QT_QPA_PLATFORM=wayland, gui must use wayland.

Screenshots If applicable, add screenshots to help explain your problem. It may help to understand the issue much better.

Additional context Add any other context about the problem here.

gustavo-iniguez-goya commented 1 year ago

Sorry, I don't understand what the issue is. What's the problem of using xorg (xcb plugin) instead of wayland? Any crashes or malfunction?

Pheidologeton commented 1 year ago

Using xorg allows the malicious program to intercept the input when creating a new rule

gustavo-iniguez-goya commented 1 year ago

Can you provide a practical example showing how to intercept the input only when QT_QPA_PLATFORM is not set to "wayland" in our GUI? while running Wayland. That way I'll be able to reproduce the problem.

Pheidologeton commented 1 year ago

When QT_QPA_PLATFORM=wayland, the gui still works through xwayland (xorg). Xwayland allows any wayland and xorg clients to listen to input, for example push to talk in the mumble client works if the xwayland window is in the foreground, but if the wayland client is in the foreground, for example the text editor kate, push to talk does not work. In this way the malware can allow itself to access the internet, xwayland does not prevent it from input, for example with the xclicker

gustavo-iniguez-goya commented 1 year ago

Thank you for the explanation @Pheidologeton ,

Please, provide a practical example that I can reproduce, with commands to execute, or a video, etc.

Right now, the GUI uses what the system configures QT_QPA_PLATFORM as default. We don't configure that environment variable (on the published releases), so if this is a problem I guess it'll affect all Qt apps.

Pheidologeton commented 1 year ago

After commit https://github.com/evilsocket/opensnitch/commit/5264988a3608f8359a71977b527c36848445dc5b when setting environment variable QT_QPA_PLATFORM=wayland, ui still works through xwayland. It says that this is because of a crash when creating an advanced rule via the + menu, but on arch linux with kde plasma this crash did not happen, and ui works fine through wayland. I suggest to revert this commit, because in case of such an error you can just run gui through xwayland manually (QT_QPA_PLATFORM=xcb opensnitch-ui). I use opensnitch-git from AUR

gustavo-iniguez-goya commented 1 year ago

aah ok, I see.

I think I've found a way of not crashing on Fedora 37, so we won't need to set QT_QPA_PLATFORM to xcb. I need to test it on more distros.