T08 · Insecure Dependencies
- Location
SKILL.md:30- Finding
Unpinned Third-Party Package Retrieval and Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 30–36
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: HighVulnerable Code
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 skill instructs the agent to execute `npx puzzletide --version` when the expected local binaries are unavailable. If the package is not already present in the local npm cache, `npx` can retrieve it from the configured npm registry and execute its code. No exact package version, package integrity hash, lockfile, or trusted artifact digest is specified. This creates a supply-chain trust boundary in which the effective executable can change after the skill has been audited. A compromised npm account, malicious newly published release, registry compromise, or unexpected package ownership change could cause attacker-controlled package code to run. The `npx` command also appears before the instruction to request permission for package installation. Consequently, package retrieval and execution may occur before the user provides the consent that the skill requires for `npm install -g puzzletide`. This conflicts with the Safety section's assertions that package installation requires permission and that no network access is needed. ### Attack Path 1. An attacker compromises the `puzzletide` npm package, its publisher account, or its distribution channel and publishes a malicious release. 2. A user requests crossword generation in an environment where neither `ptide` nor `puzzletide` is installed locally. 3. Following `SKILL.md`, the agent executes `npx puzzletide --version`. 4. `npx` resolves the unpinned package name through the configured npm registry and may download the current package release. 5. Package lifecycle behavior or the ...[truncated 1009 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the automatic
npx puzzletide --versionfallback. Check only already-installed local binaries by default. - Obtain explicit user consent before any command that may contact a package registry, download a package, install dependencies, or execute newly retrieved code.
- Pin the dependency to a reviewed exact version rather than resolving the latest release, for example by referencing an approved version such as
puzzletide@<exact-version>. - Verify the downloaded artifact against an independently maintained integrity hash or trusted lockfile before execution.
- Prefer a project-local, locked dependency installation over a global installation. Use npm lockfiles and deterministic installation mechanisms such as
npm ci. - Disable package lifecycle scripts where compatible, and inspect the selected package version before permitting execution.
- Run the CLI in a restricted container or sandbox with minimal filesystem access, no secrets, limited network connectivity, and no elevated privileges.
- Update the Safety section to disclose that
npxmay use the network and retrieve executable package content. - Document the approved package source, exact version, integrity value, and update-review procedure so package upgrades require a new security review.
- Remove the automatic
