T09 · Insecure Skill Coding Practices
- Location
tavily-config.sh:3- Finding
Shared credential file is imported with excessive scope
- Content
View full analysis
~/.openclaw/.env" exit 1 fi ``` ### Technical Analysis The Skill only requires `TAVILY_API_KEY`, but the command at line 7 reads every non-comment entry from the shared `~/.openclaw/.env` file and exports all of them into the process environment. This violates least privilege because unrelated API keys, tokens, passwords, and service credentials stored in the same file are made available to every subsequently launched child process. The `export $(grep ... | xargs)` construction is also not a safe `.env` parser. It relies on shell word splitting and `xargs` tokenization, so values containing whitespace, quoting, backslashes, or malformed assignments can be altered or interpreted incorrectly. File paths are also inconsistently quoted in the pipeline. No code in the audited project was found to transmit these credentials directly. The vulnerability is the unnecessary expansion of credential exposure and the resulting opportunity for another invoked component to read them. ### Attack Path 1. The shared `~/.openclaw/.env` contains `TAVILY_API_KEY` and one or more unrelated secrets. 2. The helper is sourced or executed as part of the technical-evaluation workflow. 3. Line 7 exports every non-comment entry rather than selecting only `TAVILY_API_KEY`. 4. A later tool, presentation generator, shell command, or compromised child pro ...[truncated 587 chars]- Remediation
View remediation
&2 exit 1 fi ``` If file-based loading is mandatory, use a dedicated file and parse only the exact key with strict validation. ]]>
