A user-maintained Arch Linux AUR (Arch User Repository) software repository was pulled earlier this week after it was found to contain malware.
The repository was apparently compromised by an actor using the handle “xeactor” after its original maintainer abandoned it. The affected repo was a user-maintained PDF viewer called acroread.
The orphaned package was modified on June 7, when xeactor added to it a curl script to fetch and execute a malicious script from an attacker-controlled server. The result was the installation of a persistent program that causes systemd to start periodically.
The executed scripts were also found to include a component to gather various data on the compromised machine, including ID, CPU details, Pacman (package management utility) Information, and the output of uname –a and systemctl list-units.
The modification was reported on July 8 and the commits were reverted within hours by maintainer Eli Schwartz, who also suspended the offending account and removed two other packages. The affected packages are acrored 9.5.5-8, balz 1.20-3, and minergate 8.1-2.
Some of those who analyzed the modified code suggested that the changes might have been intended as a warning, because the script would create files in such a way that generated a lot of noise. Specifically, a compromised.txt file was created in root and all home folders.
However, the scripts could have been modified at any time to execute arbitrary code, thus turning malicious.
As Arch’s Giancarlo Razzolini points out, the issue itself isn’t that severe, despite the attention it has already gathered. All those who download from AUR do so at their own risk, and such incidents could happen more often than not, he suggests.
“I’m surprised that this type of silly package takeover and malware introduction doesn’t happen more often. This is why we insist users always download the PKGBUILD from the AUR, inspect it and build it themselves. Helpers that do everything automatically and users that don’t pay attention, *will* have issues. You should use helpers even more so at your risk than the AUR itself,” Razzolini notes.
Late last month, the developers of the Gentoo Linux distribution informed users that one of their GitHub accounts was compromised and that attackers planted malicious code. Gentoo’s infrastructure and repository mirrors weren’t affected.