T08 · Insecure Dependencies
- Location
scripts/setup.sh:20- Finding
Unpinned npm Package Is Downloaded and Executed During Setup
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup.sh, lines 20-22
Vulnerability Type: Unpinned third-party dependency execution
Risk Level: Highbash # Verify ClawPay CLI is accessible echo "Checking ClawPay CLI..." npx @clawpay-hedera/sdk --versionTechnical Analysis
The setup script invokes
npxusing only the package name, without a fixed version, lockfile, or integrity hash. If the package is not already available in the local cache,npxcan resolve and download the package associated with the registry's current distribution tag and execute its lifecycle or CLI code.Consequently, the code executed by a previously reviewed version of this skill can change without any modification to this repository. Compromise of the npm publisher account, package ownership, registry resolution, or a newly published malicious version could result in arbitrary code execution.
The child process also inherits the setup script's environment. Because this skill requires
HEDERA_PRIVATE_KEY, a malicious package version could read and exfiltrate that private key in addition to executing commands with the invoking user's privileges. There is no evidence in the reviewed files that the current package is malicious; the vulnerability is the absence of dependency pinning and integrity verification.Attack Path
- An attacker compromises the npm publisher account or otherwise gains the ability to publish a malicious version of
@clawpay-hedera/sdk. - The malicious release becomes the version resolved by the package's default distribution tag.
- A user runs
scripts/setup.sh. - Line 22 downloads or resolves the attacker-controlled version and executes it through
npx. - The package reads inherited environment variables, including
HEDERA_PRIVATE_KEY, and sends them to an attacker-controlled endpoint. - The package may additionally modify files, access user data, install persistence, or execute other ...[truncated 554 chars]
- An attacker compromises the npm publisher account or otherwise gains the ability to publish a malicious version of
- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to a specifically reviewed version, for example
npx --yes @clawpay-hedera/sdk@1.2.3 --version. - Prefer declaring the package in a committed
package.jsonand lockfile, then installing it withnpm ci, which enforces locked package versions and integrity metadata. - Review the complete transitive dependency tree whenever the pinned version is updated.
- Run dependency installation and verification before placing sensitive keys in the environment.
- Execute third-party tooling in a restricted environment with only the minimum required files, network access, and environment variables.
- Consider disabling lifecycle scripts during installation where compatible, while recognizing that this does not make execution of an untrusted CLI safe.
- Verify package provenance or signatures through an approved artifact registry before execution.
- Pin the CLI to a specifically reviewed version, for example
