python-mediapipe-git

maintainer Premik · 1 votes · scanned 2026-08-03 00:08:14.047287
MEDIUM
View on AUR ↗
Why flagged The PKGBUILD downloads a prebuilt Bazel binary from GitHub Releases (bazelbuild/bazel official releases) and executes it during the build. While bazelbuild/bazel on GitHub is the official upstream source, the download lacks any checksum verification (no sha256 in sources, uses wget directly in prepare()). This means a MITM or a compromised GitHub release could substitute a malicious binary that gets executed with build privileges. The binary is then used to drive the entire mediapipe build process. This is a genuine supply-chain concern: an unverified executable from a third-party host (even an official one) is executed as part of the build. The correct severity is medium — it's not clearly malicious (Bazel releases are legitimate), but the absence of integrity verification for an executed binary is a real risk that belongs in the medium category.

Triggered rules

MEDIUM AI review downgraded a static finding llm_review

The static rules flagged this HIGH, but an AI model (anthropic/claude-4.6-sonnet-20260217) reviewed the full PKGBUILD and judged it MEDIUM (confidence 82%): The PKGBUILD downloads a prebuilt Bazel binary from GitHub Releases (bazelbuild/bazel official releases) and executes it during the build. While bazelbuild/bazel on GitHub is the official upstream source, the download lacks any checksum verification (no sha256 in sources, uses wget directly in prepare()). This means a MITM or a compromised GitHub release could substitute a malicious binary that gets executed with build privileges. The binary is then used to drive the entire mediapipe build process. This is a genuine supply-chain concern: an unverified executable from a third-party host (even an official one) is executed as part of the build. The correct severity is medium — it's not clearly malicious (Bazel releases are legitimate), but the absence of integrity verification for an executed binary is a real risk that belongs in the medium category.

1 higher static finding superseded - not the current verdict (shown for transparency)
HIGH Downloaded file is executed download_then_exec

A file fetched with curl/wget (not part of source=(), so never checksum-verified) is later made executable or run — a fetch-and-execute pattern split across statements.

  • PKGBUILD:58 chmod +x ${srcdir}/bin/bazel

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: Premysl Srubar <premysl.srubar at gmail com>
2# Maintainer: Hu Butui <hot123tea123@gmail.com>
3
4pkgname=python-mediapipe-git
5pkgver=0.10.18.r137.0cd1f15d5
6pkgrel=1
7pkgdesc="A cross-platform, customizable ML solutions for live and streaming media"
8arch=('x86_64')
9url="https://github.com/google/mediapipe"
10license=("Apache-2.0")
11depends=(
12 absl-py
13 gcc-libs
14 glibc
15 libglvnd
16 opencv
17 opengl-driver
18 python-attrs
19 python-flatbuffers
20 python-matplotlib
21 python-numpy
22 python-opencv
23 python-pillow
24 python-protobuf
25 python-scipy
26 python-six
27 python-sounddevice
28 python-tensorflow
29)
30makedepends=(
31 git
32 patchelf
33 python-build
34 python-installer
35 python-setuptools
36 python-wheel
37 wget
38)
39provides=("${pkgname%-git}")
40conflicts=("${pkgname%-git}")
41
42source=("${pkgname}::git+https://github.com/google/mediapipe.git"
43 "0004-use-opencv4-headers.patch"
44)
45sha256sums=('SKIP'
46 '0f05849960ae21db7d3c1059f2c27a3358ba992f634a03b58b75b61f5031d345')
47
48pkgver() {
49 cd "${srcdir}/${pkgname}"
50 printf "%s" "$(git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g' | sed 's/^v//')"
51}
52
53prepare() {
54 # bazel in the ArchLinux is not working
55 mkdir -p ${srcdir}/bin
56 bazel_version=$(cat ${srcdir}/${pkgname}/.bazelversion)
57 wget https://github.com/bazelbuild/bazel/releases/download/${bazel_version}/bazel-${bazel_version}-linux-x86_64 -O ${srcdir}/bin/bazel
58 chmod +x ${srcdir}/bin/bazel
59 export PATH=${srcdir}/bin:${PATH}
60 bazel --version | sed 's/bazel //' > "${srcdir}/${pkgname}/.bazelversion"
61 cd "${srcdir}/${pkgname}"
62 patch -p1 -i "${srcdir}/0004-use-opencv4-headers.patch"
63 # set __version__
64 formatted_version=$(echo $pkgver | sed 's/^v//; s/r\([0-9]*\)\./post\1+/')
65 sed -i "s/^__version__ = .*/__version__ = '$formatted_version'/" setup.py
66 # sed -i "s/__version__ = 'dev'/__version__ = '$pkgver'/" setup.py
67 # set link_opencv to True
68 sed -i "s/self.link_opencv = False/self.link_opencv = True/g" setup.py
69}
70
71build() {
72 cd "${srcdir}/${pkgname}"
73 # enable building with GPU support, using opengl-driver
74 # opengl-driver is provided by mesa or nvidia-utils
75 MEDIAPIPE_DISABLE_GPU=0 \
76 python -m build --wheel --no-isolation
77}
78
79package() {
80 cd "${srcdir}/${pkgname}"
81 python -m installer --destdir="${pkgdir}" dist/*.whl
82 # remove rpath and fix permission
83 find ${pkgdir} -type f -name "*.so" -exec patchelf --remove-rpath {} \;
84 find ${pkgdir} -type f -name "*.so" -exec chmod 755 {} \;
85}
86# vim:set ts=2 sw=2 et:
87

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 MEDIUM 2
2026-08-02 00:16:08 MEDIUM 2
2026-08-01 00:11:18 MEDIUM 2
2026-07-31 00:14:10 MEDIUM 2
2026-07-30 00:17:23 MEDIUM 2
2026-07-29 00:25:53 MEDIUM 2
2026-07-28 00:07:28 MEDIUM 2
2026-07-27 00:24:32 MEDIUM 2
2026-07-26 00:07:32 MEDIUM 2
2026-07-25 00:13:44 MEDIUM 2
2026-07-24 00:02:28 MEDIUM 2
2026-07-23 00:14:47 MEDIUM 2
2026-07-22 00:29:32 MEDIUM 2
2026-07-21 00:24:15 MEDIUM 2
2026-07-20 00:19:49 MEDIUM 2
2026-07-19 00:17:08 MEDIUM 2
2026-07-18 00:14:48 MEDIUM 2
2026-07-17 00:06:16 MEDIUM 2
2026-07-16 00:05:41 MEDIUM 2
2026-07-15 00:09:25 MEDIUM 2

Report a package

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

0 / 4000
Your suggestion