T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:5
- Finding
- Unpinned Third-Party npm CLI Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 5–9 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code Snippet ```yaml install: - kind: node package: "@thecorporation/cli" bins: - corp ``` The Skill subsequently directs users and agents to execute this package through commands such as: ```bash npx corp setup npx corp status npx corp serve --port 8020 ``` ### Technical Analysis The installation metadata identifies `@thecorporation/cli` without an exact version or integrity digest. The documented `npx corp` commands can consequently resolve and execute a package version based on the npm registry and the invoking environment rather than a version whose contents were included in this audit. An npm CLI and its dependency tree execute with the privileges of the invoking user. Package installation may also run lifecycle scripts unless those scripts are explicitly disabled. If the package publisher, npm account, registry, or transitive dependency chain is compromised, an attacker could publish altered code without modifying this reviewed Skill. This is a supply-chain weakness rather than evidence that the currently published package is malicious. The audited project contains no local scripts or embedded malicious payloads. ### Attack Path 1. An attacker compromises the npm publisher account, package release process, registry resolution path, or a transitive dependency used by `@thecorporation/cli`. 2. The attacker publishes a malicious release that remains compatible with the unversioned package reference. 3. A user or agent follows the Skill and invokes `npx corp setup` or another documented `npx corp` command. 4. The package manager resolves or downloads the compromised package version. 5. Malicious package code or an installation lifecycle script executes with the permissions of the invoking user. 6. The malicious code can access resources available to that us ...[truncated 939 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to a reviewed exact version in the installation metadata and all command examples: ```bash npx --yes --package=@thecorporation/cli@X.Y.Z corp setup ``` 2. Avoid version ranges and floating tags such as `latest`. 3. Use a lockfile with recorded integrity hashes when installing the CLI as a project dependency. 4. Verify npm provenance, package signatures, publisher identity, and registry origin before upgrades. 5. Review package and transitive dependency changes before updating the pinned version. 6. Disable npm lifecycle scripts where operationally feasible: ```bash npm install --ignore-scripts ``` If lifecycle scripts are required, audit them explicitly before installation. 7. Run the CLI under a dedicated, least-privileged account or isolated environment with access only to required files and services. 8. Require explicit user confirmation before consequential operations such as payments, tax filings, document signing, account activation, and equity issuance. 9. Document the expected npm registry and prevent dependency resolution from untrusted or user-controlled registries. ]]>
