simpleshell-git
The npx command runs electron-forge package, which is a standard build tool for Electron apps, and operates only on the locally checked-out project source; no untrusted remote code is executed.
Triggered rules
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 command runs electron-forge package, which is a standard build tool for Electron apps, and operates only on the locally checked-out project source; no untrusted remote code is executed.
1 higher static finding superseded - not the current verdict (shown for transparency)
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:126
npx electron-forge package
PKGBUILD
1 offending line(s) highlighted# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=simpleshell-git
_pkgname=SimpleShell
pkgver=0.5.4.r0.g981e310
_electronversion=40
_nodeversion=22
pkgrel=1
pkgdesc="A modern, feature-rich SSH terminal application that combines the power of Electron's desktop capabilities with React's intuitive development experience. Designed for developers and system administrators who need efficient remote server management."
arch=('any')
url="https://github.com/funkpopo/simpleshell"
license=('Apache-2.0')
provides=("${pkgname%-git}=${pkgver%.r*}")
conflicts=("${pkgname%-git}")
depends=(
"electron${_electronversion}"
)
makedepends=(
'nvm'
'git'
'gendesk'
'npm'
'jq'
'zip'
'rustup'
)
source=(
"${pkgname//-/.}::git+${url}.git"
"${pkgname%-git}.sh"
)
sha256sums=('SKIP'
'dfcd6603d29c7b8d88e019b517a2e5c1a7b5ab905a0961a8b81adfa508b258b8')
_get_project_dir() {
local d
while IFS= read -r d; do
find "$d" -name "package.json" ! -path "*/node_modules/*" 2>/dev/null | grep -q . && { echo "$d"; return; }
done < <(find "${srcdir}" -maxdepth 1 -mindepth 1 -type d ! -name '.*')
}
pkgver() {
cd "$(_get_project_dir)"
set -o pipefail
git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
_ensure_local_nvm() {
local NVM_DIR="${srcdir}/.nvm"
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
nvm install "${_nodeversion}"
nvm use "${_nodeversion}"
}
_get_app_dir() {
find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -printf '%h\n' 2>/dev/null \
| while read -r d; do [[ -d "${d}/resources" ]] && { echo "$d"; return 0; }; done
}
_get_electron_version() {
_elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \
| xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \
| grep -oE '[0-9]+' | head -1)
[[ -z "${_elec_ver}" ]] && return 1
(( _elec_ver == _electronversion )) && c=32 || c=31
echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m"
}
_set_build_env() {
export ELECTRON_DIST="/usr/lib/electron${_electronversion}"
export ELECTRON_OVERRIDE_DIST_PATH="${ELECTRON_DIST}"
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
export ELECTRON_BUILDER_OFFLINE=true
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/^v//')"
export HOME="${srcdir}/.home"
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_DATA_HOME="${HOME}/.local/share"
export npm_config_cache="${HOME}/.npm_cache"
export COREPACK_NPM_REGISTRY="${COREPACK_NPM_REGISTRY:-${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org}}"
export COREPACK_HOME="${HOME}/.corepack"
export npm_config_audit=false
export npm_config_registry="${NPM_CONFIG_REGISTRY:-${npm_config_registry:-https://registry.npmjs.org}}"
export CARGO_HOME="${HOME}/.cargo"
export CARGO_NET_GIT_FETCH_WITH_CLI=true
export CARGO_NET_RETRY=5
export CARGO_HTTP_MULTIPLEXING=false
export CARGO_INCREMENTAL=0
export CARGO_TERM_COLOR=never
export CARGO_PROFILE_RELEASE_STRIP=symbols
mkdir -p "${HOME}" "${npm_config_cache}" "${COREPACK_HOME}" "${CARGO_HOME}"
}
_use_local_electron_for_forge() {
local _arch=$([[ "${CARCH}" == "aarch64" ]] && echo arm64 || [[ "${CARCH}" == "armv7h" ]] && echo armv7l || echo x64)
local _zd="${srcdir}/electron-zips"
local _zf="${_zd}/electron-v${SYSTEM_ELECTRON_VERSION}-linux-${_arch}.zip"
mkdir -p "${_zd}"
rm -f "${_zf}"
( cd "${ELECTRON_DIST}" && find . $ -type f -o -type l $ -readable -print | zip -@ -0 -q -y "${_zf}" )
[[ -s "${_zf}" ]] || { echo "ERROR: Failed to generate electron zip (directory not readable?)"; return 1; }
find . -name "forge.config.*" ! -path "*/node_modules/*" -print0 | while IFS= read -r -d '' _cfg; do
sed -i "/packagerConfig:[[:space:]]*{/a\\ electronZipDir: '${_zd}'," "${_cfg}"
done
}
prepare() {
cd "$(_get_project_dir)"
_get_electron_version
sed -i -e "
s/@electronversion@/${_electronversion}/g
s/@appname@/${pkgname%-git}/g
" "${srcdir}/${pkgname%-git}.sh"
gendesk -q -f -n \
--pkgname="${pkgname%-git}" \
--pkgdesc="${pkgdesc}" \
--categories="Utility" \
--name="${_pkgname}" \
--exec="${pkgname%-git} %U"
_ensure_local_nvm
_set_build_env
jq --arg ver "${SYSTEM_ELECTRON_VERSION}" '.devDependencies.electron = $ver' package.json > package.json.tmp && mv package.json.tmp package.json
rustup update stable
rustup default stable
export NODE_ENV=development
npm install
_use_local_electron_for_forge
}
build() {
cd "$(_get_project_dir)"
_ensure_local_nvm
_set_build_env
export NODE_ENV=production
npm run prepare:native-services
npx electron-forge package
}
package() {
install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}"
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"
rm -rf "$(_get_app_dir)/resources/default_app.asar"
cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"
install -Dm644 "$(_get_project_dir)/src/renderer/assets/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"
install -Dm644 "$(_get_project_dir)/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"
install -Dm644 "$(_get_project_dir)/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
Changes since previous scan
--- PKGBUILD @ 2026-10-14 00:06+++ PKGBUILD @ 2026-10-24 00:14@@ -1,7 +1,7 @@ # Maintainer: zxp19821005 <zxp19821005 at 163 dot com> pkgname=simpleshell-git _pkgname=SimpleShell-pkgver=0.5.3.r1.g6f5e160+pkgver=0.5.4.r0.g981e310 _electronversion=40 _nodeversion=22 pkgrel=1@@ -28,7 +28,7 @@ "${pkgname%-git}.sh" ) sha256sums=('SKIP'- 'cebedc3391cbab6d43f37fbf3a87ddaad16597cb5ea487a4d55b1f478d810082')+ 'dfcd6603d29c7b8d88e019b517a2e5c1a7b5ab905a0961a8b81adfa508b258b8') _get_project_dir() { local d while IFS= read -r d; do@@ -48,7 +48,16 @@ nvm use "${_nodeversion}" } _get_app_dir() {- 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+ find "${srcdir}" -type f -name "resources.pak" ! -path "*/node_modules/*" -printf '%h\n' 2>/dev/null \+ | while read -r d; do [[ -d "${d}/resources" ]] && { echo "$d"; return 0; }; done+}+_get_electron_version() {+ _elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \+ | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \+ | grep -oE '[0-9]+' | head -1)+ [[ -z "${_elec_ver}" ]] && return 1+ (( _elec_ver == _electronversion )) && c=32 || c=31+ echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m" } _set_build_env() { export ELECTRON_DIST="/usr/lib/electron${_electronversion}"@@ -74,24 +83,14 @@ export CARGO_PROFILE_RELEASE_STRIP=symbols mkdir -p "${HOME}" "${npm_config_cache}" "${COREPACK_HOME}" "${CARGO_HOME}" }-_get_electron_version() {- _elec_ver=$(find "$(_get_project_dir)" -name "package.json" ! -path "*/node_modules/*" -print \- | xargs -I{} jq -r '(.devDependencies.electron // .dependencies.electron) // empty' {} 2>/dev/null \- | grep -oE '[0-9]+' | head -1)- [[ -z "${_elec_ver}" ]] && return 1- (( _elec_ver == _electronversion )) && c=32 || c=31- echo -e "Electron version: \033[1;${c}m${_elec_ver}$([[ $c -eq 31 ]] && echo " (expected ${_electronversion})")\033[0m"-} _use_local_electron_for_forge() {- local _v="${SYSTEM_ELECTRON_VERSION}"+ local _arch=$([[ "${CARCH}" == "aarch64" ]] && echo arm64 || [[ "${CARCH}" == "armv7h" ]] && echo armv7l || echo x64) local _zd="${srcdir}/electron-zips"- case "${CARCH}" in- aarch64) _arch=arm64 ;;- x86_64) _arch=x64 ;;- esac- local _zf="${_zd}/electron-v${_v}-linux-${_arch}.zip"- install -Dm755 -d "${_zd}"- ( cd "${ELECTRON_DIST}" && zip -r -q -0 "${_zf}" . )+ local _zf="${_zd}/electron-v${SYSTEM_ELECTRON_VERSION}-linux-${_arch}.zip"+ mkdir -p "${_zd}"+ rm -f "${_zf}"+ ( cd "${ELECTRON_DIST}" && find . $ -type f -o -type l $ -readable -print | zip -@ -0 -q -y "${_zf}" )+ [[ -s "${_zf}" ]] || { echo "ERROR: Failed to generate electron zip (directory not readable?)"; return 1; } find . -name "forge.config.*" ! -path "*/node_modules/*" -print0 | while IFS= read -r -d '' _cfg; do sed -i "/packagerConfig:[[:space:]]*{/a\\ electronZipDir: '${_zd}'," "${_cfg}" done@@ -102,7 +101,6 @@ sed -i -e " s/@electronversion@/${_electronversion}/g s/@appname@/${pkgname%-git}/g- s/@runname@/app.asar/g " "${srcdir}/${pkgname%-git}.sh" gendesk -q -f -n \ --pkgname="${pkgname%-git}" \@@ -130,10 +128,10 @@ package() { install -Dm755 "${srcdir}/${pkgname%-git}.sh" "${pkgdir}/usr/bin/${pkgname%-git}" install -Dm755 -d "${pkgdir}/usr/lib/${pkgname%-git}"- local _app_dir="$(_get_app_dir)"- cp -a "${_app_dir}/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"- local _src="$(_get_project_dir)"- install -Dm644 "${_src}/src/renderer/assets/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"- install -Dm644 "${_src}/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"- install -Dm644 "${_src}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"+ rm -rf "$(_get_app_dir)/resources/default_app.asar"+ cp -a "$(_get_app_dir)/resources/." "${pkgdir}/usr/lib/${pkgname%-git}/"+ install -Dm644 "$(_get_project_dir)/src/renderer/assets/${_pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-git}.png"+ install -Dm644 "$(_get_project_dir)/${pkgname%-git}.desktop" -t "${pkgdir}/usr/share/applications"+ install -Dm644 "$(_get_project_dir)/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}" }+Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 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 05:19:21 | Medium | 1 |
| 2026-10-14 00:06:47 | Low | 2 |
| 2026-10-13 00:23:45 | Low | 2 |
| 2026-10-12 00:18:51 | Low | 2 |
| 2026-10-11 00:26:05 | Low | 2 |
| 2026-10-10 10:13:47 | Medium | 1 |
| 2026-10-10 00:11:52 | Low | 2 |
| 2026-10-09 00:05:33 | Low | 2 |
| 2026-10-08 00:28:03 | Low | 2 |
| 2026-10-07 00:21:34 | Low | 2 |