python-mediapipe

MEDIUM
maintainer hottea 1 votes scanned 2026-09-17 00:27:14.276658
View on AUR
Why flagged

The PKGBUILD downloads a Bazel binary at build time from the official GitHub releases page (github.com/bazelbuild/bazel) using a version pinned by the upstream source's .bazelversion file, then executes it. This is a common workaround for Arch Linux's Bazel packaging issues and is seen in several legitimate AUR packages (e.g., tensorflow, etc.). The binary is fetched from the official bazelbuild GitHub releases, not an attacker-controlled host. However, the downloaded binary is not checksummed or verified in any way (no sha256sum check, no GPG verification), which is a genuine supply-chain concern: if the GitHub release were compromised or the download intercepted (MITM), an arbitrary binary would be executed with the user's privileges during the build. This is not clearly malicious intent, but it is a real medium-severity supply-chain risk due to the unverified execution of a downloaded binary. The rest of the PKGBUILD is straightforward: patches local source, builds a Python wheel, installs it.

Triggered rules

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 75%): The PKGBUILD downloads a Bazel binary at build time from the official GitHub releases page (github.com/bazelbuild/bazel) using a version pinned by the upstream source's .bazelversion file, then executes it. This is a common workaround for Arch Linux's Bazel packaging issues and is seen in several legitimate AUR packages (e.g., tensorflow, etc.). The binary is fetched from the official bazelbuild GitHub releases, not an attacker-controlled host. However, the downloaded binary is not checksummed or verified in any way (no sha256sum check, no GPG verification), which is a genuine supply-chain concern: if the GitHub release were compromised or the download intercepted (MITM), an arbitrary binary would be executed with the user's privileges during the build. This is not clearly malicious intent, but it is a real medium-severity supply-chain risk due to the unverified execution of a downloaded binary. The rest of the PKGBUILD is straightforward: patches local source, builds a Python wheel, installs it.

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: robertfoster
2# Maintainer: Hu Butui <hot123tea123@gmail.com>
3
4_pkgname=mediapipe
5pkgname=python-mediapipe # renovate: datasource=github-tags depName=google-ai-edge/mediapipe
6pkgver=1.0.0
7pkgrel=1
8pkgdesc="A cross-platform, customizable ML solutions for live and streaming media"
9arch=('x86_64')
10url="https://github.com/google-ai-edge/mediapipe"
11license=("Apache-2.0")
12depends=(
13 absl-py
14 gcc-libs
15 glibc
16 libglvnd
17 opencv
18 opengl-driver
19 python-attrs
20 python-flatbuffers
21 python-matplotlib
22 python-numpy
23 python-opencv
24 python-pillow
25 python-protobuf
26 python-scipy
27 python-six
28 python-sounddevice
29 python-tensorflow
30)
31makedepends=(
32 patchelf
33 python-build
34 python-installer
35 python-setuptools
36 python-wheel
37 wget
38)
39
40source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/google-ai-edge/mediapipe/archive/refs/tags/v${pkgver}.tar.gz"
41 "0004-use-opencv-headers.patch"
42 "0005-set-hermetic-python-version-and-disable-odml-converter.patch"
43 "0006-opencv5-geometry-header.patch"
44 "0007-bump-rules-java.patch"
45)
46sha256sums=('6343314dad0f4112610807ca723eee63feea00711dc2be9360928b6f0a5eba12'
47 'd18e88a217a00dc77cf2bfaa1d33b5fbc912deed5df686b0d2455fb0db75a677'
48 '62cbd43346e7a7705127656a74bec44852e5bbfc006c4723005fdd23af5258db'
49 'fb082d88d9cca47534ae01fca676a3afdb909bfc82d52c97cf0eaedf34571d5f'
50 'bdead49ac5370dc84d9facee962bf2def5d9055d7339a37b2ba3f3b4bb02f811')
51
52
53prepare() {
54 # bazel in the ArchLinux is not working
55 mkdir -p ${srcdir}/bin
56 bazel_version=$(cat ${srcdir}/${_pkgname}-${pkgver}/.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 cd "${srcdir}/${_pkgname}-${pkgver}"
61 patch -p1 -i "${srcdir}/0004-use-opencv-headers.patch"
62 patch -p1 -i "${srcdir}/0005-set-hermetic-python-version-and-disable-odml-converter.patch"
63 patch -p1 -i "${srcdir}/0006-opencv5-geometry-header.patch"
64 patch -p1 -i "${srcdir}/0007-bump-rules-java.patch"
65 # set __version__
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}-${pkgver}"
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 #$(readlink -f /usr/bin/python) -m build --wheel --no-isolation
78}
79
80package() {
81 cd "${srcdir}/${_pkgname}-${pkgver}"
82 python -m installer --destdir="${pkgdir}" dist/*.whl
83 # remove rpath and fix permission
84 find ${pkgdir} -type f -name "*.so" -exec patchelf --remove-rpath {} \;
85 find ${pkgdir} -type f -name "*.so" -exec chmod 755 {} \;
86}
87# vim:set ts=2 sw=2 et:
88

Scan history

Scanned at (UTC)SeverityRules
2026-09-17 00:27:14 Medium 2
2026-09-16 00:03:17 Medium 2
2026-09-15 00:25:31 Medium 2
2026-09-14 00:27:57 Medium 2
2026-09-13 00:19:54 Medium 2
2026-09-12 00:25:17 Medium 2
2026-09-11 00:19:22 Medium 2
2026-09-10 00:22:44 Medium 2
2026-09-09 00:04:09 Medium 2
2026-09-08 00:18:08 Medium 2
2026-09-07 00:30:15 Medium 2
2026-09-06 00:17:06 Medium 2
2026-09-05 00:16:27 Medium 2
2026-09-04 00:03:13 Medium 2
2026-09-03 00:15:47 Medium 2
2026-09-02 00:02:31 Medium 2
2026-09-01 00:11:19 Medium 2
2026-08-31 00:19:57 Medium 2
2026-08-30 07:44:18 Medium 2
2026-08-30 07:41:46 High 1

Report a package

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

0 / 4000
Your suggestion