T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:5
- Finding
- Unpinned npm Dependency Permits Unreviewed Package Updates<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 5 **Vulnerability Type**: Unpinned third-party npm dependency **Risk Level**: Medium ### Vulnerable Code ```yaml metadata: '{"clawdbot":{"emoji":"📄","requires":{"bins":["trans"],"env":["TRANS_API_KEY"]},"install":[{"id":"npm","kind":"npm","package":"@bdtrans/trans-cli","bins":["trans"],"label":"Install trans-cli (npm)"}]}}' ``` ### Technical Analysis The installation metadata specifies `@bdtrans/trans-cli` without an exact version or package-integrity hash. Consequently, npm resolves the package version available under the applicable registry and dependency-resolution rules at installation time. The Skill's reviewed contents therefore do not fully determine the code that will be installed and executed. If the package publisher account, npm package, registry, or release process is compromised, a malicious new version could be delivered without any modification to this repository. npm lifecycle scripts may also run during package installation unless explicitly disabled, allowing package code to execute before the `trans` command is invoked. No evidence in the audited project proves that the current `@bdtrans/trans-cli` release is malicious. The confirmed issue is the unsafe, mutable dependency specification and the resulting supply-chain exposure. ### Attack Path 1. An attacker compromises the package publisher, package distribution channel, or another part of the dependency supply chain. 2. The attacker publishes a malicious version of `@bdtrans/trans-cli` under the legitimate package name. 3. A user or Agent installs the Skill dependency using the unversioned package declaration. 4. npm resolves and installs the attacker-controlled release. 5. Malicious lifecycle or CLI code executes with the permissions of the installation or Agent process. 6. The code can access resources available to that process, potentially including `TRANS_API_KEY`, documents selected for translation, downloa ...[truncated 969 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@bdtrans/trans-cli` to a specifically reviewed version rather than relying on the latest registry release, for example: ```json "package": "@bdtrans/trans-cli@<audited-exact-version>" ``` 2. Verify package provenance and integrity using an npm lockfile, registry integrity metadata, signed provenance where available, or an equivalent trusted manifest. 3. Re-audit the package and its transitive dependencies before changing the pinned version. 4. Use a trusted, explicitly configured npm registry and enforce package allowlisting in controlled environments. 5. Disable npm lifecycle scripts during installation where compatible with the package: ```bash npm install --ignore-scripts ``` 6. Run installation and translation under a dedicated, least-privileged account or sandbox with access restricted to the intended input and output directories. 7. Expose `TRANS_API_KEY` only to the translation process when needed, and avoid making unrelated credentials available in the same environment. 8. Apply outbound network restrictions so the CLI can communicate only with documented translation-service endpoints. ]]>
