T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:107
- Finding
- Unpinned Third-Party Package Execution with a Sensitive Wallet Credential< or any NWC-compatible wallet: ```bash npx @getalby/cli pay-invoice -c "NWC_CONNECTION_STRING" -i "BOLT11_INVOICE" ``` Returns `preimage`. ``` ### Technical Analysis The documented payment workflow uses `npx` to execute `@getalby/cli` without specifying an exact, audited version or verifying package integrity. Depending on the local npm configuration and cache state, `npx` may retrieve and execute the package and its dependency graph from the npm registry at invocation time. This creates a mutable supply-chain execution path whose effective code can change after the Skill has been reviewed. The invoked process also receives `NWC_CONNECTION_STRING`, a sensitive Nostr Wallet Connect credential, through a command-line argument. Package code necessarily gains access to that argument. On some systems, command-line arguments may additionally be visible through process inspection, diagnostic tooling, terminal logs, or shell history. The surrounding documentation states that this command is optional, requires operator approval, and is never automatically executed. Those controls reduce likelihood but do not remove the risk when an operator follows the documented programmatic payment procedure. ### Attack Path 1. An operator chooses the optional programmatic NWC payment workflow. 2. The operator runs the documented unversioned `npx @getalby/cli` command. 3. `npx` resolves the package and dependencies available from the configured npm registry. 4. A compromised package release, compromised transitive dependency, registry substitution, or unsafe registry configuration causes attacker-controlled code to execute with the operator's local privileges. 5. The mali ...[truncated 1185 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Avoid runtime package retrieval for wallet operations. Prefer an independently installed and reviewed wallet application or a preapproved client distributed through a trusted channel. 2. If the CLI remains documented, pin it to an exact audited version rather than invoking the floating package name: ```bash npx --yes @getalby/cli@EXACT_AUDITED_VERSION ... ``` Version pinning reduces mutability but should not be treated as sufficient integrity protection by itself. 3. Maintain a lockfile and verify package integrity, provenance, publisher identity, and signatures where supported. Review both the direct package and its transitive dependencies. 4. Configure npm to use an explicitly trusted registry and disable unexpected lifecycle scripts where compatible with the selected client. 5. Do not pass `NWC_CONNECTION_STRING` directly on the command line. Use a secure secret-input facility supported by the wallet client, such as protected standard input, a restricted file descriptor, or an operating-system credential store. 6. Run wallet tooling in a sandbox or dedicated low-privilege environment with narrowly restricted filesystem and network access. 7. Create a dedicated NWC connection with strict payment limits, short expiration, minimal methods, and no permissions unrelated to invoice payment. 8. Use a low-balance wallet and require explicit operator confirmation for every payment. Rotate the NWC credential immediately if command history, logs, or process inspection may have exposed it. 9. Add a prominent warning immediately above the command explaining that it may download and execute third-party code and that operators must verify the exact package version before use. ]]>
