T08 · Insecure Dependencies
- Location
- lib/farcaster.sh:4
- Finding
- Mutable External Programs Receive Social-Media Credentials and Wallet Private Keys<![CDATA[ ## Vulnerability Details **File Location**: `lib/twitter.sh:4, 31-35, 73`; `lib/farcaster.sh:4, 23-51, 110-146` **Vulnerability Type**: Untrusted external dependency execution with inherited secrets **Risk Level**: Critical ### Vulnerable Code ```bash # lib/twitter.sh TWITTER_POST_SCRIPT="/home/phan_harry/.openclaw/workspace/scripts/twitter-post.sh" twitter_post_text() { local text="$1" local reply_to_id="$2" get_twitter_credentials if [ ! -f "$TWITTER_POST_SCRIPT" ]; then echo "Error: Twitter post script not found at $TWITTER_POST_SCRIPT" >&2 return 1 fi # ... "$TWITTER_POST_SCRIPT" "$text" } ``` ```bash # lib/farcaster.sh FARCASTER_REPO="/home/phan_harry/.openclaw/workspace/skills/farcaster-agent/repo" cd "$FARCASTER_REPO" && \ PRIVATE_KEY="$private_key" \ SIGNER_PRIVATE_KEY="$signer_key" \ FID="$fid" \ npm run cast "$text" 2>&1 | grep -E "(Cast hash|URL|Error)" | tail -2 ``` The image and reply paths similarly execute Node.js code from the external Farcaster repository while exposing the private keys through environment variables: ```bash cd "$FARCASTER_REPO" && PRIVATE_KEY="$private_key" \ SIGNER_PRIVATE_KEY="$signer_key" \ FID="$fid" \ IMAGE_URL="$image_url" \ PARENT_HASH="${parent_hash:-}" node -e " const { Wallet, JsonRpcProvider } = require('ethers'); const { makeCastAdd, NobleEd25519Signer, FarcasterNetwork, Message } = require('@farcaster/hub-nodejs'); const { submitMessage } = require('./src/x402'); // ... " "$text" ``` ### Technical Analysis The Skill relies on executable components outside the audited project: - `/home/phan_harry/.openclaw/workspace/scripts/twitter-post.sh` - `/home/phan_harry/.openclaw/workspace/skills/farcaster-agent/repo` These external components are not bundled, version-pinned, integrity-checked, or otherwise authenticated by this project. The X posting script inherits the exported OAuth credentials from the calling shell. The Farcaster dependency explicitly receives the custody wa ...[truncated 1373 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Bundle all security-sensitive posting logic within the reviewed Skill package. 2. Pin Node.js and Python dependencies with lockfiles and verified hashes. 3. Verify the ownership, permissions, canonical path, and cryptographic digest of any unavoidable external executable before invocation. 4. Do not pass custody private keys to mutable external programs. Isolate signing in a narrowly scoped, reviewed component. 5. Use a dedicated wallet with minimal funds and permissions for Farcaster payments. 6. Avoid exporting credentials globally. Pass only the exact required values to a trusted child process. 7. Replace the external Twitter posting script with the bundled OAuth implementation, or include and audit that script. 8. Document every external executable dependency in the Skill metadata and fail closed if its integrity cannot be established. ]]>
