grok-build-git
The PKGBUILD downloads and executes the rustup installer script directly from sh.rustup.rs via `curl ... | sh` (line 59) rather than using the system Rust/rustup packages or declaring it in source=(). This is a well-known but still risky pattern: it bypasses makepkg's source integrity checking and executes a remotely-fetched shell script. However, sh.rustup.rs is the official Rust toolchain installer from the Rust project, uses HTTPS with TLS 1.2+, and this pattern is commonly seen in AUR packages that need specific Rust toolchain versions. The `cargo install dotslash` (line 66) also pulls from crates.io at build time without pinning, which is a supply-chain concern. The rest of the PKGBUILD is straightforward: it builds from a GitHub source, performs license and version checks, and installs a single binary. There is no obfuscation, no exfiltration, and no substitution of upstream sources. The risks are real but not clearly malicious — this is a medium-severity supply-chain concern due to the unverified remote script execution and unpinned cargo dependency, not a genuine attack.
Triggered rules
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:59
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
alt_pkg_manager_install
A non-pip/npm package manager (pipx, uv, poetry, cargo install, go install, gem, conda…) fetches and builds an external package at build time, outside source=() and makepkg's checksums.
-
PKGBUILD:66
cargo install dotslash
llm_review
The static rules flagged this HIGH, but an AI model (anthropic/claude-sonnet-4.6) reviewed the full PKGBUILD and judged it MEDIUM (confidence 72%): The PKGBUILD downloads and executes the rustup installer script directly from sh.rustup.rs via `curl ... | sh` (line 59) rather than using the system Rust/rustup packages or declaring it in source=(). This is a well-known but still risky pattern: it bypasses makepkg's source integrity checking and executes a remotely-fetched shell script. However, sh.rustup.rs is the official Rust toolchain installer from the Rust project, uses HTTPS with TLS 1.2+, and this pattern is commonly seen in AUR packages that need specific Rust toolchain versions. The `cargo install dotslash` (line 66) also pulls from crates.io at build time without pinning, which is a supply-chain concern. The rest of the PKGBUILD is straightforward: it builds from a GitHub source, performs license and version checks, and installs a single binary. There is no obfuscation, no exfiltration, and no substitution of upstream sources. The risks are real but not clearly malicious — this is a medium-severity supply-chain concern due to the unverified remote script execution and unpinned cargo dependency, not a genuine attack.
1 higher static finding superseded - not the current verdict (shown for transparency)
curl_pipe_shell
curl/wget/fetch output reaches a shell (via pipe, xargs, process substitution, `sh -c "$(…)"`, or `| source`), executing remote code that was never reviewed or checksummed.
-
PKGBUILD:59
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
PKGBUILD
2 offending line(s) highlighted# Maintainer: Olaf Wriggers <olaf@olwig.xyz>
pkgname=grok-build-git
_pkgname=grok-build
pkgver=r43.75810042
pkgrel=1
pkgdesc="SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible."
arch=('x86_64' 'aarch64')
url="https://x.ai/build"
license=('Apache-2.0')
provides=('grok')
conflicts=('grok')
options=('!strip' '!debug' '!emptydirs')
makedepends=("git" "curl")
backup=('etc/grok/requirements.toml')
source=(
"$_pkgname::git+https://github.com/xai-org/grok-build.git"
"requirements.toml"
)
b2sums=(
"SKIP"
"37b586af90c67f7a8cfb778d3408d60c87f81cd5aff6c52ed8e091c741446543f5aaecf773160f4cf29005bded1c653f2e62868b851e9470914dded3e585c58e"
)
pkgver() {
cd "$srcdir/$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
# TODO default "ultra" sandbox -> https://docs.x.ai/build/features/sandbox
# TODO restrict with explicit local grok user
prepare() {
cd "$srcdir/$_pkgname"
cargo_toml="crates/codegen/xai-grok-pager-bin/Cargo.toml"
upstream_license=$(grep '^license =' "$cargo_toml" | cut -d '"' -f2)
if [[ "$license" != "$upstream_license" ]]; then
echo "License mismatch: $cargo_toml license is $upstream_license, but PKGBUILD license is $license"
exit 1
fi
# TODO check also LICENSE file
}
build() {
cd "$srcdir/$_pkgname"
export RUSTUP_HOME="$srcdir/rustup"
export CARGO_HOME="$srcdir/cargo"
export PATH="$CARGO_HOME/bin:$PATH"
export RUSTUP_INIT_SKIP_PATH_CHECK=yes
rm -rf "$RUSTUP_HOME" "$CARGO_HOME"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none
rustup show
# ring, used by xai-grok-tools, fails to link when -flto is present in CFLAGS
# same for lzma and zstd, since moved install dotslash from prepare to build
unset CFLAGS
cargo install dotslash
cargo build -p xai-grok-pager-bin --release
binary="$srcdir/$_pkgname/target/release/xai-grok-pager"
chmod +x "$binary"
cargo_toml="crates/codegen/xai-grok-pager-bin/Cargo.toml"
upstream_version=$(grep '^version =' "$cargo_toml" | cut -d '"' -f2)
binary_version=$("$binary" --version | awk '{print $2}')
if [[ "$binary_version" != "$upstream_version" ]]; then
echo "Version mismatch: built binary version is $binary_version, but upstream version is $upstream_version"
exit 1
fi
}
package() {
binary="$srcdir/$_pkgname/target/release/xai-grok-pager"
install -Dm755 "$binary" "$pkgdir/usr/bin/grok"
install -Dm644 "$srcdir/$_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "$srcdir/requirements.toml" "$pkgdir/etc/grok/requirements.toml"
install -d "$pkgdir/usr/share/bash-completion/completions"
install -d "$pkgdir/usr/share/zsh/site-functions"
install -d "$pkgdir/usr/share/fish/vendor_completions.d"
"$pkgdir/usr/bin/grok" completions bash > "$pkgdir/usr/share/bash-completion/completions/grok" || true
"$pkgdir/usr/bin/grok" completions zsh > "$pkgdir/usr/share/zsh/site-functions/_grok" || true
"$pkgdir/usr/bin/grok" completions fish > "$pkgdir/usr/share/fish/vendor_completions.d/grok.fish" || true
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-02 00:00:32 | Medium | 4 |
| 2026-10-01 00:02:06 | Medium | 4 |
| 2026-09-30 00:20:07 | Medium | 4 |
| 2026-09-29 00:07:46 | Medium | 4 |
| 2026-09-28 00:28:32 | Medium | 4 |
| 2026-09-27 00:07:07 | Medium | 4 |
| 2026-09-26 00:12:15 | Medium | 4 |
| 2026-09-25 00:03:36 | Medium | 4 |
| 2026-09-24 00:24:14 | Medium | 4 |
| 2026-09-23 00:28:13 | Medium | 4 |
| 2026-09-22 00:15:14 | Medium | 4 |
| 2026-09-21 00:26:32 | Medium | 4 |
| 2026-09-20 00:25:31 | Medium | 4 |
| 2026-09-19 00:25:36 | Medium | 4 |
| 2026-09-18 00:17:11 | Medium | 4 |
| 2026-09-17 21:26:26 | High | 3 |
| 2026-09-17 00:27:14 | Medium | 4 |
| 2026-09-16 00:03:17 | Medium | 4 |
| 2026-09-15 00:25:31 | Medium | 4 |
| 2026-09-14 00:27:57 | Medium | 4 |