T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:94
- Finding
- Credentials Stored in a Shared OpenClaw Environment File## Vulnerability Details **File Location**: `SKILL.md`, lines 94-105 **Vulnerability Type**: Shared plaintext credential configuration **Risk Level**: Medium ### Vulnerable Snippet ```bash 在 `~/.openclaw/.env` 中配置: # 折淘客(必需) export ZHETAOKE_APP_KEY=xxx export ZHETAOKE_SID=xxx # 京东联盟(京东功能必需) export JD_UNION_ID=xxx # 淘宝联盟(淘宝功能必需) export TAOBAO_PID=mm_xxx_xxx_xxx ``` ### Technical Analysis The documentation directs users to store affiliate service credentials in the shared `~/.openclaw/.env` file. This is not a Skill-scoped credential location and may be accessible to unrelated Skills or local processes operating under the same account. The documentation does not specify restrictive file permissions, credential isolation, or controls limiting which processes receive these environment variables. Although no hardcoded credential values are present, the recommended configuration pattern weakens least-privilege boundaries. The package contains no scripts, so direct reading or exfiltration of the credentials by this Skill could not be confirmed. ### Attack Path 1. A user stores valid `ZHETAOKE_APP_KEY`, `ZHETAOKE_SID`, `JD_UNION_ID`, and `TAOBAO_PID` values in `~/.openclaw/.env`. 2. The file is left with permissive permissions, or its variables are loaded into an environment shared with other Skills or processes. 3. Another process running under the user's account reads the file or inherited environment. 4. The exposed values are reused to access affiliate services, consume API quotas, or conduct actions attributed to the user's affiliate accounts. ### Impact Assessment Exposure is limited to the affiliate credentials placed in the shared file and to the permissions granted to those credentials. Depending on provider-side authorization, an attacker could make unauthorized API requests, consume quotas, access affiliate information, manipulate attribution, or cause activity to be associated with the victim's acco ...[truncated 127 chars]
- Remediation
- ## Remediation Suggestions - Store each credential in an OpenClaw-supported secret manager or a Skill-scoped credential store rather than a workspace-wide environment file. - Expose only the credentials required for the specific command being executed. - If file-based storage is unavoidable, use a dedicated file outside the project directory and restrict it to the owning user, such as with mode `0600`. - Do not export credentials globally or pass them to unrelated child processes. - Document the minimum provider-side scopes required for every credential. - Add credential rotation and revocation guidance for suspected exposure. - Ensure diagnostic output and error handling never print credential values.
