T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:42
- Finding
- Unpinned npm Package Is Installed and Executed Globally## Vulnerability Details **File Location**: `SKILL.md`, lines 42 and 65 **Vulnerability Type**: Unpinned executable third-party dependency **Risk Level**: Medium ### Code Snippet ```bash npm i -g @iqinghu/qhkit ``` The upgrade procedure also installs the mutable latest release: ```bash npm i -g @iqinghu/qhkit@latest ``` ### Technical Analysis The Skill instructs the agent to globally install and execute an npm package without pinning it to a reviewed version or verifying package integrity. Both the versionless installation and the explicit `@latest` installation resolve to mutable package content at execution time. npm installation can execute package lifecycle scripts. Consequently, a compromised package release, maintainer account, npm registry response, or configured mirror could introduce code that was not present when this Skill was audited. Global installation also exposes the package executable across the user's environment rather than isolating it to the current task. The fallback mirror described by the Skill creates an additional supply-chain trust relationship. There is no evidence in the audited file that the package or mirror is malicious, but the installation process does not provide sufficient reproducibility or integrity enforcement. ### Attack Path 1. An attacker compromises the npm package, a package maintainer account, the registry distribution channel, or a configured mirror. 2. The attacker publishes a malicious release as the current default or latest version. 3. The agent follows the Skill and runs the unpinned global installation command. 4. Malicious lifecycle code executes during installation, or malicious behavior runs when the installed `qhkit` command is invoked. 5. The payload gains the permissions of the account performing the installation. ### Impact Assessment Successful exploitation can execute arbitrary code with the installing user's privileges. This may permit access t ...[truncated 341 chars]
- Remediation
- ## Remediation Suggestions - Pin `@iqinghu/qhkit` to a specific, reviewed version rather than using a versionless package reference or `@latest`. - Record and verify the expected package integrity value or use a lockfile with integrity metadata. - Install the dependency in a task-specific, non-global directory to limit executable replacement and environmental impact. - Disable npm lifecycle scripts with `--ignore-scripts` when the package can operate without them. - Require explicit user approval before installing or upgrading executable dependencies. - Review a new package version before updating the pinned version. - Prefer the official registry and apply equivalent integrity checks when a mirror must be used.
