T08 · Insecure Dependencies
Warning
- Location
- scripts/run.sh:8
- Finding
- Unpinned npm Package Is Automatically Downloaded and Executed## Vulnerability Details **File Location**: `scripts/run.sh:8` **Related Locations**: `SKILL.md:6`, `SKILL.md:17` **Vulnerability Type**: Unpinned third-party dependency and automatic remote package execution **Risk Level**: Medium ### Vulnerable Code ```sh if command -v npx >/dev/null 2>&1; then exec npx -y @edgefinder/cli "$@" fi ``` The corresponding package metadata and documentation also omit an exact version: ```json "package":"@edgefinder/cli" ``` ```markdown The wrapper prefers the installed `edgefinder` binary and falls back to `npx -y @edgefinder/cli`. ``` ### Technical Analysis The fallback invokes `npx` with `-y`, automatically accepting package installation and executing `@edgefinder/cli` without an exact version or integrity constraint. npm therefore resolves whichever package release is current at execution time. The effective executable can change after this Skill has been audited. This creates a supply-chain trust boundary: the wrapper delegates local code execution to mutable registry content. A compromised package publisher, malicious future release, or npm package-distribution compromise could cause arbitrary attacker-controlled JavaScript and package lifecycle behavior to execute. The local script does not independently verify the downloaded artifact's version, checksum, provenance, or signature. ### Attack Path 1. An attacker compromises the `@edgefinder/cli` publisher, its release pipeline, or the relevant package-distribution channel. 2. The attacker publishes a malicious release that is selected by npm's unversioned resolution. 3. A host invokes `scripts/run.sh` without an installed `edgefinder` executable but with `npx` available. 4. `npx -y @edgefinder/cli` automatically retrieves and executes the resolved package without user confirmation. 5. The malicious package runs with the privileges and environment of the user or Agent process. ### Impact Assessment A compromised dependency could execute arbitrary code with the ...[truncated 544 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@edgefinder/cli` to a reviewed exact version rather than relying on npm's current resolution. 2. Verify the downloaded package using an approved integrity hash, lockfile, trusted artifact registry, or equivalent provenance mechanism. 3. Remove the automatic `npx -y` fallback. Require an explicit, separately reviewed installation step when the binary is unavailable. 4. Prefer a locally installed dependency managed through a committed lockfile and reproducible deployment process. 5. Run the CLI with least privilege and a restricted environment. Pass only required environment variables and isolate filesystem and network access where practical. 6. Establish dependency monitoring and a controlled upgrade process so new releases are reviewed before execution.
