T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:12
- Finding
- Unaudited Third-Party npm Package Is Installed and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:12-13` and equivalent declaration in `SKILL-cn.md:12-13` **Vulnerability Type**: Third-party supply-chain exposure **Risk Level**: Medium ### Complete Code Snippet ```yaml 'install': 'npm install -g @dlazy/cli@1.2.3', 'installAlternative': 'npx @dlazy/cli@1.2.3', ``` The package is also directly recommended for execution in `SKILL.md:60` and `SKILL-cn.md:60`: ```bash npx @dlazy/cli@1.2.3 <command> ``` ### Technical Analysis The Skill depends on the externally distributed npm package `@dlazy/cli@1.2.3`. The executable package and its dependency tree are not included in the audited project, so their behavior could not be inspected or verified against the linked source repository. Pinning the package to version `1.2.3` reduces version drift, but it does not independently establish package integrity or confirm that the npm artifact corresponds to the reviewed repository. No checksum, signed provenance record, or other integrity-verification mechanism is specified. Both installation methods introduce supply-chain exposure: - `npm install -g` installs the package globally and may execute npm lifecycle scripts with the invoking user's privileges. - `npx` retrieves and executes the external package on demand. - The CLI is expected to handle API credentials, user prompts, network requests, and explicitly supplied local files. - Transitive dependencies and lifecycle scripts are outside the reviewed project and therefore remain unaudited. This finding does not establish that the current package is malicious. It identifies the security boundary created by downloading and executing code that is absent from the submitted artifact. ### Attack Path A plausible exploitation path, contingent on compromise or malicious publication of the npm artifact, is: 1. An attacker compromises the npm publisher account, package release process, or one of the package's transitive dependencies. 2. Malicious code is in ...[truncated 1472 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Verify package provenance** - Publish npm provenance attestations from a controlled CI/CD workflow. - Document how users can confirm that the npm artifact corresponds to the linked source repository. - Sign release tags and retain reproducible release records. 2. **Add integrity controls** - Provide a verified integrity hash for the expected package artifact. - Lock and audit all transitive dependencies. - Use automated dependency and package-malware scanning in the release pipeline. 3. **Avoid global installation by default** - Prefer a project-local, isolated installation over `npm install -g`. - Run the CLI in a container, sandbox, or dedicated low-privilege account where practical. - If global installation remains supported, clearly explain that it persists an executable on the host. 4. **Restrict lifecycle-script exposure** - Confirm whether the package requires npm lifecycle scripts. - If it does not, recommend installation with lifecycle scripts disabled. - Audit any required lifecycle script and document its behavior. 5. **Vendor or include auditable implementation code** - Include the relevant CLI source and lockfile in the reviewed artifact, or provide a verifiable source-to-package build process. - Audit credential storage, file-upload behavior, command construction, and network destinations. 6. **Apply least privilege** - Run the CLI without administrative privileges. - Limit the API key's permissions and rotate it regularly. - Pass only files intentionally selected for upload. - Restrict outbound network access to documented endpoints where operationally feasible. ]]>
