Snap Trap: The Hidden Dangers Within Ubuntu’s Package Suggestion System
The command-not-found package on Ubuntu suggests snap packages based on command names, and attackers can register snap names that match commands or aliases to have their malicious snaps recommended. This could lead users to install malicious packages, potentially leading to supply chain attacks.
Published on aquasec.com
Aqua Nautilus researchers have identified a security issue that arises from the interaction between Ubuntu’s command-not-found package and the snap package repository. While command-not-found serves as a convenient tool for suggesting installations for uninstalled commands, it can be inadvertently manipulated by…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the command-not-found tool trusts snap package names without verifying their legitimacy, allowing attackers to register names that match commands or aliases.
Impact
Attackers could deceive users into installing malicious snap packages, potentially leading to supply chain attacks affecting Linux users and Windows running WSL.
What the attacker needed
Ubuntu system with command-not-found; Attacker can publish snaps to Snap Store; User runs an uninstalled command
The fix
Users should verify package sources, and developers should register corresponding snap names to prevent impersonation.
How it was found
- Run a command that is not installed, such as 'tarquingui'.
- Observe that command-not-found suggests installing the snap 'tarquin'.
- Register a snap with the name 'tarquingui' and publish a malicious package.
- Run the command again and see that command-not-found now suggests the malicious snap 'tarquingui'.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you type a command that isn't installed, Ubuntu's command-not-found tool suggests packages to install. The researchers found that attackers can publish their own packages with names that match commands or common typos, so the tool might suggest the attacker's package instead of the real one. If you install it, you could get malware.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.