T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:5
- Finding
- Execution of an Unverified Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5, 51-59`; mirrored in `SKILL-cn.md:5, 51-59` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: Medium ### Vulnerable Code From `SKILL.md:5` and `SKILL-cn.md:5`: ```json "install":"npm install -g @dlazy/cli@1.2.3", "installAlternative":"npx @dlazy/cli@1.2.3" ``` From `SKILL.md:51-59`: ```bash npx @dlazy/cli@1.2.3 <command> ``` ```bash npm install -g @dlazy/cli@1.2.3 ``` Equivalent installation commands are documented in `SKILL-cn.md:51-59`. ### Technical Analysis The Skill depends on the externally hosted npm package `@dlazy/cli` and instructs users or agents to retrieve and execute it through `npx` or install it globally. Pinning the package to version `1.2.3` reduces unreviewed version drift, but it does not provide artifact integrity or prove that the retrieved package matches reviewed source code. The audited project contains only the two Skill documents. It does not include the CLI implementation, a package lockfile, a cryptographic checksum, a verifiable signature, a vendored dependency, or other evidence that would allow the executable npm artifact to be audited or authenticated locally. Consequently, the behavior of the code actually executed during installation and invocation is outside the reviewed artifact. An attacker who compromises the published package version, the maintainer’s npm account, the package distribution process, or the registry delivery path could introduce malicious install lifecycle scripts or CLI logic. Such logic would execute under the identity and permissions of the user invoking `npm` or `npx`. This finding identifies an unverified supply-chain execution boundary. The audit did not establish that the current npm package is malicious. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or the artifact distribution path for `@dlazy/cli@1.2.3`. 2. The attacker adds malicious code to an installation lifecycle ...[truncated 1367 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Vendor the required CLI implementation into a reviewable repository or package it as an independently verifiable artifact. 2. Publish and verify a cryptographic digest or trusted signature for the exact package archive before execution. 3. Ensure that the npm artifact is reproducibly built from the referenced public source and document the verification procedure. 4. Prefer ephemeral, sandboxed execution over global installation. 5. Disable npm lifecycle scripts where they are not required, for example by using an installation method equivalent to `--ignore-scripts` after confirming that this does not break legitimate functionality. 6. Run the CLI under a dedicated low-privilege account or container with: - Access only to explicitly selected input and output files. - No unnecessary access to home-directory secrets. - Restricted environment variables. - Network access limited to documented service endpoints. 7. Avoid exposing unrelated credentials to the CLI process. Provide only the API credential required for the current task. 8. Add a lockfile or equivalent dependency manifest for all transitive dependencies and subject them to routine supply-chain scanning. 9. Prefer a local, verified binary path after installation rather than invoking `npx`, which may retrieve artifacts dynamically. 10. Document a package revocation and incident-response process so a compromised release can be blocked promptly. ]]>
