4 ms·
It's especially bad because I can already name a vulnerability. The method used by this program (sending SIGSTOP to the pid in _NET_WM_PID) is inherently broken
by throwawaysysd 5y ago
It's especially bad because I can already name a vulnerability. The method used by this program (sending SIGSTOP to the pid in _NET_WM_PID) is inherently broken and can be abused by malicious processes into sending signals to the wrong process, because _NET_WM_PID is set by the client and can be anything. It's completely broken and won't work at all if your process is in a pid namespaced sandbox (e.g. docker container, bwrap, firejail, flatpaks, snaps) because the process inside the namespace doesn't know its global pid.
Suffice to say it's disappointing whenever I see tools built this way, using pids for signaling in a GUI is a really bad idea and should be avoided. A way to fix it on Linux would be to pass pidfds around everywhere, unfortunately that's Linux-only and adoption of it is very slow. Another Linux-only option would be to use the cgroup freezer if that ever gets implemented in cgroupsv2.
- tinus_hn 5y agoAny process that can connect to the X server has complete control over all other apps running on it and can record all user activity. It can also pop up an xterm and type ‘kill’ into it. Not that this isn’t poor design though, but it’s the best one can do.
- throwawaysysd 5y agoNo I mentioned two ways it could be done better, it has to use different OS facilities. Of course you are right about the futility of trying to secure anything connected to the X server, a solution based on X11 will probably always have vulnerabilities.