T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:36
- Finding
- Unpinned npm Package Is Retrieved and Executed<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:36-38` **Vulnerability Type**: Unpinned remote npm dependency execution **Risk Level**: Medium ### Vulnerable Code ```bash npx @claws-shield/cli scan <path-to-skill> ``` ### Technical Analysis The documented command uses `npx` to resolve and execute `@claws-shield/cli` without specifying an exact version. The project contains no package manifest, lockfile, integrity hash, or trusted registry configuration that would bind this command to a reviewed package artifact. Consequently, the code executed by this command can change after the Skill has been audited. The security of the command depends on the continuing integrity of the npm package, its publisher account, its transitive dependencies, and the registry resolution process. There is no evidence in the audited files that the current npm package is malicious. The vulnerability is the unsafe, mutable dependency execution mechanism. ### Attack Path 1. An attacker compromises the package publisher, npm account, package release process, or a relevant dependency. 2. The attacker publishes a malicious version of `@claws-shield/cli`. 3. A user follows the documented unversioned `npx` command. 4. `npx` resolves and downloads the attacker-controlled package version. 5. Package code executes locally with the permissions of the user who launched the command. 6. The malicious package can access resources available to that user, including the supplied scan target and other files permitted by the operating system. ### Impact Assessment Successful exploitation would permit arbitrary code execution with the invoking user's privileges. The accessible scope could include: - Reading or modifying files available to the user. - Accessing the target Skill directory. - Reading environment variables and locally available credentials. - Making outbound network connections. - Executing additional processes. This code does not independently obtain elevated syste ...[truncated 107 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Replace the unversioned package reference with an exact, previously audited version. - Add a package manifest and lockfile that record exact direct and transitive dependency versions. - Verify package integrity through lockfile integrity metadata or independently maintained checksums. - Configure and document the expected npm registry to reduce dependency-confusion risk. - Review the package and its transitive dependencies before updating the pinned version. - Prefer installing dependencies in a controlled build step rather than resolving and executing mutable packages directly through `npx`. - Run the scanner in a restricted environment with only the required filesystem access and with network access disabled unless explicitly necessary. ]]>
