Install security
Every xnpm install inspects new dependency tarballs in memory for Phantom Gyp and similar supply-chain attacks — before any code executes. For publish-time pack checks and credential leaks, see Safety.
Install gate
Attacks like Phantom Gyp (the Miasma worm, June 2026) trigger node-gyp rebuild during install — with no package.json script. xnpm fetches each new tarball from the registry and scans it before handing off to npm.
binding.gyp with <!(...) shell substitution.index.js much larger than declared main.binding.gyp with no C/C++ sources.
xnpm install · xnpm install --inspect-only
xnpm config trust-scope @scope · xnpm audit --log
Cache: ~/.xnpm/inspected.json
Audit log: ~/.xnpm/audit.log
Trusted: @x12i, @exellix + user scopes
Threat context
In June 2026, Snyk tracked the Node-gyp Supply Chain Compromise — 57 packages, hundreds of malicious versions, classified as Embedded Malicious Code at Critical severity. That is Snyk's advisory system, not a CVE.
CVEs describe bugs in software. Phantom Gyp abuses gyp's <!(...) substitution — a legitimate feature, not a flaw in npm or node-gyp. Individual packages get npm advisories after the fact; the technique itself does not.
--ignore-scripts blocks lifecycle hooks but does not stop node-gyp rebuild from a weaponized binding.gyp. The reliable fix: scan tarballs before install.
| Defense | Phantom Gyp |
|---|---|
npm audit | Reactive — after advisories exist |
--ignore-scripts | Misses node-gyp path |
| npm advisories | Per-package, post-incident |
| xnpm tarball gate | Structural — catches <!( before install |
Would have flagged packages during the ~2h window before advisories existed.
Guarantee
npm install — cleared packages cached in ~/.xnpm/inspected.json.~/.xnpm/audit.log.npm audit for known CVEs — it adds structural checks advisories cannot cover.node_modules from before this feature existed.