T08 · Insecure Dependencies
- Location
- scripts/lightning/add-lightning.sh:7
- Finding
- Unpinned npm Dependency Executed with Wallet Credentials## Vulnerability Details **File Location**: All shell wrappers under `scripts/lightning/`; representative instance: `scripts/lightning/add-lightning.sh:7-9` **Vulnerability Type**: Unpinned third-party runtime dependency **Risk Level**: High ### Vulnerable Code ```bash source ~/.archon.env npx @didcid/keymaster add-lightning "$@" ``` Equivalent unpinned `npx @didcid/keymaster` invocations appear in: - `scripts/lightning/add-lightning.sh:7-9` - `scripts/lightning/lightning-balance.sh:7-9` - `scripts/lightning/lightning-check.sh:8-10` - `scripts/lightning/lightning-decode.sh:7-9` - `scripts/lightning/lightning-invoice.sh:7-9` - `scripts/lightning/lightning-pay.sh:8-15` - `scripts/lightning/lightning-payments.sh:7-9` - `scripts/lightning/lightning-zap.sh:8-15` - `scripts/lightning/publish-lightning.sh:7-9` - `scripts/lightning/unpublish-lightning.sh:7-9` The documentation also recommends direct unpinned execution at `SKILL.md:407-421`. ### Technical Analysis Every executable wrapper loads `~/.archon.env` and then invokes `@didcid/keymaster` through `npx` without specifying an exact package version. The project contains no package manifest, committed lockfile, integrity constraint, or requirement that an audited local installation be used. Depending on the local npm and `npx` state, this can cause the current registry release to be downloaded and executed. Consequently, the effective implementation may change after this skill has been reviewed. The downloaded process inherits the wrapper's environment, including sensitive variables documented as: - `ARCHON_WALLET_PATH` - `ARCHON_PASSPHRASE` - `ARCHON_GATEKEEPER_URL` The dependency also receives authority to perform Lightning wallet and payment operations. Although no malicious behavior was found in the reviewed repository, the externally supplied runtime implementation is outside the audited code and remains mutable. ### Attack Path 1. An attacke ...[truncated 1688 chars]
- Remediation
- ## Remediation Suggestions 1. Add a project package manifest and pin `@didcid/keymaster` to a reviewed exact version rather than a range. 2. Commit the generated lockfile and install dependencies with `npm ci`, preserving npm integrity metadata. 3. Invoke only the local audited executable, such as: ```bash npx --no-install @didcid/keymaster add-lightning "$@" ``` Alternatively, call the package binary directly from `node_modules/.bin`. 4. Separate dependency installation from wallet operations. Do not permit package download or installation lifecycle scripts to run after wallet credentials have been loaded. 5. Verify package provenance and signatures where supported, and review dependency updates before changing the pinned version. 6. Use automated dependency scanning and lockfile-diff review in continuous integration. 7. Minimize credential exposure by supplying sensitive variables only to the already-installed runtime process and by restricting wallet-file permissions. 8. Apply the same remediation to every wrapper and to the direct `npx` commands documented in `SKILL.md`.
