ai-gate

maintainer zxp19821005 · 1 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The npx commands in the build() function are used to run TypeScript compilers and electron-builder on the project's own source code, which is fetched from the official GitHub repository; this is standard build tooling, not execution of untrusted remote code.

Triggered rules

LOW AI review downgraded a static finding llm_review

The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The npx commands in the build() function are used to run TypeScript compilers and electron-builder on the project's own source code, which is fetched from the official GitHub repository; this is standard build tooling, not execution of untrusted remote code.

1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM npx/bunx/deno executes a remote package remote_code_tool

`npx`/`bunx`/`pnpm dlx`/`deno run <url>` downloads AND runs a remote package at build time — the moral equivalent of piping a download into a shell. Severity downgraded: Node.js consumer context.

  • PKGBUILD:88 npx tsc -p tsconfig.electron.json
  • PKGBUILD:89 npx tsc -p tsconfig.preload.json

PKGBUILD

2 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=ai-gate
3_pkgname='AI Gate'
4pkgver=4.7.1
5_electronversion=34
6_nodeversion=20
7pkgrel=1
8pkgdesc="A single gateway to ChatGPT, Gemini, Claude, Grok, Perplexity and more.(Use system-wide electron)"
9arch=('any')
10url="https://aigate.inulute.com/"
11_ghurl="https://github.com/inulute/ai-gate"
12license=('GPL-3.0-only')
13conflicts=("${pkgname}")
14depends=(
15 "electron${_electronversion}"
16)
17makedepends=(
18 'gendesk'
19 'npm'
20 'nvm'
21 'curl'
22 'jq'
23 'git'
24)
25source=(
26 "${pkgname}-${pkgver}::git+${_ghurl}#tag=v${pkgver}"
27 "${pkgname}.sh"
28)
29sha256sums=('c34bd641a30d556250b16b798fea86c43eb378a78f0c3bad8718996ca40555db'
30 'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
31_ensure_local_nvm() {
32 local NVM_DIR="${srcdir}/.nvm"
33 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
34 nvm install "${_nodeversion}"
35 nvm use "${_nodeversion}"
36}
37_get_app_dir() {
38 find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
39}
40_get_electron_version() {
41 _elec_ver=$(find "${srcdir}" -maxdepth 5 -name "package.json" ! -path "*/node_modules/*" \
42 -exec grep -l '"electron"' {} + | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null | head -1)
43 [[ -z "${_elec_ver}" ]] && return 1
44 echo -e "The electron version is: \033[1;31m${_elec_ver%%.*}\033[0m"
45}
46_set_build_env() {
47 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
48 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
49 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
50 export HOME="${srcdir}/.electron-gyp"
51 export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
52 export NPM_CONFIG_MAXSOCKETS=32
53 if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
54 {
55 export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
56 export NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
57 export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
58 export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
59 }
60 find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
61 fi
62}
63prepare() {
64 cd "${srcdir}/${pkgname}-${pkgver}"
65 _get_electron_version
66 sed -i -e "
67 s/@electronversion@/${_electronversion}/g
68 s/@appname@/${pkgname}/g
69 s/@runname@/app.asar/g
70 s/@cfgdirname@/${pkgname}/g
71 s/@options@//g
72 " "${srcdir}/${pkgname}.sh"
73 gendesk -q -f -n \
74 --pkgname="${pkgname}" \
75 --pkgdesc="${pkgdesc}" \
76 --categories="Utility" \
77 --name="${_pkgname}" \
78 --exec="${pkgname} %U"
79 _set_build_env
80 _ensure_local_nvm
81 sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
82 NODE_ENV=development npm install --leagcy-peer-deps
83}
84build() {
85 cd "${srcdir}/${pkgname}-${pkgver}"
86 _set_build_env
87 _ensure_local_nvm
88 npx tsc -p tsconfig.electron.json
89 npx tsc -p tsconfig.preload.json
90 NODE_ENV=production npm run build
91 NODE_ENV=production npm exec -c "electron-builder --linux dir -c.electronDist=${ELECTRON_DIST}"
92}
93package() {
94 install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
95 install -Dm755 -d "${pkgdir}/usr/lib/${pkgname}"
96 local _app_dir=$(_get_app_dir)
97 cp -a "${_app_dir}/resources/". "${pkgdir}/usr/lib/${pkgname}/"
98 install -Dm644 "${srcdir}/${pkgname}-${pkgver}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
99 install -Dm644 "${srcdir}/${pkgname}-${pkgver}/icons/png/favicon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
100 install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
101}
102

Scan history

Scanned at (UTC)SeverityRules
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

Report a package

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

0 / 4000
Your suggestion