T08 · Insecure Dependencies
- Location
scripts/xhs-cover.sh:7- Finding
Unpinned Third-Party npm Package Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/xhs-cover.sh:7
Vulnerability Type: Unpinned dependency execution throughnpx
Risk Level: MediumVulnerable Code
bash exec npx xhscover "$@"The documentation also instructs users to execute the same unpinned package in
SKILL.md:22,30,36,39,42andREADME.md:39,62,65,68,71.Technical Analysis
The wrapper invokes
xhscoverthroughnpxwithout specifying an exact package version or enforcing a previously installed, integrity-verified local dependency. If no suitable local executable is available,npxmay resolve and download the current package published under that name, then execute its code.This creates a mutable supply-chain execution path: the code reviewed in this repository does not fully determine the code executed at runtime. A malicious or compromised future package release could therefore execute within the local process context. The repository contains no lockfile or integrity metadata that constrains package resolution.
Argument boundaries are correctly preserved by
"$@"; no shell command-injection issue was identified in the wrapper itself.Attack Path
- An attacker compromises the
xhscovernpm package, its publisher account, or its release process. - The attacker publishes a malicious package version under the existing package name.
- A user or Agent invokes
scripts/xhs-cover.shon a system where the package is not pinned and locally installed. npxresolves and obtains the mutable package version from the configured npm registry.- npm lifecycle logic or the package executable runs with the privileges of the invoking user.
- The malicious package can access resources available to that user before optionally continuing the expected cover-generation behavior to reduce detection.
Impact Assessment
Successful exploitation permits arbitrary code execution with the privileges of the user running ...[truncated 504 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Pin
xhscoverto an audited exact version rather than resolving the registry's current release. - Declare the package in a
package.jsonand commit a lockfile containing registry URL and integrity metadata. - Install dependencies during a controlled deployment phase using a lockfile-enforcing command such as
npm ci. - Invoke only the installed local binary, for example with
npx --no-install xhscover "$@"or an explicit path undernode_modules/.bin. - Disable unnecessary npm lifecycle scripts during installation where compatible with the package.
- Review dependency updates before changing the pinned version, and use registry provenance, integrity verification, and automated dependency scanning.
- Run the skill with least privilege and restrict access to unrelated credentials and sensitive files.
- Pin
