You are not logged in.

#1 2024-10-07 14:54:43

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 49

[SOLVED] How to validate files that are not human-readable in AUR

According to the wiki,

Carefully check the PKGBUILD, any .install files, and any other files in the package's git repository for malicious or dangerous commands

How do I go about verifying the validity of binary files or image files?

Last edited by ThoughtBubble (2024-10-27 23:11:21)

Offline

#2 2024-10-07 15:14:12

Awebb
Member
Registered: 2010-05-06
Posts: 6,613

Re: [SOLVED] How to validate files that are not human-readable in AUR

ThoughtBubble wrote:

According to the wiki,

Carefully check the PKGBUILD, any .install files, and any other files in the package's git repository for malicious or dangerous commands

How do I go about verifying the validity of binary files or image files?

Check those files against hashes provided from upstream. I do not think the AUR should be abused to distribute binary files at all. Do you have an example?

Online

#3 2024-10-07 15:27:26

fam007e
Member
Registered: 2024-05-04
Posts: 7

Re: [SOLVED] How to validate files that are not human-readable in AUR

In my opinion, you should check the source code on GitHub if you are suspicious about an application, whether it’s a binary or if you prefer to compile the binary yourself during the installation process. A general rule I follow is to look at the number of stars on a project. If it has a significant number of stars, I consider installing it; if not, there’s no harm in not installing it.

Offline

#4 2024-10-07 17:43:25

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 49

Re: [SOLVED] How to validate files that are not human-readable in AUR

Awebb wrote:

I do not think the AUR should be abused to distribute binary files at all. Do you have an example?

Not for binary, specifically. Librewolf has a PNG file.

fam007e wrote:

In my opinion, you should check the source code on GitHub if you are suspicious about an application, whether it’s a binary or if you prefer to compile the binary yourself during the installation process. A general rule I follow is to look at the number of stars on a project. If it has a significant number of stars, I consider installing it; if not, there’s no harm in not installing it.

In your opinion, what would be a sufficient amount of stars? Should I also take the popularity metric from the AUR search results into account?

Last edited by ThoughtBubble (2024-10-07 17:46:39)

Offline

#5 2024-10-07 18:51:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] How to validate files that are not human-readable in AUR

There are several different flavors of validation / security that are relevant for AUR packages and they should not be mixed up.  The quote from your initial post is encouraging users to ensure no build scripts are doing anything inappropriate.  Makepkg does not source / parse / execute a png file at all, so that is simply not relevant.  A malicious file could be named with a .png extension, but the only way it could do anything is if the PKGBUILD or .install file explicitly sourced or executed it - so seeing a "/bin/sh notreallyimage.png" would be a concern.  But you'd see this when you inspected the PKGBUILD and install file.

So the concerns addressed by that quote, nothing but the files sourced or used by makepkg / pacman are relevant.

Other security concerns would apply to the image file, but these are addressed via other means (including the checksum and an implicit degree of trust of the maintainer of the package).

That said, images generally should not be uploaded to the AUR.  An icon not available elsewhere might be a grey-zone and almost exception.  Really though, if it's just an icon, it should be trivial to find a copy of it on the web somewhere and use that url rather than the image itself.

Last edited by Trilby (2024-10-07 18:53:47)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2024-10-19 18:18:50

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 49

Re: [SOLVED] How to validate files that are not human-readable in AUR

Awebb wrote:
ThoughtBubble wrote:

According to the wiki,

Carefully check the PKGBUILD, any .install files, and any other files in the package's git repository for malicious or dangerous commands

How do I go about verifying the validity of binary files or image files?

Check those files against hashes provided from upstream. I do not think the AUR should be abused to distribute binary files at all. Do you have an example?

This refers to those sha512/sha256 sums correct? What commands do I type in to check my file against my hash?

Offline

#7 2024-10-19 18:23:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] How to validate files that are not human-readable in AUR

sha512 and sha256 are each executables to do just that.  But again, you're really barking up the wrong tree here.  Makepkg checks the validity of these files for you already.  There is no reason to do this manually.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2024-10-19 19:14:13

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 49

Re: [SOLVED] How to validate files that are not human-readable in AUR

Trilby wrote:

sha512 and sha256 are each executables to do just that.  But again, you're really barking up the wrong tree here.  Makepkg checks the validity of these files for you already.  There is no reason to do this manually.

I want to manually enter the source URL on my browser to download a .tar file. Then I want to examine the contents inside safely.
The reason why I want to do this is because the official repository is hosted in one place, but this source file comes from another place.

Offline

#9 2024-10-19 20:07:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] How to validate files that are not human-readable in AUR

I'm not sure how that comment has any relevance to what you quoted.  Makepkg will run the checksums for you.  Why would you go though all these manual steps to end up doing exactly what makepkg will do with a single command?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2024-10-19 20:50:38

ThoughtBubble
Member
Registered: 2024-07-09
Posts: 49

Re: [SOLVED] How to validate files that are not human-readable in AUR

I finally understand what you are saying. I just need to run the makepkg command.

Offline

Board footer

Powered by FluxBB