T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:17
- Finding
- Unpinned Global Third-Party Package Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 17–23 **Vulnerability Type**: Unpinned and globally installed npm dependency **Risk Level**: Medium ### Vulnerable Code ```markdown ## Prerequisites Before running any command, check if `claw-diary` is installed: ```bash which claw-diary || npm install -g claw-diary ``` If the command is not found, run `npm install -g claw-diary` to install it. ``` ### Technical Analysis The skill directs the agent to install the latest available version of the third-party `claw-diary` npm package globally. It does not pin an exact package version, verify a cryptographic integrity value, provide a lockfile, or include the dependency source for review. npm packages can execute lifecycle scripts during installation. Because the installation is global, those scripts and the installed executable run with the installing user's privileges and are placed outside the project directory. The behavior ultimately executed by this skill can therefore change after the skill itself has been reviewed. The project metadata declares version `1.1.2`, but the installation command does not request that version. Consequently, the package selected from the registry may differ from the version represented by the skill metadata. ### Attack Path 1. An attacker compromises the npm publisher account, registry artifact, or another part of the package's release process. 2. The attacker publishes a modified version under the existing `claw-diary` package name. 3. A user invokes the skill on a system where the `claw-diary` executable is absent. 4. The prerequisite command executes `npm install -g claw-diary` and retrieves the current registry version. 5. Malicious npm lifecycle scripts may execute during installation. 6. The installed executable can subsequently run attacker-controlled logic whenever a diary command is invoked. This is a supply-chain exposure rather than evidenc ...[truncated 649 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the package to an exact audited version, for example: ```bash npm install --global --ignore-scripts claw-diary@1.1.2 ``` Use `--ignore-scripts` only if the package does not legitimately require lifecycle scripts. 2. Verify the package's registry provenance and integrity before installation. 3. Prefer a project-local installation instead of a global installation, and execute it from a controlled dependency directory. 4. Include a lockfile or an integrity-pinned installation manifest. 5. Review the package source and published npm artifact, including lifecycle scripts, before permitting installation. 6. Run the package with the minimum necessary operating-system privileges and restrict access to unrelated user data. 7. Ensure the version declared in skill metadata is the same exact version requested by the installation command. ]]>
