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

GUI uses xorg instead of wayland #794

Closed
Pheidologeton opened this issue Jan 8, 2023 · 7 comments
Closed

GUI uses xorg instead of wayland #794

Pheidologeton opened this issue Jan 8, 2023 · 7 comments

Comments

@Pheidologeton
Copy link

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:

  • OpenSnitch version. Latest git
  • OS: Arch linux
  • Version latest
  • Window Manager: KDE
  • Kernel version: 6.1.4-273-tkg-cfs-llvm

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:

  • Launch it from a terminal and reproduce the issue.
  • Post the errors logged to the terminal.

If the daemon doesn't start:

  • Post last 15 lines of the log file /var/log/opensnitchd.log
  • Or launch it from a terminal as root (# /usr/bin/opensnitchd -rules-path /etc/opensnitchd/rules) and post the errors logged to the terminal.

If the deb or rpm packages fail to install:

  • Install them from a terminal ($ sudo dpkg -i opensnitch* / $ sudo yum install opensnitch*), and post the errors logged to stdout.

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
Copy link
Collaborator

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
Copy link
Author

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

@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Jan 9, 2023

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
Copy link
Author

Pheidologeton commented Jan 9, 2023

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
Copy link
Collaborator

gustavo-iniguez-goya commented Jan 9, 2023

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
Copy link
Author

After commit 5264988 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
Copy link
Collaborator

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.

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

2 participants