T09 · Insecure Skill Coding Practices
Warning
- Location
- INSTALL.md:123
- Finding
- Tavily API Key Exposed by Troubleshooting Command<![CDATA[ ## Vulnerability Details **File Location**: `INSTALL.md`, line 123 **Vulnerability Type**: Credential disclosure through terminal output **Risk Level**: Medium ### Vulnerable Code ```bash cat ~/.openclaw/.env | grep TAVILY ``` ### Technical Analysis The troubleshooting command prints every line containing `TAVILY` from the OpenClaw environment file. In the documented configuration, this includes the complete `TAVILY_API_KEY` value. Although the command does not transmit the credential directly, it exposes the secret in plaintext through terminal output. The key may subsequently be captured by terminal session recording, command output logging, support screenshots, shared shells, CI logs, or other users with access to the active terminal. Reading the environment file is related to diagnosing configuration, but disclosing the complete value exceeds the minimum access necessary. Troubleshooting only needs to determine whether the variable is present and nonempty. ### Attack Path 1. A user experiences a search error and follows the documented troubleshooting instructions. 2. The command reads `~/.openclaw/.env`. 3. The full `TAVILY_API_KEY` assignment is printed to the terminal. 4. Terminal logging, a support screenshot, screen sharing, or another local observer captures the output. 5. An unauthorized party reuses the disclosed key to access Tavily under the victim's account. ### Impact Assessment An attacker who obtains the key can make Tavily API requests using the victim's account. This can consume the victim's quota, cause service disruption, and potentially incur charges according to the associated Tavily plan. The exposure does not by itself grant operating-system privileges or access to unrelated credentials. Its scope is primarily the Tavily account and resources authorized by the disclosed API key. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions Replace the command with a presence check that never prints the secret value: ```bash if grep -q '^TAVILY_API_KEY=.\+' ~/.openclaw/.env; then echo "Tavily API key is configured." else echo "Tavily API key is missing or empty." fi ``` Additional hardening measures: 1. Recommend file permissions of `0600` for `~/.openclaw/.env`. 2. Prefer an operating-system secret store or OpenClaw-supported secret manager over a plaintext environment file. 3. Warn users not to include API keys in screenshots, logs, or support requests. 4. If diagnostic output must identify a key, display only a short masked suffix. 5. Rotate any API key that has already been exposed through logs or shared terminal output. ]]>
