Originally posted by oiaohm
View Post
Notice you only looked at DAC. You have completely forgot MAC.
Doesn't matter, I'm talking about calling privileged functions over dbus (PolKit and friends).
The claim of no counter measure is not true. Correct selinux policy or other equal Linux LSM Mac policy and the attacks against Wayland compositors are dead in the water.
Also https://bugs.freedesktop.org/show_bug.cgi?id=84817 Wayland protocol design does not forbid Wayland compositor running as a different user to the applications. Just DAC on the Wayland socket has to be setup to allow it.
getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &client->ucred, &len)
therefore I guess such scheme would defeat any user isolation...
But to be honest I'm not quite sure now...
Root-ful Xserver is always more insecure because any flaw in Xserver that allows code to turn allows root privillage operations.
Second - it doesn't need to be the actual root (that was just my dumb example), just some dynamic user given the seat permissions after registering the session (e.g. pam_systemd).
Third - you need to exploit not only the app, but also the Xserver, just to get to the 'nobody' user.
gotar something to remember selinux and other solutions mac policies can apply rules that even run as root you cannot override.
Discretionary access control (DAC) is weaker by massive amount than Mandatory Access Control and Cgroups/namespaces. The idea of security by run as a different user is from a time when systems only had DAC when MAC and Cgroups/namespaces did not exist.
Namespacing doesn't exhaust security. It helps as a last resort safety net, but doesn't prevent basically anything in principle.
Sandboxing is not the job of the display server. Sandboxing is the job of the MAC or whatever running applications. MAC at kernel level already provide the tools not to trust any application user starts.
KDE is moving in the direction of cgroup/namespace sandboxing
Apparently KDE guys see the problem.
Do you really expect people to create SELinux policies for some untrusted code before they execute it? I'm not talking about running Firefox securely (with their own sandboxing, AppArmor profiles or provided SELinux labels).
I'm talking about running some random flatpak from the web.
What I would expect is the enforced by the standard scheme that makes every Wayland application to define it's own properties that could be used for sandboxing (something like: flatpak sandboxes, Ad-roid app permissions etc.)
Currently we have PolKit with it's lame rules (their potential looks like something designed in 1990s).
Yes lots of people fail to notice that a Linux kernel MAC can block LD_PRELOAD or running ld.so/ld-linux.so with different options to alter application behavior.
Comment