# Risk map — npm/cli

> Canonical page: https://codevetter.com/unpack/cli/risk-map

# Risk map — npm/cli

Scanned commit b317f16c80df02ea3628cfa77170d5ae9b59720c (2026-10-01). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

These findings describe source-level trust boundaries and behavioral hazards, not confirmed vulnerabilities. Installation can execute project code, mutate configured filesystem locations, and consume registry metadata with credentials. Configuration and script-policy behavior have branches that comments alone do not fully explain. Mocked tests and unexecuted CI leave runtime and live-provider behavior unverified.
- NpmExtension.load imports or requires project-selected code in-process; cloning manifests and restricting returned fields constrain transformation results but do not sandbox module-level execution. — [workspaces/arborist/lib/npm-extension.js#L93-112](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/npm-extension.js#L93-L112) [workspaces/arborist/lib/npm-extension.js#L142-173](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/npm-extension.js#L142-L173) [lib/npm.js#L121-131](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/npm.js#L121-L131)
- Hypothesis requiring validation: discover checks extension-file containment using resolved path strings, then reads/imports that path; a symlink's real target may escape that lexical root boundary. This inspection does not establish exploitability. (inferred) — [workspaces/arborist/lib/npm-extension.js#L39-53](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/npm-extension.js#L39-L53) [workspaces/arborist/lib/npm-extension.js#L100-106](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/npm-extension.js#L100-L106)
- Bare install runs root preinstall before strictAllowScriptsPreflight; strict dependency-script checks therefore do not precede all root-owned code execution. — [lib/commands/install.js#L160-176](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/install.js#L160-L176) [lib/utils/strict-allow-scripts-preflight.js#L5-15](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/utils/strict-allow-scripts-preflight.js#L5-L15)
- ci clears node_modules before root preinstall, so a failing bootstrap script can leave existing installations removed; dry-run guards cleanup but does not guard the root lifecycle calls. — [lib/commands/ci.js#L116-149](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/ci.js#L116-L149) [lib/commands/ci.js#L151-162](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/ci.js#L151-L162)
- Exec says its policy should consult user/global npmrc only, but resolveAllowScripts still probes project/user/global/builtin sources when skipProjectConfig is true; that flag skips package.json rather than the project npmrc source. — [lib/commands/exec.js#L81-86](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/exec.js#L81-L86) [lib/utils/resolve-allow-scripts.js#L107-110](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/utils/resolve-allow-scripts.js#L107-L110) [lib/utils/resolve-allow-scripts.js#L127-138](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/utils/resolve-allow-scripts.js#L127-L138) [lib/utils/resolve-allow-scripts.js#L174-175](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/utils/resolve-allow-scripts.js#L174-L175)
- User credentials are serialized into a configured file, with passwords base64-encoded rather than encrypted and chmod applied after writing; Npm also creates configured caches/log directories and labels argv redaction best-effort. — [workspaces/config/lib/index.js#L884-896](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/config/lib/index.js#L884-L896) [workspaces/config/lib/index.js#L947-952](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/config/lib/index.js#L947-L952) [lib/npm.js#L134-160](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/npm.js#L134-L160)
- Publish dry-run suppresses libpub but still reaches directory lifecycle hooks, OIDC setup, and registry version checks; #registryVersions catches any fetch/parsing error and returns an empty version set. — [lib/commands/publish.js#L102-110](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/publish.js#L102-L110) [lib/commands/publish.js#L150-182](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/publish.js#L150-L182) [lib/commands/publish.js#L204-243](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/publish.js#L204-L243) [lib/commands/publish.js#L259-284](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/lib/commands/publish.js#L259-L284)
- Reify has staged rollback for retirement, sparse-tree creation, unpacking, and builds, but explicitly performs final trash removal without rollback; linked installs also temporarily swap tree representations and restore them in finally. — [workspaces/arborist/lib/arborist/reify.js#L120-159](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/arborist/reify.js#L120-L159) [workspaces/arborist/lib/arborist/reify.js#L328-369](https://github.com/npm/cli/blob/b317f16c80df02ea3628cfa77170d5ae9b59720c/workspaces/arborist/lib/arborist/reify.js#L328-L369)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
