T08 · Insecure Dependencies
- Location
SKILL.md:27- Finding
Unpinned Third-Party Package Is Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 27-37 and 140
Vulnerability Type: Unpinned npm dependency and automatic remote package execution
Risk Level: MediumVulnerable Code
bash # Lines 27-37 Global install (requires sudo): sudo npm install @serverless-devs/s -g sudo s -v No-sudo alternative (recommended in restricted environments): npx -y @serverless-devs/s -vbash # Line 140 printf 'y\n' | npx -y @serverless-devs/s deployTechnical Analysis
The commands install or execute
@serverless-devs/swithout specifying an exact version or verifying an integrity digest. In particular,npx -ycan retrieve the current registry version and execute it without an interactive package-installation confirmation.Consequently, the code executed at deployment time can differ from the package version available when the Skill was reviewed. Although the package name is consistent with the documented workflow and no malicious dependency is embedded in the project itself, this creates supply-chain exposure. A compromised package release, package maintainer account, registry response, or transitive dependency could introduce arbitrary code.
The global installation command is additionally run through
sudo, which increases the consequences of dependency compromise. The separate excessive-privilege issue is documented in another finding.Attack Path
- An attacker compromises the package publisher, npm package, registry delivery path, or a transitive dependency.
- The attacker publishes malicious code under a version selected by the unpinned package reference.
- A user or Agent follows the Skill and runs either
npm install @serverless-devs/s -gornpx -y @serverless-devs/s .... - npm downloads the changed package content because no exact reviewed version or integrity value is required.
- Package installation hooks or runtime code execute on the local host.
- The malicious code accesses local files, environme ...[truncated 499 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin
@serverless-devs/sto a specifically reviewed version rather than resolving the latest available release. - Use a committed lockfile where applicable and verify package integrity against a trusted digest.
- Do not use
npx -yfor deployment because it combines unattended download and execution. - Install dependencies in advance from a trusted registry and execute the verified local binary.
- Review package provenance, lifecycle scripts, and transitive dependencies before use.
- Avoid running npm package installation or package-controlled commands through
sudo. - Establish a controlled upgrade process in which new versions are reviewed and tested before changing the pin.
- Pin
