T08 · Insecure Dependencies
- Location
SKILL.md:12- Finding
Unpinned npm Package May Be Retrieved and Executed Before User Consent
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–15 and 33–39
Vulnerability Type: Unpinned third-party dependency retrieval and execution
Risk Level: MediumVulnerable Code
yaml install: - kind: node package: puzzletide bins: ["ptide", "puzzletide"]markdown Prefer the local CLI. Check availability in this order: ```bash ptide --version puzzletide --version npx puzzletide --versionIf none of those work, ask the user before installing (
npm install -g puzzletide).text ### Technical Analysis The installation metadata and `npx` fallback identify the npm package only by its mutable package name, without an exact version or integrity constraint. When no local binary is present, `npx puzzletide --version` may contact the npm registry, retrieve the currently resolved release, and execute its CLI entry point. This behavior occurs before the instruction to ask the user for permission to install the package. As a result, the consent requirement does not reliably protect the first remote retrieval and execution. It also conflicts with the safety statement that the skill requires no network access and does not install packages without prior approval. Because an npm package executes code with the privileges of the invoking user, compromise of the package, its transitive dependencies, its registry namespace, or a future release could turn this version check into arbitrary local code execution. ### Attack Path 1. The expected `ptide` and `puzzletide` binaries are not installed locally. 2. The agent follows the documented fallback and invokes `npx puzzletide --version`. 3. `npx` resolves the unpinned `puzzletide` package through the configured npm registry and may download it into the local npm cache. 4. A compromised or unexpectedly modified package release is selected because no exact audited version or integrity value is required. 5. The package CLI and ...[truncated 1094 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
npx puzzletide --versionfrom the pre-consent availability checks. Only inspect already installed binaries before asking the user whether remote retrieval is permitted. - If
npxremains supported, request explicit user approval before invoking it and clearly state that it may access the network, download package content, populate npm caches, and execute third-party code. - Pin the dependency to a reviewed exact version, such as
puzzletide@X.Y.Z, rather than resolving the mutable latest release. - Verify package integrity using an approved lockfile, npm integrity metadata, a trusted internal registry, or an equivalent reproducible dependency-verification mechanism.
- Review and pin transitive dependencies where the installation framework permits it.
- Prefer installation into an isolated, least-privileged environment rather than a global npm installation.
- Update the Safety section so its network-access and installation claims accurately reflect the behavior of all documented fallback commands.
- Fail closed if the approved version or integrity check cannot be satisfied; do not silently fall back to the latest registry release.
- Remove
