T08 · Insecure Dependencies
Warning
- Location
- index.js:1
- Finding
- Raw Private Key Exposed to an Excessively Broad Dependency Surface## Vulnerability Details **File Location**: `index.js:1-2, 13-21`; `package.json:12-15`; `package-lock.json:1242-1277` **Vulnerability Type**: Excessive dependency privileges and sensitive key exposure **Risk Level**: Medium ### Vulnerable Code ```js const { Wormhole } = require('@wormhole-foundation/sdk'); const { UniversalAddress } = require('@wormhole-foundation/sdk-base'); // ... const transfer = await wh.tokenBridge().transfer( privateKey, chain, transferAmount, 'USDC', new UniversalAddress(toAddress, 'hex') ); ``` ```json "dependencies": { "@wormhole-foundation/sdk": "^4.9.1", "@wormhole-foundation/sdk-base": "^4.9.1" } ``` The umbrella SDK entry in `package-lock.json:1242-1277` installs adapters for Algorand, Aptos, CosmWasm, EVM, Solana, Stacks, and Sui, including their associated bridge and network components. ### Technical Analysis The handler supplies the raw wallet private key directly to the third-party Wormhole SDK. The selected umbrella SDK introduces numerous network-capable chain adapters even though the Skill defaults to Solana and only needs the components required for the selected source chain. This dependency surface exceeds the minimum privileges and code footprint required for the declared functionality. Any dependency receiving or operating near raw signing material becomes security-critical. The lockfile also contains deprecated CosmJS cryptographic components whose package notices explicitly warn about security-relevant bugs and possible private-key risk at `package-lock.json:197` and `package-lock.json:522`. The audit did not identify a malicious package or confirmed key-exfiltration routine. The risk arises from exposing highly sensitive signing material to an unnecessarily broad transitive dependency graph and from retaining dependencies with explicit cryptographic security warnings. ### Attack Path 1. An attacker compromises, replaces, or exploits a ...[truncated 1032 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the umbrella `@wormhole-foundation/sdk` dependency with the smallest reviewed set of chain-specific packages required for the supported transfer path. 2. If only Solana is supported, reject all other chains and install only the Solana and common bridge components. 3. Do not pass raw private-key strings through general application APIs. Accept a constrained signer interface, hardware-wallet adapter, isolated signing service, or callback that signs only a fully constructed and approved transaction. 4. Remove or upgrade dependency paths that include deprecated CosmJS cryptographic packages with private-key security warnings. 5. Pin exact reviewed dependency versions instead of permissive caret ranges, retain integrity hashes, and use automated dependency vulnerability and provenance scanning. 6. Display the complete transaction details and require explicit user approval before invoking the signer. 7. Run the Skill in a sandbox with outbound network access restricted to the exact testnet RPC and Wormhole endpoints required for operation.
