T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:29
- Finding
- Plaintext Exposure of Eastmoney API Keys from the Credential Vault## Vulnerability Details **File Location**: `SKILL.md`, lines 29 and 48 **Vulnerability Type**: Plaintext credential disclosure through insecure operational instructions **Risk Level**: Medium The Skill instructs the agent or user to print the entire Eastmoney credential file on two occasions: ```bash cat ~/.openclaw/workspace/vault/credentials/eastmoney.json ``` The documented credential structure confirms that this command can expose every stored API key: ```json { "name": "Eastmoney API Keys", "keys": [ "mkt_xxx1", "mkt_xxx2", "mkt_xxx3" ] } ``` ### Technical Analysis Access to an Eastmoney API credential is necessary for the declared financial-data functionality. However, printing the complete credential file with `cat` is not necessary to authenticate API requests and violates least-disclosure principles. Executing the documented command places all API keys in plaintext terminal output and potentially in the agent's active context. The secrets may subsequently be retained in command logs, conversation transcripts, debugging records, monitoring systems, screen captures, or other output-processing components. The risk is amplified by the multi-key configuration: instead of exposing only the key required for one request, the command reveals every key in the rotation pool. The project does not explicitly instruct the agent to transmit the vault file to an unrelated endpoint, so this finding is credential exposure rather than confirmed credential exfiltration. ### Attack Path 1. A user or agent follows the documented vault configuration or fallback instructions. 2. The command `cat ~/.openclaw/workspace/vault/credentials/eastmoney.json` is executed. 3. Every Eastmoney API key in the file is written to terminal output and possibly incorporated into agent or execution logs. 4. An attacker with access to retained logs, transcripts, monitoring output, screen captures, or another output ...[truncated 936 chars]
- Remediation
- ## Remediation Suggestions 1. Remove both instructions that use `cat` to display the credential file. 2. Read and parse the file locally without writing secret values to standard output, standard error, logs, or conversational context. 3. Extract only one key when needed and pass it directly into the `apikey` request header. Avoid storing the extracted value in command history or verbose debugging output. 4. Prefer environment-based secret injection or a dedicated secret manager that returns credentials directly to the requesting process. 5. If documentation needs to verify configuration, use a non-disclosing presence and readability check, such as: ```bash test -r ~/.openclaw/workspace/vault/credentials/eastmoney.json ``` 6. Enforce restrictive ownership and permissions on the credential file, such as owner-only read and write access. 7. Redact API keys from errors, retry diagnostics, HTTP traces, and agent-visible tool output. 8. Load and try keys incrementally rather than exposing the complete rotation pool at once. 9. Rotate all keys if the documented `cat` command has previously been executed in a logged or retained environment.
