ai-browser-git
maintainer zxp19821005
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The npm install runs in a controlled build environment on the project's own source from GitHub, with dependencies pinned or modified for compatibility; no untrusted external packages are added, and the install is part of building the application, not executing arbitrary 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-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 90%): The npm install runs in a controlled build environment on the project's own source from GitHub, with dependencies pinned or modified for compatibility; no untrusted external packages are added, and the install is part of building the application, not executing arbitrary code.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
npm/yarn/pnpm install of an undeclared external package
npm_install_external
Runs `npm/yarn/pnpm install <package>` for a package not in source=(), pulling unpinned, unreviewed code at build time. Severity downgraded: the package declares/looks like a Node.js consumer, where build-time installs are expected.
-
PKGBUILD:86
NODE_ENV=development npm add -D node-gyp
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2
pkgname=ai-browser-git
3
_pkgname=AI-Browser
4
pkgver=1.7.0.r0.gb9a08cc
5
_electronversion=42
6
_nodeversion=24
7
pkgrel=1
8
pkgdesc='Client app for ChatGPT, Gemini, Claude, Phind, Perplexity, Genspark and Google AI Studio with Monaco Editor integration.(Use system-wide electron)'
9
arch=('any')
10
url="https://jun-murakami.web.app/#aiBrowser"
11
_ghurl="https://github.com/Jun-Murakami/AI-Browser"
12
license=('MIT')
13
conflicts=("${pkgname%-git}")
14
provides=("${pkgname%-git}=${pkgver%.r*}")
15
depends=(
16
"electron${_electronversion}"
17
'python'
18
)
19
makedepends=(
20
'npm'
21
'git'
22
'nvm'
23
'gendesk'
24
'curl'
25
'jq'
26
)
27
source=(
28
"${pkgname%-git}.git::git+${_ghurl}.git"
29
"${pkgname%-git}.sh"
30
)
31
sha256sums=('SKIP'
32
'a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
33
pkgver() {
34
cd "${srcdir}/${pkgname%-git}.git"
35
set -o pipefail
36
git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
37
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
38
}
39
_ensure_local_nvm() {
40
local NVM_DIR="${srcdir}/.nvm"
41
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
42
nvm install "${_nodeversion}"
43
nvm use "${_nodeversion}"
44
}
45
_get_electron_version() {
46
_elec_ver=$(find "${srcdir}" -maxdepth 5 -name "package.json" ! -path "*/node_modules/*" \
47
-exec grep -l '"electron"' {} + | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null | head -1)
48
[[ -z "${_elec_ver}" ]] && return 1
49
echo -e "The electron version is: \033[1;31m${_elec_ver%%.*}\033[0m"
50
}
51
prepare() {
52
cd "${srcdir}/${pkgname%-git}.git"
53
_get_electron_version
54
sed -e "
55
s/@electronversion@/${_electronversion}/g
56
s/@appname@/${pkgname%-git}/g
57
s/@runname@/app.asar/g
58
s/@cfgdirname@/${pkgname%-git}/g
59
s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g
60
" -i "${srcdir}/${pkgname%-git}.sh"
61
gendesk -q -f -n \
62
--pkgname="${pkgname%-git}" \
63
--pkgdesc="${pkgdesc}" \
64
--categories="Utility" \
65
--name="${_pkgname}" \
66
--exec="${pkgname%-git} %U"
67
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
68
local HOME="${srcdir}/.electron-gyp"
69
export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
70
export NPM_CONFIG_MAXSOCKETS=32
71
if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
72
{
73
export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
74
export NPM_CONFIG_ELECTRON_MIRROR="https://registry.npmmirror.com/-/binary/electron/"
75
export NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"
76
}
77
find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
78
fi
79
_ensure_local_nvm
80
sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
81
# Remove existing node_modules and package-lock.json to ensure clean state
82
rm -rf node_modules package-lock.json
83
# Fix vite version in package.json for electron-vite@5.0.0 compatibility
84
sed -i 's/"vite": "\^8\.[0-9]*\.[0-9]*"/"vite": "^6.0.0"/g' package.json
85
sed -i 's/"@vitejs\/plugin-react": "\^6\.[0-9]*\.[0-9]*"/"@vitejs\/plugin-react": "^4.0.0"/g' package.json
86
NODE_ENV=development npm add -D node-gyp
87
NODE_ENV=development npm install --legacy-peer-deps
88
}
89
build() {
90
cd "${srcdir}/${pkgname%-git}.git"
91
_ensure_local_nvm
92
local electronDist="/usr/lib/electron${_electronversion}"
93
NODE_ENV=production NODE_OPTIONS="--max-old-space-size=4096" npm run build
94
NODE_ENV=production npm exec -c "electron-builder --linux dir -c.electronDist=${electronDist} --config electron-builder.yml"
95
case "${CARCH}" in
96
aarch64)
97
rm -rf "${srcdir}/${pkgname%-git}.git/dist/linux-"*"/resources/app.asar.unpacked/node_modules/@homebridge/node-pty-prebuilt-multiarch/prebuilds/"{linux-arm,linux-ia32,linux-x64}
98
;;
99
armv7h)
100
rm -rf "${srcdir}/${pkgname%-git}.git/dist/linux-"*"/resources/app.asar.unpacked/node_modules/@homebridge/node-pty-prebuilt-multiarch/prebuilds/"{linux-arm64,linux-ia32,linux-x64}
101
;;
102
i686)
103
rm -rf "${srcdir}/${pkgname%-git}.git/dist/linux-"*"/resources/app.asar.unpacked/node_modules/@homebridge/node-pty-prebuilt-multiarch/prebuilds/"{linux-arm*,linux-x64}
104
;;
105
x86_64)
106
rm -rf "${srcdir}/${pkgname%-git}.git/dist/linux-"*"/resources/app.asar.unpacked/node_modules/@homebridge/node-pty-prebuilt-multiarch/prebuilds/"{linux-arm*,linux-ia32}
107
;;
108
esac
109
}
110
package() {
111
install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
112
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
113
local _app_dir=$(find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -exec dirname {} + | head -n 1)
114
cp -a "${_app_dir}/resources/". "${pkgdir}/usr/lib/${pkgname%-git}/"
115
install -Dm644 "${srcdir}/${pkgname%-git}.git/resources/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
116
install -Dm644 "${srcdir}/${pkgname%-git}.git/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
117
install -Dm644 "${srcdir}/${pkgname%-git}.git/LICENSE.txt" -t "${pkgdir}/usr/share/licenses/${pkgname}"
118
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 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 |