zls-master
Triggered rules
llm_review
The static rules flagged this MEDIUM, but an AI model (anthropic/claude-4.6-sonnet-20260217) reviewed the full PKGBUILD and judged it LOW (confidence 82%): The prepare() function queries releases.zigtools.org to determine which git commit of the already-cloned ZLS repository to check out. This is the official ZLS tooling infrastructure (zigtools.org is the upstream project's own domain). Critically, no binary or executable code is downloaded from this endpoint — only a JSON response containing a version string/commit hash. The actual source code being built comes from the GitHub repository (github.com/zigtools/zls) which is in the source array with a git+https URL. The curl call only influences which git commit is checked out within the already-cloned repo. If releases.zigtools.org were compromised, an attacker could redirect the build to a different commit hash, but that commit would still need to exist in the legitimate GitHub repository — it cannot inject arbitrary code. This is a non-standard pattern (dynamic version selection outside the source array) and slightly sloppy from a reproducibility standpoint, but the security impact is low since no untrusted executable content is fetched or executed directly from that host.
1 higher static finding superseded - not the current verdict (shown for transparency)
external_download_not_in_source
curl/wget fetches a URL on a non-allowlisted host that is not part of source=(), so it is not checksum-verified by makepkg.
-
PKGBUILD:42
local index_json="$(curl -s "https://releases.zigtools.org/v1/zls/select-version?zig_version=${zig_version}&compatibility=full")"
PKGBUILD
1 offending line(s) highlighted# Maintainer: Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>
_basename="zls"
pkgname="${_basename}-master"
pkgver=0.17.0dev.38+ae3ab43c
pkgrel=1
pkgdesc="A language server for Zig"
arch=(
'aarch64' # 'aarch64'
'armv7h' # 'arm'
'loong64' # 'loongarch64'
'powerpc64le' # 'powerpc64le'
'riscv64' # 'riscv64'
# 's390x' # 's390x'
'i686' # 'x86'
'x86_64' # 'x86_64'
)
url="https://zigtools.org/zls"
_url="https://github.com/zigtools/${_basename}"
license=(
'MIT'
)
depends=(
'sh'
'zig-master'
)
makedepends=(
'curl'
'git'
'jq'
)
_pkgsrc="${_url##*/}"
source=(
"${_pkgsrc}::git+${_url}.git"
"${_basename}-versioned.sh"
)
sha256sums=('SKIP'
'b9e70d344290a58c6e8199a22232fbd2a8789cf76ddf0574f0a4ea647299ea68')
prepare() {
local zig_version="$(zig-master version | tr -d '\n' | jq -sRr @uri)"
local index_json="$(curl -s "https://releases.zigtools.org/v1/zls/select-version?zig_version=${zig_version}&compatibility=full")"
local zls_version="$(jq -r '."version"' <<< "${index_json}")"
local zls_commit="${zls_version##*+}"
cd "${srcdir}"
sed -e "s|@@ZIG_PATH@@|/opt/zig-master|g" \
-e "s|@@ZLS_PATH@@|/usr/lib/${pkgname}|g" \
-i "${_basename}-versioned.sh"
cd "${_pkgsrc}"
git -c advice.detachedHead=false checkout "${zls_commit}"
# grep -oP '(?<=\.url = ")[^"]+' build.zig.zon | while read -r zig_fetch_url; do
# zig-master fetch --global-cache-dir "${srcdir}/zig-global-cache" "${zig_fetch_url}"
# done
}
pkgver() {
cd "${srcdir}/${_pkgsrc}"
local build_version build_version_normalized
local git_describe git_describe_tail git_describe_normalized
# 0.16.0-dev
build_version="$(grep -Po '(?<=\.version = ")[^"]+' build.zig.zon)"
# 0.16.0dev
build_version_normalized="${build_version//-/}"
# 0.16.0 OR 0.15.0-3-g1840a4b8
git_describe="$(git describe --match "*.*.*" --tags)"
case "$git_describe" in
*-*-g*)
# 3-g1840a4b8
git_describe_tail="${git_describe#*-}"
# 3+1840a4b8
git_describe_normalized="${git_describe_tail//-g/+}"
# 0.16.0dev.3+1840a4b8
printf '%s.%s' "$build_version_normalized" "$git_describe_normalized"
;;
*)
# Tagged release: 0.16.0
printf '%s' "$git_describe"
;;
esac
}
build() {
local zig_options=(
--summary all
--prefix /usr
--search-prefix /usr
--global-cache-dir "${srcdir}/zig-global-cache"
# --system "${srcdir}/zig-global-cache/p"
--verbose
-Dtarget=native-linux.6.15-gnu.2.41
-Dcpu=baseline
-Doptimize=ReleaseSafe
-Dpie=true
)
cd "${srcdir}/${_pkgsrc}"
DESTDIR="build" zig-master build "${zig_options[@]}"
}
# check() {
# export PATH="/opt/zig-master:$PATH"
# local zig_options=(
# --summary all
# --prefix /usr
# --search-prefix /usr
# --global-cache-dir "${srcdir}/zig-global-cache"
# # --system "${srcdir}/zig-global-cache/p"
# --verbose
# -Dtarget=native-linux.6.15-gnu.2.41
# -Dcpu=baseline
# -Doptimize=ReleaseSafe
# -Dpie=true
# )
#
# cd "${srcdir}/${_pkgsrc}"
# DESTDIR="check" zig-master build test "${zig_options[@]}"
# }
package() {
cd "${srcdir}"
install -vDm755 "${_basename}-versioned.sh" "${pkgdir}/usr/bin/${pkgname}"
cd "${_pkgsrc}"
install -vDm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
install -vDm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
cd "build/usr/bin"
install -vDm755 "${_basename}" "${pkgdir}/usr/lib/${pkgname}/${_basename}"
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |