Whenever I read a post about the AUR it comes with lots of red flashing warning signs that one should always check those apps before installing, which makes perfect sense to me. But I am not quite sure what red flags I should be looking for.
Using the Bitwarden update which happened to come in today as an example.
What information can and should I check to help me come to a conclusion that this is a valid package?
The URLs data gets downloaded from is an obvious one, in this case it points to Bitwarden’s official github repository, so check passed in my opinion.
I could obviously test the URL in a browser, download separately what’s behind the URL and check what’s in the package. Investigate “${pkgname}.sh” but that’s going to get laborious quickly.
Or maybe a thorough test at first install and then just cursory?
How do people here go about checking their AUR packages?
That’s a good question, and also quite challenging to answer, in general. Here are some thoughts, surely not everything about the matter, but a starting point maybe.
At least when starting to use an AUR package for the first time, it is worth doing some research.
If and when you want to make sure the AUR package is valid, here are some things to check (and evaluate them together as a whole):
dependency packages, especially if they are from AUR
if the checksum variable (e.g. sha256sums) contains word SKIP, then the related source links should be checked more carefully as they are not automatically verified
all package files included (PKGBUILD and other files)
Here is my recommendation for installing a new AUR package assuming you have a very low risk tolerance.
Do you trust the maintainer(s)? - If you do, then you don’t really need to go any further on this list
Check the votes and popularity - This just tells you how widely used a package is. However, that is useful. With a package used by many users there is a much higher chance someone will notice if someone publishes something wrong/malicious.
Review the most recent couple of AUR comments - You are just looking for major red flags
Check the source array - Now you need to check everything in the source array. You need to do this in a way that makes sense. See below for how I would do it as it relates to your specific example.
Check for the existence of an .install script. These are executed as root by pacman at the time of package install.
Review the PKGBUILD itself. Mostly you are just looking for things like calls to sudo/su/pkexec or something extremely out of place.
OK, so now lets use your bitwarden example and walk through these steps.
Let’s assume we don’t trust the maintainer, otherwise this will be a very short example
The votes(67) and popularity(3.06) are high enough that to assume the package is fairly widely used.
For the first two, I wouldn’t actually download and check them, I would just validate that “https://github.com/bitwarden” is the official bitwarden github. If it is, I think it is reasonable to assume those are safe. If you don’t trust the software provider, you probably shouldn’t install the software to begin with.
The next 3 need to be reviewed: package.json.patch - It just removes a postinstall command bitwarden.desktop - It just runs bitwarden-desktop bitwarden.sh - It just lanches bitwarden
I would say those are all pretty safe
There is no .install script
The PKGBUILD looks fine to me. I don’t see any red flags.
To me, that package is pretty safe.
As it relates to updates of AUR packages, I think it is reasonable to only review the diffs. In most cases the changes between versions are small so it only takes a few seconds and any good AUR helper will show you all the package diffs.
SIDE NOTE 1: Nobody should feel like they have to do all these steps. This is only intended to help people with a low aversion to risk. Don’t read this and think “This is scary so I am just going to install a binery package from somewhere else”. That probably is actually higher risk. Also, steps #2 and #3 above are worth doing even if you aren’t comfortable with the rest.
SIDE NOTE 2: I almost always use AUR packages before considering any other option. However, bitwarden is the exception to this for me. That package is so ciritical to my security that I only use the official appimage. It is self-updating and can be downloaded directly from bitwarden.
It is probably worth noting that for *-git packages these will always be SKIP and only rarely receive updates. This is because they usually just pull the latest source from the source repository. In this case, it is normal for them to appear as if they haven’t been updated for extended periods of time.
Well, you can help change that. If you like a package and think it should be included in the official repos, vote for it. Also, if you notice anything malicious in an AUR package, report it. We all can and should help make the AUR better for everyone.
I noticed the vote link a while back but had no idea what “vote for this package” would actually do? Actually, still not sure where these votes would be used?
Edit: Voted for paru, just to try it out, but still none the wiser
true no one of AUR helpers are in the repositories if a am not wrong, arch will not add any of them.
The first thing I do on checking trust on an AUR PKGBUILD is to check the link to sources, and see if it links to original sources of the app. and then I do check PKGBUILD e.t.c. if I see any strange stuff inside… and sure checking comments and last update and votes…