grok-build-git

maintainer olwig · 1 votes · scanned 2026-08-18 00:03:42.021799
MEDIUM
View on AUR ↗
Why flagged The PKGBUILD downloads and executes the rustup installer script directly from sh.rustup.rs via `curl | sh` in the prepare() step rather than using the system Rust toolchain or the `rust` makedepend. This is a well-known but non-standard pattern that bypasses pacman's dependency tracking and executes a remotely-fetched shell script. While rustup.rs is the official Rust installer host and the download uses --proto '=https' --tlsv1.2, executing arbitrary shell scripts from the internet during a build is a genuine supply-chain concern (medium impact). Additionally, `cargo install dotslash` fetches and compiles an external crate from crates.io at build time outside of the source=() array, which is another untracked external dependency. The main build itself (cargo build from the git source) is legitimate and builds from source. The license check and version verification steps are actually good hygiene. The source repository (xai-org/grok-build on GitHub) appears to be a real xAI project. The risks are real but not clearly malicious — this is sloppy/non-standard packaging that introduces supply-chain risk through the curl|sh pattern and untracked cargo dependency, warranting medium severity.

Triggered rules

MEDIUM External download from an untrusted host, not in source=() 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:50 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
MEDIUM External install via pipx/uv/poetry/cargo/go/gem 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:52 cargo install dotslash
LOW Few votes, recently uploaded zero_votes_recent

Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.

MEDIUM AI review downgraded a static finding 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` in the prepare() step rather than using the system Rust toolchain or the `rust` makedepend. This is a well-known but non-standard pattern that bypasses pacman's dependency tracking and executes a remotely-fetched shell script. While rustup.rs is the official Rust installer host and the download uses --proto '=https' --tlsv1.2, executing arbitrary shell scripts from the internet during a build is a genuine supply-chain concern (medium impact). Additionally, `cargo install dotslash` fetches and compiles an external crate from crates.io at build time outside of the source=() array, which is another untracked external dependency. The main build itself (cargo build from the git source) is legitimate and builds from source. The license check and version verification steps are actually good hygiene. The source repository (xai-org/grok-build on GitHub) appears to be a real xAI project. The risks are real but not clearly malicious — this is sloppy/non-standard packaging that introduces supply-chain risk through the curl|sh pattern and untracked cargo dependency, warranting medium severity.

1 higher static finding superseded - not the current verdict (shown for transparency)
HIGH Remote download executed by a shell 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:50 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path

PKGBUILD

2 offending line(s) highlighted
1# Maintainer: Olaf Wriggers <olaf@olwig.xyz>
2
3pkgname=grok-build-git
4_pkgname=grok-build
5pkgver=r33.d71f6e0
6pkgrel=1
7pkgdesc="SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible."
8arch=('x86_64' 'aarch64')
9url="https://x.ai/build"
10license=('Apache-2.0')
11provides=('grok')
12conflicts=('grok')
13options=('!strip' '!debug' '!emptydirs')
14makedepends=("git" "curl" "perl" "clang")
15backup=('etc/grok/requirements.toml')
16
17source=(
18 "$_pkgname::git+https://github.com/xai-org/grok-build.git"
19 "requirements.toml"
20)
21
22b2sums=(
23 "SKIP"
24 "4d37a050b4fa861b2ee076940908f4dfef7419e6297425bb3dfe6c26fcb9440b01befff1837451b9bed194ee45a3f52e30b040bd356b32a5bb178ede6aea694e"
25)
26
27pkgver() {
28 cd "$srcdir/$_pkgname"
29 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
30}
31
32# TODO default "ultra" sandbox -> https://docs.x.ai/build/features/sandbox
33# TODO restrict with explicit local grok user
34
35prepare() {
36 cd "$srcdir/$_pkgname"
37
38 cargo_toml="crates/codegen/xai-grok-pager-bin/Cargo.toml"
39 upstream_license=$(grep '^license =' "$cargo_toml" | cut -d '"' -f2)
40 if [[ "$license" != "$upstream_license" ]]; then
41 echo "License mismatch: $cargo_toml license is $upstream_license, but PKGBUILD license is $license"
42 exit 1
43 fi
44 # TODO check also LICENSE file
45
46 export RUSTUP_HOME="$srcdir/rustup"
47 export CARGO_HOME="$srcdir/cargo"
48 export PATH="$CARGO_HOME/bin:$PATH"
49
50 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
51 rustup toolchain install
52 cargo install dotslash
53}
54
55build() {
56 cd "$srcdir/$_pkgname"
57
58 export RUSTUP_HOME="$srcdir/rustup"
59 export CARGO_HOME="$srcdir/cargo"
60 export PATH="$CARGO_HOME/bin:$PATH"
61
62 # ring, used by xai-grok-tools, fails to link when -flto is present in CFLAGS
63 unset CFLAGS
64 cargo build -p xai-grok-pager-bin --release
65
66 binary="$srcdir/$_pkgname/target/release/xai-grok-pager"
67 chmod +x "$binary"
68
69 cargo_toml="crates/codegen/xai-grok-pager-bin/Cargo.toml"
70 upstream_version=$(grep '^version =' "$cargo_toml" | cut -d '"' -f2)
71 binary_version=$("$binary" --version | awk '{print $2}')
72 if [[ "$binary_version" != "$upstream_version" ]]; then
73 echo "Version mismatch: built binary version is $binary_version, but upstream version is $upstream_version"
74 exit 1
75 fi
76}
77
78package() {
79 binary="$srcdir/$_pkgname/target/release/xai-grok-pager"
80
81 install -Dm755 "$binary" "$pkgdir/usr/bin/grok"
82 install -Dm644 "$srcdir/$_pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
83 install -Dm644 "$srcdir/requirements.toml" "$pkgdir/etc/grok/requirements.toml"
84
85 install -d "$pkgdir/usr/share/bash-completion/completions"
86 install -d "$pkgdir/usr/share/zsh/site-functions"
87 install -d "$pkgdir/usr/share/fish/vendor_completions.d"
88
89 "$pkgdir/usr/bin/grok" completions bash > "$pkgdir/usr/share/bash-completion/completions/grok" || true
90 "$pkgdir/usr/bin/grok" completions zsh > "$pkgdir/usr/share/zsh/site-functions/_grok" || true
91 "$pkgdir/usr/bin/grok" completions fish > "$pkgdir/usr/share/fish/vendor_completions.d/grok.fish" || true
92}
93

Changes since previous scan

--- PKGBUILD @ 2026-08-17 00:18
+++ PKGBUILD @ 2026-08-18 00:03
@@ -2,7 +2,7 @@
pkgname=grok-build-git
_pkgname=grok-build
-pkgver=r29.eb267fe
+pkgver=r33.d71f6e0
pkgrel=1
pkgdesc="SpaceXAI's coding agent harness and TUI. Fullscreen, mouse interactive, extensible."
arch=('x86_64' 'aarch64')

Scan history

Scanned at (UTC)SeverityRules
2026-08-18 00:03:42 MEDIUM 5
2026-08-17 21:39:22 MEDIUM 5
2026-08-17 21:37:43 HIGH 4
2026-08-17 00:18:29 MEDIUM 5
2026-08-16 00:03:42 MEDIUM 5
2026-08-15 15:33:54 MEDIUM 5
2026-08-15 15:30:38 HIGH 4

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion