cycode
maintainer zxp19821005
· 0 votes
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The npx command is used locally to run electron-packager on the project's own source code after dependencies are installed, which is a standard build step and not an execution of untrusted remote code.
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 is used locally to run electron-packager on the project's own source code after dependencies are installed, which is a standard build step and not an execution of untrusted remote code.
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:87
NODE_ENV=production npx electron-packager . cycode --overwrite --asar=true --platform=linux --arch=x64 --icon=src/img/logo.png --prune=true --out=release-builds --electron-zip-dir="${srcdir}"
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
2
pkgname=cycode
3
_pkgname=CyCode
4
pkgver=2.0.7
5
_electronversion=31
6
_nodeversion=20
7
pkgrel=1
8
pkgdesc="A web-based HTML Editor, Markdown Editor, and WYSIWYG Editor,a code editor with a primary focus on web development.(Use system-wide electron)"
9
arch=('any')
10
url="https://github.com/magayagalabs/CyCode"
11
license=('MIT')
12
conflicts=("${pkgname}")
13
depends=(
14
"electron${_electronversion}"
15
)
16
makedepends=(
17
'nvm'
18
'npm'
19
'curl'
20
'gendesk'
21
'git'
22
'jq'
23
)
24
source=(
25
"${pkgname}-${pkgver}::git+${url}#tag=v${pkgver}"
26
"${pkgname}.sh"
27
)
28
sha256sums=('9d267c19126ffbab29516c3a0778ce7bafc3c1de8e30e45e79139bd742b80fc8'
29
'31ad33b633744f5361abd964be306cea53ae1050e760c787115f7eca60045ae6')
30
_ensure_local_nvm() {
31
local NVM_DIR="${srcdir}/.nvm"
32
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
33
nvm install "${_nodeversion}"
34
nvm use "${_nodeversion}"
35
}
36
_get_electron_version() {
37
_elec_ver=$(jq -r '.devDependencies["electron"] // .dependencies["electron"]' "${srcdir}/${pkgname}-${pkgver}/package.json" | tr -d '^')
38
_main_ver=$(echo "${_elec_ver}" | cut -d. -f1)
39
echo -e "The electron version is: \033[1;31m${_main_ver}\033[0m"
40
}
41
prepare() {
42
cd "${srcdir}/${pkgname}-${pkgver}"
43
sed -i -e "
44
s/@electronversion@/${_electronversion}/g
45
s/@appname@/${pkgname}/g
46
s/@runname@/app.asar/g
47
s/@cfgdirname@/${pkgname}/g
48
s/@options@/env ELECTRON_OZONE_PLATFORM_HINT=auto/g
49
" "${srcdir}/${pkgname}.sh"
50
_get_electron_version
51
gendesk -f -n -q \
52
--pkgname="${pkgname}" \
53
--pkgdesc="${pkgdesc}" \
54
--categories="Development" \
55
--name="${_pkgname}" \
56
--exec="${pkgname} %U"
57
export SYSTEM_ELECTRON_VERSION="$(electron${_electronversion} -v | sed 's/v//g')"
58
local HOME="${srcdir}/.electron-gyp"
59
export NPM_CONFIG_CACHE="${srcdir}/.npm_cache"
60
export NPM_CONFIG_MAXSOCKETS=32
61
if [[ "$(curl -s ipinfo.io/country)" == *"CN"* ]]; then
62
{
63
export NPM_CONFIG_REGISTRY="https://registry.npmmirror.com"
64
export NPM_CONFIG_ELECTRON_MIRROR="https://registry.npmmirror.com/-/binary/electron/"
65
export NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"
66
}
67
find ./ -type f -name "package-lock.json" -exec sed -i "s/registry.npmjs.org/registry.npmmirror.com/g" {} +
68
fi
69
_ensure_local_nvm
70
sed -i "s/\"electron\": \"[^\"]*\"/\"electron\": \"${SYSTEM_ELECTRON_VERSION}\"/g" package.json
71
NODE_ENV=development npm install --leagcy-peer-deps
72
}
73
build() {
74
cd "${srcdir}/${pkgname}-${pkgver}"
75
_ensure_local_nvm
76
export ELECTRON_SKIP_BINARY_DOWNLOAD=1
77
local electronDist="/usr/lib/electron${_electronversion}"
78
# 使用系统 Electron,需要先打包成 zip 格式
79
# electron-packager 需要 zip 格式的分发文件,文件名格式: electron-vVERSION-linux-x64.zip
80
local electronZip="${srcdir}/electron-v${SYSTEM_ELECTRON_VERSION}-linux-x64.zip"
81
if [[ ! -f "${electronZip}" ]]; then
82
msg2 "Creating Electron zip from system installation..."
83
cd "${electronDist}"
84
zip -r -q "${electronZip}" .
85
fi
86
cd "${srcdir}/${pkgname}-${pkgver}"
87
NODE_ENV=production npx electron-packager . cycode --overwrite --asar=true --platform=linux --arch=x64 --icon=src/img/logo.png --prune=true --out=release-builds --electron-zip-dir="${srcdir}"
88
}
89
package() {
90
install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
91
install -Dm755 -d "${pkgdir}/usr/lib/${pkgname}"
92
find "${srcdir}/${pkgname}-${pkgver}/release-builds/${pkgname}-linux-"*"/resources" -maxdepth 1 -type f -exec install -Dm644 -t "${pkgdir}/usr/lib/${pkgname}" {} +
93
if find "${srcdir}/${pkgname}-${pkgver}/release-builds/${pkgname}-linux-"*"/resources" -mindepth 1 -maxdepth 1 -type d | read; then
94
for _subdir in "${srcdir}/${pkgname}-${pkgver}/release-builds/${pkgname}-linux-"*"/resources/"*; do
95
if [ -d "${_subdir}" ]; then
96
cp -Pr --no-preserve=ownership "${_subdir}" "${pkgdir}/usr/lib/${pkgname}"
97
fi
98
done
99
fi
100
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/src/img/logo.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
101
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/${pkgname}.desktop" -t "${pkgdir}/usr/share/applications"
102
install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
103
}
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 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 |