bilive-danmaku-git

LOW
maintainer zxp19821005 0 votes scanned 2026-11-01 00:21:48.120785
View on AUR
Why flagged

The npx execution in the build() function runs 'ts-node' and 'electron-builder' on the project's own source code, which is a standard part of building a Node.js/Electron application from its own repository, posing no remote code execution risk.

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 90%): The npx execution in the build() function runs 'ts-node' and 'electron-builder' on the project's own source code, which is a standard part of building a Node.js/Electron application from its own repository, posing no remote code execution risk.

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:100 npx ts-node ./.erb/scripts/clean.js dist

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=bilive-danmaku-git
3pkgver=1.0.11.r0.g5861f8e
4_electronversion=26
5_nodeversion=18
6pkgrel=1
7pkgdesc="Bilibili live danmaku client.一个开源的 bilibili 直播弹幕姬."
8arch=('any')
9url="https://github.com/Beats0/bilive-danmaku"
10license=('MIT')
11conflicts=("${pkgname%-git}")
12provides=("${pkgname%-git}=${pkgver%.r*}")
13depends=(
14 "electron${_electronversion}-bin"
15)
16makedepends=(
17 'npm'
18 'git'
19 'nvm'
20 'gendesk'
21 'jq'
22)
23source=(
24 "${pkgname%-git}.git::git+${url}.git"
25 "${pkgname%-git}.sh"
26)
27sha256sums=('SKIP'
28 'dfcd6603d29c7b8d88e019b517a2e5c1a7b5ab905a0961a8b81adfa508b258b8')
29_get_project_dir() {
30 local d
31 while IFS= read -r d; do
32 find "$d" -name "package.json" ! -path "*/node_modules/*" 2>/dev/null | grep -q . && { echo "$d"; return; }
33 done < <(find "${srcdir}" -maxdepth 1 -mindepth 1 -type d ! -name '.*')
34}
35pkgver() {
36 cd "$(_get_project_dir)"
37 set -o pipefail
38 git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
39 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
40}
41_ensure_local_nvm() {
42 local NVM_DIR="${srcdir}/.nvm"
43 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
44 nvm install "${_nodeversion}"
45 nvm use "${_nodeversion}"
46}
47_get_app_dir() {
48 find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -print 2>/dev/null | while read f; do [ -d "${f%/*}/resources" ] && echo "${f%/*}" && break; done
49}
50_get_electron_version() {
51 _elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \
52 | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \
53 | grep -oE '[0-9]+' | head -1)
54 [[ -z "${_elec_ver}" ]] && return 1
55 (( _elec_ver == _electronversion )) && c=32 || c=31
56 echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m"
57}
58_set_build_env() {
59 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
60 export ELECTRON_OVERRIDE_DIST_PATH="${ELECTRON_DIST}"
61 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
62 export ELECTRON_BUILDER_OFFLINE=true
63 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/^v//')"
64 export HOME="${srcdir}/.home"
65 export XDG_CACHE_HOME="${HOME}/.cache"
66 export XDG_CONFIG_HOME="${HOME}/.config"
67 export XDG_DATA_HOME="${HOME}/.local/share"
68 export npm_config_cache="${HOME}/.npm_cache"
69 export COREPACK_NPM_REGISTRY="${COREPACK_NPM_REGISTRY:-${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org}}"
70 export COREPACK_HOME="${HOME}/.corepack"
71 export npm_config_audit=false
72 export npm_config_registry="${NPM_CONFIG_REGISTRY:-${npm_config_registry:-https://registry.npmjs.org}}"
73 mkdir -p "${HOME}" "${npm_config_cache}" "${COREPACK_HOME}"
74}
75prepare() {
76 cd "$(_get_project_dir)"
77 _get_electron_version
78 sed -i -e "
79 s/@electronversion@/${_electronversion}/g
80 s/@appname@/${pkgname%-git}/g
81 " "${srcdir}/${pkgname%-git}.sh"
82 gendesk -q -f -n \
83 --pkgname="${pkgname%-git}" \
84 --pkgdesc="${pkgdesc}" \
85 --categories="Utility" \
86 --name="${pkgname%-git}" \
87 --exec="${pkgname%-git} %U"
88 _ensure_local_nvm
89 _set_build_env
90 find src -type f -exec sed -i "s/process.resourcesPath/\'\/usr\/lib\/${pkgname%-git}\'/g" {} +
91 jq --arg ver "${SYSTEM_ELECTRON_VERSION}" '.devDependencies.electron = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
92 export NODE_ENV=development
93 npm install --legacy-peer-deps
94}
95build() {
96 cd "$(_get_project_dir)"
97 _ensure_local_nvm
98 _set_build_env
99 export NODE_ENV=production
100 npx ts-node ./.erb/scripts/clean.js dist
101 npm run build
102 npm exec -c "electron-builder --linux dir -c.electronDist=${ELECTRON_DIST}"
103}
104package() {
105 install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
106 install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
107 rm -rf "$(_get_app_dir)/resources/default_app.asar"
108 cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"
109 _icon_sizes=(16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 1024x1024)
110 for _icons in "${_icon_sizes[@]}";do
111 install -Dm644 "$(_get_project_dir)/assets/icons/${_icons}.png" \
112 "${pkgdir}/usr/share/icons/hicolor/${_icons}/apps/${pkgname%-git}.png"
113 done
114 install -Dm644 "$(_get_project_dir)/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
115 install -Dm644 "$(_get_project_dir)/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
116}
117

Scan history

Scanned at (UTC)SeverityRules
2026-11-01 00:21:48 Low 2
2026-10-31 00:07:41 Low 2
2026-10-30 00:29:30 Low 2
2026-10-29 00:13:55 Low 2
2026-10-28 00:06:54 Low 2
2026-10-27 00:23:28 Low 2
2026-10-26 00:12:40 Low 2
2026-10-25 00:20:48 Low 2
2026-10-24 00:14:55 Low 2
2026-10-23 00:02:19 Low 2
2026-10-22 00:13:10 Low 2
2026-10-21 00:12:50 Low 2
2026-10-20 00:10:31 Low 2
2026-10-19 00:03:55 Low 2
2026-10-18 00:06:55 Low 2
2026-10-17 00:21:55 Low 2
2026-10-16 00:12:47 Low 2
2026-10-15 00:28:05 Low 2
2026-10-14 00:06:47 Low 2
2026-10-13 09:16:20 Medium 1

Report a package

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

0 / 4000
Your suggestion