T09 · Insecure Skill Coding Practices
- Location
final_integration_test.sh:17- Finding
API Key Disclosure Through Shell Tracing and Command-Line Expansion
- Content
View full analysis
/dev/null; mkdir -p $REMOTE_PLUGIN_DIR && tar -xzf - -C $REMOTE_PLUGIN_DIR" # 2) Remove existing plugin and install echo "Step 2: Installing plugin..." ssh -o ConnectTimeout=120 "$REMOTE_HOST" "set -x ; rm -rf /home/node/.openclaw/extensions/nano-gpt 2>/dev/null; rm ~/.openclaw/agents/main/sessions/* ;cd '$REMOTE_PLUGIN_DIR'; openclaw plugins install '$REMOTE_PLUGIN_DIR' " # 3) Start gateway echo "Step 3: Starting gateway..." ssh -o ConnectTimeout=30 "$REMOTE_HOST" "nohup openclaw gateway run > /tmp/gateway.log 2>&1 & sleep 5; openclaw gateway health" # 4) Onboard with NanoGPT echo "Step 4: Onboarding with NanoGPT..." ssh -o ConnectTimeout=30 "$REMOTE_HOST" "openclaw onboard --non-interactive --accept-risk --nano-gpt-api-key \"$NANOGPT_API_KEY\" --flow quickstart --skip-health" ``` ### Technical Analysis The script enables `set -x` before expanding `NANOGPT_API_KEY` into an SSH command. Shell tracing prints expanded commands to standard error, so the real API key can be written to interactive terminal output, CI logs, build logs, or other log collectors. The key is also supplied as a command-line argument to `openclaw onboard`. Depending on process visibility and timing, command arguments may be observable through process-inspection interfaces on the remote system. The remote installation command independently enables `set -x`, demonstrating that traced execution is part of the test workflow. Although transmitting the key to NanoGPT is necessary for the provider, exposing it through diagnostic tracing ...[truncated 874 chars]- Remediation
View remediation
