KDE Linux Desktops are vulnerable to hack just by downloading Malicious files

Researcher discloses an unpatched KDE vulnerability that can run malicious code on a user’s system

A security researcher has published a proof-of-concept (POC) code on Twitter for a zero-day vulnerability in the KDE software framework that is yet to be fixed.

The security expert, Dominik Penner aka โ€œ@zer0pwnโ€ who discovered the problem said that the vulnerability affects KDE Frameworks version 5.60.0 and below.

For those unaware, KDE Frameworks is a collection of libraries and software frameworks that are at the base of the KDE desktop environment v4 and v5 (Plasma).

According to Penner, there is aย command injection vulnerability in KDE 4/5 Plasma desktop due to the way the KDesktopFile class (part of KDE Frameworks) handles .desktop and .directory files.ย This allows the malicious code stored within the .desktop and .directory files to silently run arbitrary code on a user’s computer without the user having to interact or open files.

โ€œKDE 4/5 is vulnerable to a command injection vulnerability in the KDesktopFile class. When a .desktopor .directory file is instantiated, it unsafely evaluates environment variables and shell expansions using KConfigPrivate::expandString() via the KConfigGroup::readEntry() function,โ€ reads aย post published by Penner.

โ€œUsing a specially craftedย .desktopย file aย remote user could be compromised by simply downloading and viewing the file in their file manager, or by drag and dropping a link of it into their documents or desktop.”

Penner explained that when a user opens the KDE file viewer to access the directory where these files are stored, it results in the execution of the malicious code in the .desktopย andย .directoryย files.

โ€œWhen we combine this /feature/ with the way KDE handlesย .desktopย andย .directoryย files, we can force the file to evaluate some of the entries within the [Desktop Entry] tag,โ€ Penner added.ย โ€œSome of the entries in this tag include โ€œIconโ€, โ€œNameโ€, etc. The exploit is dependent on the entry that gets read by the KConfigGroup::readEntry() function.โ€

The researcher says the vulnerability can be used by attackers to drop shell commands inside the standard “Icon” entries found in .desktop and .directory files.

โ€œSo for example, if we were to browse to the malicious file in our file manager (dolphin), the Icon entry would get called in order to display the icon,โ€ he said.

โ€œSince we know this, we can use shell command in place of the Icon entry, which in turn will execute our command whenever the file is viewed. Theoretically, if we can control config entries and trigger their reading, we can achieve command injection / RCE.โ€

Penner also published the exploit code for the vulnerability along with two videos (see below) demonstrating the attack scenarios that exploit the KDE KDesktopFile Command Injection vulnerability:

It appears that the researcher did not notify KDE developers about the vulnerability before publishing details about the bug to the public. Meanwhile, the KDE team have acknowledged the vulnerability and are currently working on a fix.

“For the moment avoid downloading .desktop or .directory files and extracting archives from untrusted sources,”ย KDE Community said to users. “Also, if you discover a similar vulnerability, it is best to send an email [email protected] before making it public. This will give us time to patch it and keep users safe before the bad guys try to exploit it,” the KDE developers recommended.

Kavita Iyer
Kavita Iyerhttps://www.techworm.net
An individual, optimist, homemaker, foodie, a die hard cricket fan and most importantly one who believes in Being Human!!!

Read More

Suggested Post