musicfree-desktop-git

maintainer zxp19821005 · 0 votes · scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged The `npm add -D @electron-forge/plugin-local-electron` installs a well-known, official Electron Forge plugin from the npm registry. This is a legitimate, widely-used package maintained by the Electron Forge team (part of the electron-userland organization). It is being installed as a devDependency specifically to enable building against the system-installed Electron rather than downloading a bundled one — a common pattern in AUR PKGBUILDs that patch apps to use system Electron. While it is an undeclared external package not listed in the upstream package.json, it is not from an unofficial or personal host, and it is not executed at runtime. The supply-chain risk is the same as any other npm package install during build, which is standard practice. The PKGBUILD also uses nvm to manage Node versions and checks for CN geolocation to switch mirrors, which are unusual but not malicious patterns. Overall this is sloppy/non-standard packaging (undeclared build dependency, runtime geolocation check) but not a genuine security concern.

Triggered rules

LOW AI review downgraded a static finding llm_review

The static rules flagged this MEDIUM, but an AI model (anthropic/claude-4.6-sonnet-20260217) reviewed the full PKGBUILD and judged it LOW (confidence 80%): The `npm add -D @electron-forge/plugin-local-electron` installs a well-known, official Electron Forge plugin from the npm registry. This is a legitimate, widely-used package maintained by the Electron Forge team (part of the electron-userland organization). It is being installed as a devDependency specifically to enable building against the system-installed Electron rather than downloading a bundled one — a common pattern in AUR PKGBUILDs that patch apps to use system Electron. While it is an undeclared external package not listed in the upstream package.json, it is not from an unofficial or personal host, and it is not executed at runtime. The supply-chain risk is the same as any other npm package install during build, which is standard practice. The PKGBUILD also uses nvm to manage Node versions and checks for CN geolocation to switch mirrors, which are unusual but not malicious patterns. Overall this is sloppy/non-standard packaging (undeclared build dependency, runtime geolocation check) but not a genuine security concern.

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:85 NODE_ENV=development npm add -D @electron-forge/plugin-local-electron

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2pkgname=musicfree-desktop-git
3_pkgname=MusicFreeDesktop
4pkgver=0.0.8.r4.gf3b526a
5_electronversion=25
6_nodeversion=20
7pkgrel=1
8pkgdesc="Plug-in, customized, ad-free music player.(Use system-wide electron)插件化、定制化、无广告的免费音乐播放器"
9arch=('any')
10url="https://musicfree.catcat.work/"
11_ghurl="https://github.com/maotoumao/MusicFreeDesktop"
12_pluginurl="https://gitee.com/maotoumao/MusicFreePlugins/raw/master/plugins.json"
13license=('GPL-3.0-only')
14conflicts=("${pkgname%-git}")
15depends=(
16 "electron${_electronversion}"
17 'libvips'
18)
19makedepends=(
20 'gendesk'
21 'npm'
22 'nvm'
23 'git'
24 'curl'
25 'jq'
26)
27source=(
28 "${pkgname%-git}.git::git+${_ghurl}.git"
29 "${pkgname%-git}.sh"
30)
31options=(
32 '!emptydirs'
33)
34sha256sums=('SKIP'
35 '31ad33b633744f5361abd964be306cea53ae1050e760c787115f7eca60045ae6')
36pkgver() {
37 cd "${srcdir}/${pkgname%-git}.git"
38 set -o pipefail
39 git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
40 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
41}
42_ensure_local_nvm() {
43 local NVM_DIR="${srcdir}/.nvm"
44 source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
45 nvm install "${_nodeversion}"
46 nvm use "${_nodeversion}"
47}
48_get_electron_version() {
49 _elec_ver=$(jq -r '.devDependencies["electron"] // .dependencies["electron"]' "${srcdir}/${pkgname%-git}.git/package.json" | tr -d '^')
50 _main_ver=$(echo "${_elec_ver}" | cut -d. -f1)
51 echo -e "The electron version is: \033[1;31m${_main_ver}\033[0m"
52}
53prepare() {
54 cd "${srcdir}/${pkgname%-git}.git"
55 _get_electron_version
56 sed -i -e "
57 s/@electronversion@/${_electronversion}/g
58 s/@appname@/${pkgname%-git}/g
59 s/@runname@/app.asar/g
60 s/@cfgdirname@/${_pkgname%Desktop}/g
61 s/@options@//g
62 " "${srcdir}/${pkgname%-git}.sh"
63 gendesk -f -q -n \
64 --pkgname="${pkgname%-git}" \
65 --pkgdesc="${pkgdesc}" \
66 --categories="AudioVideo" \
67 --name="${_pkgname}" \
68 --exec="${pkgname%-git} %U"
69 export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
70 local HOME="${srcdir}/.electron-gyp"
71 export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
72 export NPM_CONFIG_MAXSOCKETS=32
73 if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
74 {
75 export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
76 export NPM_CONFIG_ELECTRON_MIRROR="https://registry.npmmirror.com/-/binary/electron/"
77 export NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"
78 }
79 find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
80 fi
81 _ensure_local_nvm
82 find src -type f -exec sed -i "s/process.resourcesPath/\'\/usr\/lib\/${pkgname%-git}\'/g" {} +
83 sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
84 NODE_ENV=development npm install --legacy-peer-deps
85 NODE_ENV=development npm add -D @electron-forge/plugin-local-electron
86}
87build() {
88 cd "${srcdir}/${pkgname%-git}.git"
89 _ensure_local_nvm
90 export ELECTRON_SKIP_BINARY_DOWNLOAD=1
91 local electronDist="/usr/lib/electron${_electronversion}"
92 sed -i -e "/^[[:space:]]*plugins:[[:space:]]*\[.*\$/a\\
93 {\\
94 name: \"@electron-forge/plugin-local-electron\",\\
95 config: {\\
96 electronPath: \"${electronDist}\"\\
97 }\\
98 }," forge.config.ts
99 NODE_ENV=production npm run package
100 find "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources/app/node_modules" -type d \( -name "darwin-*" -o -name "win32-*" \) -exec rm -rf {} +
101 case "${CARCH}" in
102 aarch64)
103 find "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources/app/node_modules" -type d -name "linux-x64" -exec rm -rf {} +
104 ;;
105 x86_64)
106 find "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources/app/node_modules" -type d -name "linux-arm64" -exec rm -rf {} +
107 ;;
108 esac
109}
110package() {
111 install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
112 install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
113 find "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources" -maxdepth 1 -type f -exec install -Dm644 -t "${pkgdir}/usr/lib/${pkgname%-git}" {} +
114 if find "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources" -mindepth 1 -maxdepth 1 -type d | read; then
115 for _subdir in "${srcdir}/${pkgname%-git}.git/out/${_pkgname%Desktop}-linux-"*"/resources/"*; do
116 if [ -d "${_subdir}" ]; then
117 cp -Pr --no-preserve=ownership "${_subdir}" "${pkgdir}/usr/lib/${pkgname%-git}"
118 fi
119 done
120 fi
121 install -Dm644 "${srcdir}/${pkgname%-git}.git/res/logo.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
122 install -Dm644 "${srcdir}/${pkgname%-git}.git/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
123}

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