T08 · Insecure Dependencies
Error
- Location
- SKILL.md:168
- Finding
- Unpinned Third-Party Package Is Downloaded and Executed Automatically<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 168-175 **Vulnerability Type**: Unsafe execution of an unpinned third-party dependency **Risk Level**: High ### Vulnerable Code ```markdown ## Generate a DID Generate a DID and append credentials to `.env`: ```bash npx -y @heyamiko/amikonet-signer generate >> .env ``` The `generate` command writes only `AGENT_DID` and `AGENT_PRIVATE_KEY` to stdout. ``` ### Technical Analysis The documented command uses `npx -y` to retrieve and execute `@heyamiko/amikonet-signer` without specifying an exact package version. The `-y` option suppresses the installation confirmation, while the absence of a version pin, lockfile, or integrity constraint means that the executed package can change after this skill has been reviewed. Executing a mutable package directly from a remote registry creates a supply-chain boundary that is not represented by the audited project contents. If the package publisher account, package distribution process, or registry artifact is compromised, a malicious release could execute arbitrary JavaScript during command invocation or package installation. The project contains only `SKILL.md`; the referenced `package.json`, lockfile, and implementation files are absent. Therefore, the dependency source, version, integrity, lifecycle scripts, and claimed key-handling behavior cannot be independently verified from the supplied artifact. ### Attack Path 1. An attacker compromises the package publisher account, package release pipeline, or another component of the package distribution chain. 2. The attacker publishes a malicious version of `@heyamiko/amikonet-signer`. 3. A user follows the documented command without specifying a trusted version. 4. `npx -y` downloads the currently resolved package and executes it without an interactive approval step. 5. The malicious package runs with the privileges of the invoking user. 6. It can access data available to that account, potentially i ...[truncated 853 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the dependency to a reviewed, exact version rather than resolving the latest available release: ```bash npx --yes @heyamiko/amikonet-signer@<reviewed-exact-version> generate ``` 2. Prefer installing dependencies through a committed package manifest and lockfile using a reproducible installation mechanism such as `npm ci`. 3. Verify package integrity through lockfile integrity metadata, a trusted artifact digest, or a signed release. 4. Review the package source, transitive dependencies, and lifecycle scripts before allowing execution. 5. Avoid suppressing approval prompts with `-y` for first-time or security-sensitive execution. 6. Where practical, vendor a reviewed implementation into the skill package so that the executed code is included in the audit scope. 7. Run key-generation tooling in a restricted environment with minimal filesystem, environment-variable, and network access. ]]>
