T08 · Insecure Dependencies
Error
- Location
- scripts/backup/backup-to-vault.sh:43
- Finding
- Unpinned npm Package Is Downloaded and Executed During Sensitive Operations<![CDATA[ ## Vulnerability Details **File Location**: `scripts/backup/backup-to-vault.sh:43,58,65,72`; `scripts/backup/disaster-recovery.sh:59,65,71,75,93,99-123`; `scripts/backup/restore-from-vault.sh:23-87`; `scripts/backup/verify-backup.sh:44`; all scripts under `scripts/vaults/` **Vulnerability Type**: Unpinned runtime dependency and supply-chain exposure **Risk Level**: High ### Vulnerable Code ```bash npx @didcid/keymaster add-vault-item backup /tmp/workspace.zip ``` Other security-sensitive invocations use the same unpinned package, including: ```bash npx @didcid/keymaster import-wallet "$MNEMONIC" > /dev/null npx @didcid/keymaster recover-wallet-did > /dev/null npx @didcid/keymaster get-vault-item backup workspace.zip "$RESTORE_DIR/workspace.zip" ``` ### Technical Analysis The scripts execute `@didcid/keymaster` through `npx` without specifying an exact package version. The project also contains no reviewed lockfile that constrains the package and its transitive dependencies. Depending on the local npm state, `npx` may download and execute the package version currently resolved by the configured registry. Consequently, the code that runs during backup, restoration, wallet reconstruction, and vault management can change after this project has been audited. These invocations occur while highly sensitive values and resources are available, including: - `ARCHON_PASSPHRASE` - `ARCHON_WALLET_PATH` - The disaster-recovery mnemonic - Workspace and OpenClaw configuration archives - Decrypted vault items - Vault membership and access-control operations A compromised package release, registry account, registry configuration, or dependency could therefore execute arbitrary code with the invoking user's permissions. ### Attack Path 1. An attacker compromises the `@didcid/keymaster` package, one of its dependencies, its publisher account, or the npm registry resolution path. 2. The attacker publishes or causes resolution to a modified package version. 3. ...[truncated 934 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `@didcid/keymaster` to a reviewed exact version rather than using an unconstrained package name. 2. Add and commit a lockfile that fixes all transitive dependency versions and integrity hashes. 3. Install dependencies during a controlled deployment phase rather than during sensitive operations. 4. Invoke the locally installed package with a command that forbids network installation, such as: ```bash npx --no-install keymaster ... ``` 5. Configure npm to use a trusted registry and enforce lockfile integrity in CI. 6. Review package provenance and signatures where available. 7. Run the dependency under a restricted account or sandbox with access only to the specific files required for the requested operation. 8. Avoid exposing secrets to the package through command-line arguments. ]]>
