nodejs-pkg

maintainer annikkitikkanen · 0 votes · scanned 2026-08-03 00:08:14.047287
MEDIUM
View on AUR ↗
Why flagged The PKGBUILD downloads a source tarball from GitHub (with a sha512 checksum) but then explicitly ignores it (noextract) and instead installs directly from the npm registry via 'npm install -g pkg@5.8.1'. This means the integrity check on the GitHub tarball is meaningless — the actual installed content comes from npm without any checksum verification. This is a genuine supply-chain concern: the npm package content is not verified against any declared hash, and a compromised or substituted npm package would be installed silently. The commented-out line shows the correct approach (installing from the local tarball) was intentionally bypassed. This pattern is a real medium-severity supply-chain risk, not a false positive.

Triggered rules

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:20 npm install -g pkg@${pkgver} --user root --prefix "${pkgdir}/usr"
MEDIUM AI review llm_review

An AI model (anthropic/claude-4.6-sonnet-20260217) reviewed this and agrees it is MEDIUM (confidence 85%): The PKGBUILD downloads a source tarball from GitHub (with a sha512 checksum) but then explicitly ignores it (noextract) and instead installs directly from the npm registry via 'npm install -g pkg@5.8.1'. This means the integrity check on the GitHub tarball is meaningless — the actual installed content comes from npm without any checksum verification. This is a genuine supply-chain concern: the npm package content is not verified against any declared hash, and a compromised or substituted npm package would be installed silently. The commented-out line shows the correct approach (installing from the local tarball) was intentionally bypassed. This pattern is a real medium-severity supply-chain risk, not a false positive.

PKGBUILD

1 offending line(s) highlighted
1# Maintainer: Jonas Heinrich <onny@project-insanity.org>
2# Contributor: Popolon <popolon@popolon.org> (just upgraded to 5.8.1 and added the conflict with nodejs-shelljs)
3# Contributor: Jonas Heinrich <onny@project-insanity.org>
4
5pkgname=nodejs-pkg
6pkgver=5.8.1
7pkgrel=1
8pkgdesc="Package your Node.js project into an executable"
9arch=('x86_64')
10url="https://github.com/zeit/pkg"
11license=('MIT')
12makedepends=('npm')
13conflicts=('nodejs-shelljs')
14source=("${pkgname}-${pkgver}.tar.gz::https://github.com/zeit/pkg/archive/${pkgver}.tar.gz")
15sha512sums=('bdf0c04743e338393b8a942c7ae53e531ad260a7bcb1bca2560238b13a55f214a9f384d4d122679a1ccab0f471fef0beb35a5b197563b5e8ee141854d1558086')
16noextract=("${pkgname}-${pkgver}.tar.gz")
17
18package() {
19 #npm install -g --user root --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tar.gz"
20 npm install -g pkg@${pkgver} --user root --prefix "${pkgdir}/usr"
21
22 # Non-deterministic race in npm gives 777 permissions to random directories.
23 # See https://github.com/npm/npm/issues/9359 for details.
24 find "${pkgdir}/usr" -type d -exec chmod 755 {} +
25
26 # npm gives ownership of ALL FILES to build user
27 # https://bugs.archlinux.org/task/63396
28 chown -R root:root "${pkgdir}"
29}
30

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 MEDIUM 2
2026-08-02 00:16:08 MEDIUM 2
2026-08-01 00:11:18 MEDIUM 2
2026-07-31 00:14:10 MEDIUM 2
2026-07-30 00:17:23 MEDIUM 2
2026-07-29 00:25:53 MEDIUM 2
2026-07-28 00:07:28 MEDIUM 2
2026-07-27 00:24:32 MEDIUM 2
2026-07-26 00:07:32 MEDIUM 2
2026-07-25 00:13:44 MEDIUM 2
2026-07-24 00:02:28 MEDIUM 2
2026-07-23 00:14:47 MEDIUM 2
2026-07-22 00:29:32 MEDIUM 2
2026-07-21 00:24:15 MEDIUM 2
2026-07-20 00:19:49 MEDIUM 2
2026-07-19 00:17:08 MEDIUM 2
2026-07-18 00:14:48 MEDIUM 2
2026-07-17 00:06:16 MEDIUM 2
2026-07-16 00:05:41 MEDIUM 2
2026-07-15 00:09:25 MEDIUM 2

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion