This commonly-used Ubuntu tool can be hijacked to spread malware

Ubuntu
(Image credit: Future)

Hackers can abuse Ubuntu’s “command-not-found” package suggestion system to deliver malware to users, researchers are saying. The attack surface is relatively large, and there are multiple ways threat actors can abuse the feature.

This is according to a new report from cybersecurity researchers Aqua Nautilus, which notes how when a Ubuntu user wants to run a specific program that’s currently not installed on the endpoint they can bring up the "command-not-found" utility and have it suggest packages to install.

The problem here is that there is no way of knowing if the suggested package is malicious or not. The tool suggests packages from an internal database, as well a frequently updated database from the Snap Store, for snap packages. So, in theory, a threat actor could force the system to suggest malicious packages to the user. 

Plenty of room for impersonation

There are three methods to abuse the tool, the researchers further said. The first one is to simply publish malicious snaps to the Snap Store and hope the review process isn’t as detailed as it is for Advanced Package Tool (APT) packages. Snap packages can be published as “strict” or “classic”, with the first one being only for a sandbox, and the second one with unrestricted access, similar to an APT package. The second ones are reviewed manually, opening up plenty of space to successfully hide malware, it was said.

The second method is similar to the first, as due to a loophole in the naming system, the attackers can register malicious snap packages for legitimate APT packages, forcing the tool to suggest both. After that, it’s only a matter of chance for the victim to pick the wrong one. 

The third method involves the threat actors registering unclaimed snap names that users might expect to exist, usually because of potential similarities to known commands. 

"Should a developer wish for their snap to execute a command that deviates from the <snap name>.<application name> format and is not simply <snap name>, they must request an alias," the researchers said. "Such a request initiates a manual review process in which the requested alias is voted on to ensure it aligns with the application."

But if the devs don’t have a snap registered under the alias, an attacker can move in with their own.

Aqua Nautilus says a quarter (26%) of APT package commands could potentially be impersonated, which is a major supply chain risk for both Linux, and WIndows Subsystem for Linux users. 

Via BleepingComputer

More from TechRadar Pro

TOPICS

Sead is a seasoned freelance journalist based in Sarajevo, Bosnia and Herzegovina. He writes about IT (cloud, IoT, 5G, VPN) and cybersecurity (ransomware, data breaches, laws and regulations). In his career, spanning more than a decade, he’s written for numerous media outlets, including Al Jazeera Balkans. He’s also held several modules on content writing for Represent Communications.

Read more
GitHub Webpage
A cracked malicious version of a Go package lay undetected online for years
A digital representation of a lock
Security experts are being targeted with fake malware discoveries
coding
Popular open source vulnerability scanner Nuclei forced to patch worrying security flaw
Close up of the Linux penguin.
A new Linux backdoor is hitting US universities and governments
A person holding a virtual cloud in the palm of their hand.
Amazon EC2 instances could be under fire from whoAMI technique giving hackers code execution access
A graphic showing someone on a tablet working through a supply chain.
Security issue in open source software leaves businesses concerned for systems
Latest in Security
cybersecurity
Chinese government hackers allegedly spent years undetected in foreign phone networks
Data leak
A major Keenetic router data leak could put a million households at risk
Code Skull
Interpol operation arrests 300 suspects linked to African cybercrime rings
Insecure network with several red platforms connected through glowing data lines and a black hat hacker symbol
Multiple routers hit by new critical severity remote command injection vulnerability, with no fix in sight
Code Skull
This dangerous new ransomware is hitting Windows, ARM, ESXi systems
An abstract image of a lock against a digital background, denoting cybersecurity.
Critical security flaw in Next.js could spell big trouble for JavaScript users
Latest in News
Open AI
OpenAI live stream - could we see a major ChatGPT upgrade?
Apple WWDC 2025 announced
Apple just announced WWDC 2025 starts on June 9, and we'll all be watching the opening event
Hornet swings their weapon in mid air
Hollow Knight: Silksong gets new Steam metadata changes, convincing everyone and their mother that the game is finally releasing this year
OpenAI logo
OpenAI just launched a free ChatGPT bible that will help you master the AI chatbot and Sora
NetSuite EVP Evan Goldberg at SuiteConnect London 2025
"It's our job to deliver constant innovation” - NetSuite head on why it wants to be the operating system for your whole business
Monster Hunter Wilds
Monster Hunter Wilds Title Update 1 launches in early April, adding new monsters and some of the best-looking armor sets I need to add to my collection