T08 · Insecure Dependencies
- Location
scripts/publish-skills.sh:18- Finding
Unpinned Third-Party Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
scripts/publish-skills.sh:18-22
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: MediumVulnerable Code
bash require_command "npx" ( cd "$repo_root" npx skills check )Technical Analysis
The publishing validation workflow executes
npx skills checkwithout pinning theskillspackage to an audited version or integrity-protected dependency. The project has no corresponding dependency declaration or lockfile.When the package is not already installed locally,
npxmay retrieve and execute the package currently associated with theskillsname in the configured registry. The code executed by this command can therefore change independently of the reviewed repository. A compromised package release, registry account, or package-resolution source could introduce arbitrary code into the publishing workflow.Attack Path
- An attacker compromises the package, its maintainer account, or a registry source used to resolve
skills. - The attacker publishes a malicious version under the package name resolved by
npx. - A repository maintainer runs
npm run publish:skillsornpm run publish:all. - The npm script invokes
scripts/publish-skills.sh. npx skills checkdownloads or resolves the mutable package version and executes its lifecycle or command code.- The malicious code runs under the maintainer's account in the project directory.
Impact Assessment
Successful exploitation provides code execution with the privileges of the user running the publishing command. The malicious package could read or modify repository files, access environment variables and user-readable credentials, alter release artifacts, or misuse publishing credentials available to that process.
The impact is limited by the invoking user's operating-system permissions and any sandboxing or credential isolation applied to the ...[truncated 91 chars]
- An attacker compromises the package, its maintainer account, or a registry source used to resolve
- Remediation
View remediation
Remediation Suggestions
- Add the audited
skillspackage at an exact version todevDependencies. - Commit the generated package lockfile so dependency versions and integrity hashes are reproducible.
- Replace the command with
npx --no-install skills checkso the publishing workflow cannot download an undeclared package. - Install dependencies in CI with a lockfile-enforcing command such as
npm ci. - Review package provenance and integrity before version updates, and use automated dependency scanning.
- Run publishing in an isolated environment with minimal credentials and filesystem permissions.
- Add the audited
