OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
security medium common DISPUTE

What reviewing a PKGBUILD before installing from the AUR actually means

omarchyarchdesktoplaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy 4.0.4-1 on 2026-09-19
AUDIT NOTE

The sharp claim holds, read at the pinned commit and never run. 02fb6ba9 is the commit the v13.0.1 tag resolves to and pacman -Q yay is 13.0.1-1 here, so the source and the installed binary match. pkg/settings/args.go maps --noconfirm to settings.NoConfirm, pkg/sync/workdir/preparer.go registers menus.DiffFn only when cfg.DiffMenu is true, DiffFn calls selectionMenu with settings.NoConfirm and run.Cfg.AnswerDiff, whose DefaultConfig value is the empty string, GetInput in pkg/text/input.go returns the default at once when noConfirm is true, ParseNumberMenu in pkg/intrange/intrange.go turns the empty string into no words, selectionMenu in pkg/menus/menu.go then selects nothing, and DiffFn returns before any git diff when toDiff is empty. The record cited input.go for a chain that mostly lives in menu.go, intrange.go, args.go and preparer.go, so those are appended. DefaultConfig confirmed DiffMenu true and EditMenu false, diff_menu.go confirmed the empty-tree and AUR_SEEN behaviour, and doc/yay.8 confirmed --editmenu and --diffmenu. Three gate 2 defects. The cause says the wiki calls review 'the single most important step', the wiki says 'the most important step'. The fix says .install functions 'run as root under pacman -U', which neither cited source states, so the sentence now says what the PKGBUILD wiki page says, that pacman runs the four functions at install time, and that pacman -U is a root command per the wiki's own install step. The verify says no config.json key means the built in default, but doc/lua.md at the same commit says init.lua overlays config.json and can set diff_menu and edit_menu, so the verify now reads yay -Pg, which prints the loaded configuration as JSON via Configuration.String. The danger names dotfiles scripts and misses that on Omarchy 4.0.2-1 the stock AUR installer bin/omarchy-pkg-aur-install ends in yay -S --noconfirm and bin/omarchy-update-aur-pkgs runs yay -Sua --noconfirm, both byte-identical to the v4.0.2 tag commit, so the stock paths are the main case, and the picker's alt-b PKGBUILD preview is the review point on that path. A sentence was added so the fix does not read as making a package safe. Severity medium stands: the control is on by default and off only on paths that pass --noconfirm, and a malicious package still needs the user to pick it. Not exercised: no yay install, no --noconfirm run, no AUR clone, and the Lua overlay order relative to -Pg was read from doc/lua.md rather than traced through pkg/runtime. Re-checked against 4.0.4-1 2026-09-19: Rechecked on omarchy 4.0.4-1, read and never run. The installed /usr/bin/omarchy-pkg-aur-install and /usr/bin/omarchy-update-aur-pkgs are byte-identical to the v4.0.4 tag, c668141e9c42b13c80c9ca4ea108e11708c5e8a5. omarchy-pkg-aur-install line 26 still ends in xargs yay -S --noconfirm, and omarchy-update-aur-pkgs line 8 still runs yay -Sua --noconfirm with --cleanafter and --ignore gcc14,gcc14-libs. Neither passes --answerdiff, --diffmenu or --editmenu, and nothing under /usr/share/omarchy ships a yay configuration. The only change to either script between v4.0.2 and v4.0.4 is the updatedb line in omarchy-pkg-aur-install (pull request 10579), which does not touch the yay call. /usr/bin/omarchy-update line 50 still calls omarchy-update-aur-pkgs, the menu's install.aur entry still runs omarchy-pkg-aur-install, and the picker still binds alt-b to yay -Gpa. pacman -Q yay is still 13.0.1-1, which is still yay's latest release, and the v13.0.1 tag still resolves to 02fb6ba9. Re-read at that commit: DefaultConfig keeps DiffMenu true, EditMenu false and AnswerDiff empty, and GetInput in pkg/text/input.go returns the default at once when noConfirm is true, so the danger holds unchanged. The only defect is the version labels: the danger and verify named 4.0.2-1 alone, which reads as if 4.0.3 or 4.0.4 changed it. Both now say 4.0.2-1 through 4.0.4-1, and v4.0.4 sources are appended. Not exercised: no yay run, no AUR install, and yay -Pg was not run because the claim does not depend on this machine's yay configuration.

The cause above was rewritten on 2026-09-18 to match this note; the fix was corrected by the audit itself.
RISK

--noconfirm silently removes the diff review, and on Omarchy 4.0.2-1 through 4.0.4-1 both stock AUR paths use it: omarchy-pkg-aur-install, which the menu's Install then AUR entry runs, ends in yay -S --noconfirm, and omarchy-update-aur-pkgs, which omarchy update calls, runs yay -Sua --noconfirm. Read from yay v13.0.1's own source: --noconfirm sets settings.NoConfirm (pkg/settings/args.go), the diff selection prompt calls GetInput(defaultAnswer, noConfirm) (pkg/menus/menu.go), and when noConfirm is true GetInput in pkg/text/input.go returns the default answer immediately with no prompt shown at all. The default answer for the diff menu, answerdiff, is an empty string, and an empty selection picks zero packages to diff, so yay -S --noconfirm <pkgname>, the two Omarchy scripts, or any dotfiles script, provisioning tool, or shell alias that adds --noconfirm to an AUR install, builds and installs with no diff ever printed and no chance to abort, even though diffmenu is on. Script an unattended AUR install by fetching and diffing the PKGBUILD yourself first, not by trusting --noconfirm to still show it to you.

Symptom

how do I actually review an AUR package before installing it, does yay show me anything automatically or do I have to do it by hand

Cause

Arch's own wiki lists verifying the PKGBUILD as the most important step in installing anything from the AUR, and is specific about what that means: check the PKGBUILD itself, any .install files, and any other files in the package's repository, "particularly for sections that may pull software code from outside the repositories," because, in the wiki's own words, "malicious code may be signed, therefore you must vet the PKGBUILD." Omarchy installs yay, not paru, from its base package list. yay automates part of this review through two settings that most people never look at, and the two do not behave the same way. diffmenu defaults to true, confirmed by reading yay v13.0.1's own DefaultConfig in pkg/settings/config.go. editmenu defaults to false in the same struct. yay's diff menu, read in pkg/menus/diff_menu.go, diffs against git's empty tree when a package base has never been reviewed before, so a first time install is shown as one large "everything added" diff, and diffs against the last reviewed commit on every later update, skipping a package outright if nothing changed since. The edit menu, which actually opens the files in an editor, only runs if you turn it on. Both settings can also be set from ~/.config/yay/init.lua, which yay 13.0.1 overlays on config.json.

Fix

Acquire the build files and read them before running makepkg or letting a helper run it for you:


git clone https://aur.archlinux.org/<pkgname>.git
cd <pkgname>
less PKGBUILD

Read every .install file too. pacman runs its pre_install, post_install, pre_upgrade and post_upgrade functions while it installs the package, and the install step, pacman -U, is a root command, so nothing in those functions is confined to your own account. Look specifically at the source=() array, prepare() and build() for anything that pulls code from outside the AUR's own repository, and at validpgpkeys if the package checks a signature, since a signed package can still be malicious.

On an update, diff against what you last reviewed instead of rereading the whole file:


git show
# or, to see the full file with change markers inline
git difftool @~..@ --tool=vimdiff

yay does the diff step for you by default when you run it yourself, both on first install (against an empty tree, so you see everything) and on every update after that (against your last reviewed commit). It does not open the files for you to actually read, because editmenu defaults to off. Turn it on for a run you want to look at closely:


yay --editmenu -S <pkgname>

or persist it by adding "editmenu": true to ~/.config/yay/config.json.

On Omarchy, the menu's Install then AUR entry and omarchy update both run yay with --noconfirm, so neither shows a diff. In the installer's picker press alt-b to read the PKGBUILD in the preview pane before you select the package. For updates, run yay -Sua yourself when you want the diff.

A review lowers the risk. It does not make a package safe: a PKGBUILD you understood can still fetch a compromised upstream archive.

Verify

Print the configuration yay is actually running with. This reflects ~/.config/yay/config.json and ~/.config/yay/init.lua, which overlays it, and a dotfiles repo can have changed either:


yay -Pg | grep -E '"(diffmenu|editmenu)"'

yay 13.0.1's built in defaults are diffmenu true and editmenu false. Then confirm which Omarchy paths skip the diff regardless. On 4.0.2-1 through 4.0.4-1 expect two hits:


grep -n -- '--noconfirm' /usr/share/omarchy/bin/omarchy-pkg-aur-install /usr/share/omarchy/bin/omarchy-update-aur-pkgs

Sources

pkgbuild-review-before-building-from-aur