T09 · Insecure Skill Coding Practices
Warning
- Location
- INSTALL_FOR_AGENTS.md:41
- Finding
- Agent-driven installation workflow exposes the HeyGen API key to conversation logs and terminal history< (Settings → API → New Key). Tell them: *the key is shown once, copy it before closing the modal.* ``` The guide subsequently recommends handling the secret in the shell: ```bash # Env-var path (faster, agent-friendly): export HEYGEN_API_KEY=hg_... # Or config-file path: openclaw onboard --auth-choice heygen-api-key ``` During troubleshooting, it recommends printing the credential: ```markdown Check `~/.openclaw/openclaw.json` for `plugins.entries.heygen.auth.apiKey`, or `echo $HEYGEN_API_KEY` in the same shell that started the gateway. ``` The README initiates this workflow with: ```text Read https://raw.githubusercontent.com/heygen-com/openclaw-plugin-heygen/main/INSTALL_FOR_AGENTS.md and follow it. Ask me for any API keys you need. ``` ### Technical Analysis The installation workflow explicitly tells an AI agent to ask the user for the complete HeyGen API key. Secrets supplied through an agent conversation can be retained in conversation history, application telemetry, model-provider logs, debugging traces, or orchestration records. The `echo $HEYGEN_API_KEY` troubleshooting instruction creates another unnecessary disclosure channel by writing the complete secret to terminal output. Depending on the host, terminal output may also be captured by the agent, CI logs, session recording, or centralized logging. This exceeds minimum privilege because the agent does not need to read or reproduce the secret. The existing interactive command, `openclaw onboard --auth-choice heygen-api-k ...[truncated 1539 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove all instructions asking users to paste API keys into an agent conversation. 2. Replace the README bootstrap text with wording such as: ```text Never request or display the API key. Ask the user to enter it privately through the OpenClaw authentication prompt. ``` 3. Make the interactive onboarding mechanism the preferred setup path: ```bash openclaw onboard --auth-choice heygen-api-key ``` 4. Remove `echo $HEYGEN_API_KEY` from troubleshooting guidance. 5. Troubleshoot only whether a value is configured, without displaying it. Use an OpenClaw command that reports configuration status in redacted form. 6. If environment-variable setup remains documented, instruct the user to configure it outside the agent session through a secret manager or private terminal. 7. Ensure configuration inspection automatically redacts `plugins.entries.heygen.auth.apiKey`. 8. Recommend immediate key revocation and rotation if a key has already been pasted into chat or printed in recorded terminal output. ]]>
