Hijacking Arch Linux Packages by Repo Jacking GitHub Repositories
Many Arch Linux packages reference GitHub repositories whose owners have renamed their accounts, leaving the old repository names redirecting to the new ones. An attacker can register the old username and create a repository with the same name, causing package builds to pull and install malicious files.
Repo Jacking GitHub Repositories Follow
Published on blog.nietaanraken.nl
Last year, we published a blog post discussing an attack where a malicious actor hijacks Arch User Repository (AUR) vulnerable packages by registering expired domains.
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 package build scripts reference GitHub repositories by their old owner names, which GitHub redirects after a rename, allowing an attacker to reclaim the old username and serve malicious content.
Impact
An attacker could make vulnerable packages install arbitrary malicious files, but packages with integrity verification would fail to install, causing only a denial of service; the official repository package is only exploitable when a maintainer rebuilds it.
What the attacker needed
A vulnerable package referencing a renamed GitHub user; Attacker registers the old GitHub username; Victim installs or rebuilds the package
The fix
Package maintainers should use integrity verification (checksums or PGP signatures) whenever possible and regularly verify upstream repository references.
How it was found
- Find AUR packages that reference GitHub repositories whose owners no longer exist.
- Check whether the referenced repository still exists (redirects) or is gone.
- Register the old GitHub username and create a repository with the same name.
- Publish malicious files in that repository.
- When a user installs the package, the build process clones and compiles the attacker's files.
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 a GitHub user renames their account, the old username becomes free for anyone to take. If a software package still points to the old username, an attacker who takes that username can publish their own code under the same repository name. The package then downloads and builds the attacker's code instead of the original.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.