balena-etcher
The npm install in build() is for the project's own dependencies in a subdirectory (sidecar), which is a normal part of building the application from source; the packages installed (etcher-sdk, ws, lodash) are legitimate and expected for the project.
Triggered rules
llm_review
An AI model (qwen/qwen3-235b-a22b-07-25) reviewed this and agrees it is LOW (confidence 95%): The npm install in build() is for the project's own dependencies in a subdirectory (sidecar), which is a normal part of building the application from source; the packages installed (etcher-sdk, ws, lodash) are legitimate and expected for the project.
1 higher static finding superseded - not the current verdict (shown for transparency)
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:61
npm install --no-package-lock --prefix . etcher-sdk ws lodash
PKGBUILD
1 offending line(s) highlighted# Maintainer: Matthew McGinn <mamcgi@gmail.com>
# Contributor: Håvard Pettersson <mail@haavard.me>
# Contributor: Andrew Stubbs <andrew.stubbs@gmail.com>
pkgname=balena-etcher
_pkgname=etcher
pkgver=2.1.6
pkgrel=1
pkgdesc='Flash OS images to SD cards & USB drives, safely and easily'
arch=('x86_64' 'i686' 'armv7h' 'aarch64')
_github_url='https://github.com/balena-io/etcher'
url='https://balena.io/etcher'
license=(Apache-2.0)
_electron=electron37
depends=("${_electron}" "nodejs-lts-jod")
makedepends=("npm" "python" 'jq' 'moreutils' 'python-setuptools' 'git')
optdepends=("libnotify: for notifications")
conflicts=("${_pkgname}"
"${_pkgname}-git"
"${_pkgname}-bin"
)
options=('!debug' '!strip')
source=("${_github_url}/archive/refs/tags/v${pkgver}.tar.gz"
"${pkgname}.desktop"
"${pkgname}"
"etcher-util"
'skip-build-util.patch'
)
sha256sums=('47e6539ddf8ce6f4ce49787fe9e0fc126b842b7d490eb5744f62d36284f422ce'
'6c5fb48aeb636272689c86d7cf9beea4515214636bc617a61c3e8387628b3415'
'7482eb18af030eb6d2b44850f23ecb99cd9198f642ac3b22b2f9f2ef0c8944d4'
'75ec686b0af8b6f744970cd5f1bfe4c62baf492215d14f43b87da3d492919680'
'a64369d70d41a3e9bed9d2260dedcaf76fceb8c654dbf8b6eee947785de2ae45')
prepare() {
cd "${_pkgname}-${pkgver}"
patch --strip=1 <${srcdir}/skip-build-util.patch
local electronDist="/usr/lib/${_electron}"
local electronVersion="$(<$electronDist/version)"
jq ".devDependencies.electron = \"$electronVersion\"" package.json | sponge package.json
jq ".build.electronDist = \"$electronDist\"" package.json | sponge package.json
jq ".build.electronVersion = \"$electronVersion\"" package.json | sponge package.json
sed -i lib/gui/etcher.ts -e "s|process.resourcesPath|'/usr/lib/${pkgname}'|"
sed -i ${srcdir}/${pkgname} -e "s|__ELECTRON__|${_electron}|"
sed -i "/elevated = 'refused';/d" lib/shared/sudo/linux.ts
}
build() {
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export HOME="${srcdir}"
export NODE_OPTIONS=--stack-trace-limit=50
# skip download of node headers
export npm_config_nodedir=/usr/
cd "${_pkgname}-${pkgver}"
unset MAKEFLAGS
npm install --no-package-lock
npm run package
# node_modules for our etcher-util wrapper
cd "out/sidecar/src"
npm install --no-package-lock --prefix . etcher-sdk ws lodash
}
__clean_modules() {
local __arch_remove
__arch_remove=arm64
if [[ "$CARCH" == "aarch64" ]]; then
__arch_remove=x64
fi
cd "${pkgdir}/usr/lib/${pkgname}/utils/node_modules"
rm -rf {drivelist,mountutils,xxhash-addon}/build/{config.gypi,Makefile,*.mk,Release/{obj.target,.deps,*.a}}
rm -rf lzma-native/prebuilds/{darwin-{arm64,x64},win32-{ia32,x64},linux-${__arch_remove}}
rm -rf drivelist/node-addon-api/nothing.target.mk
rm -rf usb/prebuilds/{android,win32,darwin}-*
case $CARCH in
x86_64)
rm -rf usb/prebuilds/linux-{arm*,ia32}
;;
i386)
rm -rf usb/prebuilds/linux-{arm*,x64}
;;
aarch64)
rm -rf usb/prebuilds/linux-{arm,x64,ia32}
;;
armv7h)
rm -rf usb/prebuilds/linux-{arm64,x64,ia32,arm/node.napi.armv6.node}
;;
esac
}
package() {
cd "${_pkgname}-${pkgver}"
_appdir="${pkgdir}/usr/lib/${pkgname}"
install -d "${_appdir}"
cp -a out/balenaEtcher-linux-*/resources/* "${_appdir}"
cp -a out/sidecar/src "${_appdir}/utils"
install -Dm755 ${srcdir}/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
install -Dm755 ${srcdir}/etcher-util "${_appdir}"
install -Dm644 "${srcdir}/${pkgname}.desktop" \
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
for size in 16x16 32x32 48x48 128x128 256x256 512x512; do
install -Dm644 "assets/iconset/${size}.png" \
"${pkgdir}/usr/share/icons/hicolor/${size}/apps/${pkgname}.png"
done
__clean_modules
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 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 00:23:45 | Low | 2 |