hihat

maintainer zxp19821005 · 0 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The npx command runs a local build script (ts-node) from the project's own source after npm install, not an arbitrary remote package; this is a standard part of building the project and does not introduce untrusted remote code execution.

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 npx command runs a local build script (ts-node) from the project's own source after npm install, not an arbitrary remote package; this is a standard part of building the project and does not introduce untrusted remote code execution.

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:89 NODE_ENV=production npx ts-node ./.erb/scripts/clean.js dist

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=hihat
3pkgver=2.3.6
4_electronversion=42
5_nodeversion=24
6pkgrel=1
7pkgdesc="A minimalist offline music library player for desktop, built on Electron, React, and Material UI.Use system-wide electron."
8arch=('any')
9url="https://github.com/johnnyshankman/hihat"
10license=('MIT')
11depends=(
12 "electron${_electronversion}"
13)
14makedepends=(
15 'gendesk'
16 'git'
17 'nvm'
18 'npm'
19 'curl'
20 'jq'
21)
22source=("${pkgname}.sh")
23sha256sums=('a774c2f54fbbeeaac3cefc0f7250796d30c86d27f0fd40b7eaf9c0fdb021623d')
24_ensure_local_nvm() {
25 local NVM_DIR="${srcdir}/.nvm"
26 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
27 nvm install "${_nodeversion}"
28 nvm use "${_nodeversion}"
29}
30_get_app_dir() {
31 find "${srcdir}" -type f -name "resources.pak" -exec dirname {} + | head -n 1
32}
33_set_build_env() {
34 export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
35 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
36 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
37 export HOME="${srcdir}/.electron-gyp"
38 export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
39 export NPM_CONFIG_MAXSOCKETS=32
40 if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
41 {
42 export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
43 export NODEJS_ORG_MIRROR="https://npmmirror.com/mirrors/node"
44 export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
45 export ELECTRON_BUILDER_BINARIES_MIRROR="https://npmmirror.com/mirrors/electron-builder-binaries/"
46 }
47 find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
48 fi
49}
50_get_electron_version() {
51 _elec_ver=$(find "${srcdir}" -maxdepth 5 -name "package.json" ! -path "*/node_modules/*" \
52 -exec grep -l '"electron"' {} + | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null | head -1)
53 [[ -z "${_elec_ver}" ]] && return 1
54 echo -e "The electron version is: \033[1;31m${_elec_ver%%.*}\033[0m"
55}
56prepare() {
57 cd "${srcdir}"
58 if [[ ! -d "${srcdir}/${pkgname}-${pkgver}" ]]; then
59 git clone \
60 --depth 1 \
61 --branch "${pkgver}" \
62 "${url}" \
63 "${pkgname}-${pkgver}"
64 fi
65 cd "${srcdir}/${pkgname}-${pkgver}"
66 _get_electron_version
67 sed -i -e "
68 s/@electronversion@/${_electronversion}/g
69 s/@appname@/${pkgname}/g
70 s/@runname@/app.asar/g
71 s/@cfgdirname@/${pkgname}/g
72 " "${srcdir}/${pkgname}.sh"
73 gendesk -q -f -n \
74 --pkgname="${pkgname}" \
75 --pkgdesc="${pkgdesc}" \
76 --categories="AudioVideo" \
77 --name="${pkgname}" \
78 --exec="${pkgname} %U"
79 _set_build_env
80 _ensure_local_nvm
81 find src -type f -exec sed -i "s/process.resourcesPath/\'\/usr\/lib\/${pkgname%-git}\'/g" {} +
82 sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
83 NODE_ENV=development npm install --legacy-peer-deps
84}
85build() {
86 cd "${srcdir}/${pkgname}-${pkgver}"
87 _set_build_env
88 _ensure_local_nvm
89 NODE_ENV=production npx ts-node ./.erb/scripts/clean.js dist
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}/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
99 install -Dm644 "${srcdir}/${pkgname}-${pkgver}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
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