T08 · Insecure Dependencies
- Location
setup.sh:6- Finding
Unpinned Dependency Installation Creates Supply-Chain Risk
- Content
View full analysis
Vulnerability Details
File Location:
setup.sh:6andpackage.json:13-15
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: MediumAffected Code:
setup.sh:6bash npm install etherspackage.json:13-15json "dependencies": { "ethers": "^6.16.0" }Technical Analysis
The setup script installs
etherswithout requesting an exact version, whilepackage.jsonpermits any compatible minor or patch release through the caret constraint^6.16.0. The project does not include a lockfile in the audited artifact.Consequently, dependency resolution can change between installations without corresponding changes to the reviewed project. npm packages and their transitive dependencies can execute lifecycle scripts during installation. If a future compatible release or transitive dependency is compromised, running the documented setup command could execute attacker-controlled code with the privileges of the user performing the installation.
This finding does not establish that the current
etherspackage is malicious. It identifies an unsafe and non-reproducible dependency installation process.Attack Path
- An attacker compromises a future version of
etherspermitted by^6.16.0, or compromises one of its newly resolved transitive dependencies. - A user runs the documented
bash setup.shcommand. npm install ethersresolves and downloads the compromised package version because no reviewed lockfile fixes the dependency graph.- Malicious package code or an npm lifecycle script executes during installation or when
deploy-nft.jsimports the package. - The payload runs with the installing user's local privileges.
Impact Assessment
Successful exploitation could permit arbitrary code execution under the account running setup. Depending on that account's permissions, an attacker could read accessible files and environment variab ...[truncated 222 chars]
- An attacker compromises a future version of
- Remediation
View remediation
Remediation Suggestions
- Pin
ethersto an exact reviewed version rather than a caret range:json "dependencies": { "ethers": "6.16.0" } - Generate, review, and commit
package-lock.json. - Replace
npm install ethersin setup with deterministic installation:bash npm ci - Use
npm ci --ignore-scriptsif the selected dependency graph does not require lifecycle scripts. - Run dependency vulnerability and provenance checks in CI, and review lockfile changes before accepting dependency updates.
- Avoid running setup as root or another privileged account.
- Pin
