Security comparison - GNOME and KDE Plasma

Hi all,

I want to hear your opinion on security of GNOME and KDE Plasma.

I see the current recommendation on https://www.privacyguides.org/en/os/linux-overview/#permission-controls and https://privsec.dev/posts/linux/choosing-your-desktop-linux-distribution/ highlights GNOME as the more secure option for a DE. Secureblue and Tails use it and recommend it as default.

KDE is working on fixing/implementing permission control for the screenshot portal https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/issues/7 so that will fix the biggest security flaw at the moment.

I’m wondering what other security features and flaws do these DE’s have and how do they compare overall?

5 Likes

The biggest issue with KDE Plasma is that global themes can, and will, run arbitrary code, and this has led to data loss in the past. This presents an attack vector that, at the time this incident happened, most people weren’t aware existed and even made KDE developers add a warning.

Theming may be optional, but these are flagship features of KDE and part of why it’s used, and known. Since it’s a main part of the DE, and GNOME has a more Apple-like model of customization, and so doesn’t have this attack vector, is probably one of the reasons why it’s recommended over KDE.

I like KDE a lot, I use Plasma, and I’m aware of these flaws so exercise caution accordingly, but since we have to assume not all users are the same, GNOME is the safer option (in this regard, at least). This is just my 2 cents.

5 Likes

Theming is a security rabbit hole…indeed.

I hope that the newly announced Plasma Next and KDE Union projects will fix the theming in a secure way.

I suppose GNOME also has a big security problem with 3rd party extensions that act like a real time hack of the gnome-shell. I guess they are not audited because they’re not official?

2 Likes

According to this GrapheneOS forum regular,
KDE is committed to old school and memory-unsafety, GNOME seems better but it’ll take too long to get security features across, and once COSMIC gets around, it’ll be champion

Other than what has already been mentioned about the display isolation, GNOME implements sandboxing for their thumbnailer and indexer, but at least the indexer has been exploited in the past, and although they have been hardened more, I would just disable them both anyway in GNOME or KDE. Otherwise, they are a bit similar, with GNOME implementing insecure extensions, and KDE implementing insecure global themes. Not sure about the ā€œold schoolā€ stuff since KDE adapts newer technology (see Wayland and ARM maturity for example) faster than any other DE. Also don’t know about memory safety in GNOME vs KDE. But the aspect of Qt vs GTK is interesting: Qt is maintained by a huge corporation while GTK is maintained by a few open source volunteers, so Qt might seem more secure from this aspect, but issue is that Qt5 LTS updates are proprietary paid, so the apps that still use it are technically using an end of life version, although KDE has maintained open source updates for it, but no way to make sure they fix all the vulnerabilities and bugs.
The default keyring in GNOME appears to have some security issues.

But also true for KDE

Probably better to use KeePassXC? Being written in Qt is kinda an advantage of KDE imo because I don’t want to unleash a dependency hell.
There’s the fact that KDE uses a Chromium webview, which might be more secure than the webkit based webview of GNOME, but not sure as it only has one release that only fixes bugs and vulnerabilities every 1-3 months in distros that keep up (e.g. Fedora, not in Debian though), and it only upgrades to the latest release every 6 months, so it might very well end up being less secure, idk.
If you use Fedora, KDE has the advantages of somewhat usable compatibility with selinux confined users and not getting frozen (although GNOME releases coincide with Fedora releases for the most part).

Ignoring all these technical details though, GNOME is a corp distro, so it might be more scrutinized? Plus having a lot less features, which could possibly translate to less attack surface? Not sure.

9 Likes

To be fair to KDE, I think it’s mostly developed by volunteers and switching the foundational toolkits and languages they’ve been based on for so long sounds very impractical. Carbon might be the best bet for projects who can’t switch away from C++. I’m not sure how GNOME is much better in that regard as I believe they mostly use C.

3 Likes

If you use GNOME:

  • disable thumbnails, it parses all files and has been exploited before
  • disable search, every keystroke gets sent to dozens of programs
  • disable tracker, it indexes all files and has been exploited before
  • disable all extensions, they can do absolutely anything
    • especially user extensions as those are automatically updated every started and could be hijacked
  • use wayland, to ensure some isolation
  • use the latest version

my brace sets most of these

2 Likes

It is logical that more eyes are watching the code because of it’s corporate usage, but I actually think GNOME has plentiful of features… they are just obfuscated and hidden by design. I suppose the code size of both DE’s is pretty similar.

1 Like

True. Both C and C++ are not memory safe languages so I suppose there’s not a lot of difference there.

KDE now uses QML for a lot of things while GNOME uses JS and TypeScript. Any difference meaningful difference there? I personally find it silly to write anything with JS but I suppose they have a reason for it :smiley:

1 Like

This looks useful! Thank you.
I see secureblue uses some of these steps as well.

Any tips for KDE Plasma?

Off topic, but I feel like those tips are so useful, you may want to put them in the Divested website

just use brace as a whole: it does that and way more: GitHub - divestedcg/Brace: Toolkit compatible with multiple Linux distros that allows for installation of handpicked applications, along with corresponding configs that have been tuned for reasonable privacy and security.

  • combine it with firejail, fapolicyd, real-ucode, and my hardened_malloc package (which now supports buffer overflow checks)
    • running brace-audit gives you the steps to do this all
1 Like

What exactly does this mean? Doesn’t the search feature work only to search for AppStream metadata?

That thing about the actual size of codebases sounds reasonable. I remember reading that Mutter and Kwin had a similarly sized codebase (although I can’t remember where I read this).
The corp aspect is hopefully changing with SteamOS, and Fedora KDE now has the same status as the GNOME edition. Although I don’t see this happening for RHEL any time soon.

Which DE do you personally recommend for security (and privacy if relevant) if you don’t mind?

Your question might be off topic, but I think this video would imply the answer would be Fedora.

Is this about the Gnome Sushi? Warning: Gnome file manager (Nautilus) can make remote requests when previewing files

I’m not sure how SecureBlue handles this but happy to see that Brace takes care of it.

1 Like

the one click file previewer? that should also be disabled.

Fedora with GNOME

The search feature in the GNOME overview directly runs dozens of programs such as calculator, weather, calendar, contacts, and many others each time you type a letter.

6 Likes

How much better is GNOME than KDE in comparison?

I guess a lot of GNOME advantages go away if a user ā€œhas toā€ use a 3rd party extension. I’ve used default GNOME before but not many people can. I really wish COSMIC launches off as soon as possible.

How is it off-topic? We’re discussing DE security, and I’d love to hear input from an expert
Maybe you misread me as asking about distros? No worries then