Skip to content

Fix cache cleanup and PKGBUILD review safety - #1621

Merged
pfeifferj merged 4 commits into
Morganamilo:masterfrom
pfeifferj:fix/security-ready-20261114
Nov 14, 2026
Merged

pfeifferj merged 4 commits into
Morganamilo:masterfrom
pfeifferj:fix/security-ready-20261114

Conversation

@pfeifferj

Copy link
Copy Markdown
Collaborator

Use the enumerated cache entry for deletion and Git cleanup so a forged pkgbase cannot redirect either operation. Skip permission repair for symlink and non-directory pkg entries.

Escape terminal controls in comments, decoded news, and built-in review output, including file names, symlink targets, Git messages and diffs. Control-containing files and names use escaped plain text; ordinary files retain bat highlighting. Diff colors now come from Paru instead of Git's configured palette. External FileManager rendering, raw -Gp and Unicode format characters outside char::is_control remain outside this escaping policy.

Generate missing .SRCINFO only in cwd directories matching explicit ./ targets. Existing metadata remains available for package names, split packages and dependencies. Without metadata, a package in a differently named directory, or the current directory itself, no longer resolves through ./package-name. Supply its .SRCINFO or select the directory with -B. An unnamed local dependency without metadata is omitted from the local repository and may resolve from a configured repository or the AUR instead. Configured PKGBUILD repositories keep their existing policies. Explicit -B builds no longer source unrelated working-directory PKGBUILDs.

Run PreBuildCommand after review acceptance so an interactive rejection prevents the hook from running. Existing --skipreview and --noconfirm behavior remains unchanged; the configured hook can still modify the accepted tree.

A forged pkgbase in .SRCINFO can redirect selective cleanup outside the
cache or into a sibling checkout. Use the directory entry for deletion
and Git cleanup. Skip permission repair on symlink and non-directory pkg
entries so cleanup cannot chmod a symlink target.

Signed-off-by: Josephine Pfeiffer <josie@archlinux.org>
Controls in package files, Git messages and remote text can conceal text
or alter the terminal during review. Escape them before adding display
styles, including controls decoded from news and comment HTML. Files
with unsafe contents or names use escaped text instead of bat.

Color escaped diffs with Paru's palette. External FileManager rendering,
raw -Gp output and Unicode format characters remain outside this policy.

Signed-off-by: Josephine Pfeiffer <josie@archlinux.org>
Local target discovery can source unrelated PKGBUILDs before any prompt,
including during info and search. Generate missing metadata only in cwd
directories matching explicit ./ targets, and avoid the eager cwd scan
when constructing an explicit -B build.

Existing metadata still resolves package names, split packages and local
dependencies. A differently named directory or the current directory
needs metadata or an explicit -B selection. Local dependencies without
metadata may resolve from a configured repository or the AUR instead.
Configured PKGBUILD repositories keep their existing policies.

Signed-off-by: Josephine Pfeiffer <josie@archlinux.org>
The hook runs inside the downloaded checkout and can source its files.
Running it before review exposes that code even when the user rejects
the checkout. Move it after review acceptance while preserving explicit
SkipReview and --noconfirm behavior. The configured hook remains trusted
and can modify the accepted tree.

Signed-off-by: Josephine Pfeiffer <josie@archlinux.org>
@pfeifferj
pfeifferj merged commit 31cec0e into Morganamilo:master Nov 14, 2026
3 checks passed
@pfeifferj
pfeifferj deleted the fix/security-ready-20261114 branch November 14, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant