This got me thinking; how does Steam protect us from malware?
In the sense of isolating games like a mobile app is on a mobile OS or something? It doesn't, not as it's installed normally. If you can do something, the game you're running can. Steam doesn't isolate individual games, and Steam is not, as it's normally installed, isolated.
Wayland won't let a random window on the screen see keystrokes going to others, but because the games aren't normally running in isolation, they can fiddle with the environment such that they can do whatever. Wayland's "keystroke" isolation is only useful if the software also can't muck with your files; it's intended to be used in conjunction with other forms of isolation.
I understand that it's possible to use Steam packaged as a flatpak, which will isolate the Steam environment as a unit, including Steam and games.
investigates
https://flathub.org/apps/com.valvesoftware.Steam
Steam is potentially unsafe
- User device access
Can access hardware devices such as webcams or gaming controllers
- Music subfolder xdg-music
Can read all data in the directory
- Pictures subfolder xdg-pictures
Can read all data in the directory
- User runtime subfolder app/com.discordapp.Discord
Can read and write all data in the directory
Assuming that those are the only filesystem permissions it has
and I don't have experience with flatpak, so I wouldn't use me as an authority
then it should prevent anything in the container from doing things like grabbing SSH and GPG keys, stuff like that. A malicious game in the flatpak could still grab your Steam credentials or information from other games and muck with those.
- Legacy windowing system
Uses a legacy windowing system
Not an issue if you're using Wayland, since it'll be using xwayland, which itself is isolated.
- Network access
Has network access
You cannot deny network access to the flatpak, as Steam will need that to work.
Some Steam games can be run outside of Steam, don't need to talk to it, and for those, you can explore other isolation options. Can maybe cut off network access using firejail or something like that.
-
Microphone access and audio playback
Can listen using microphones and play audio without asking permission
-
Proprietary code
The source code is not public, so it cannot be independently audited and might be unsafe