T09 · Insecure Skill Coding Practices
- Location
SKILL.md:68- Finding
Sensitive API Key Exposed to an Unaudited External Script
- Content
View full analysis
" \ --filename "~/Projects/withme-youtube/images/originals/v{N}/scene_{i}.png" \ --resolution 2K ``` ### Technical Analysis The workflow reads a Google API key directly from the global OpenClaw configuration and places it in the environment of `/Users/withme/.openclaw/shared/generate_image.py`. That script is outside the audited project and was therefore not available for integrity or behavior verification. Although transmitting an API credential to the relevant image-generation provider is necessary for the declared functionality, directly granting an external script the raw credential is broader than necessary. The script can read, log, persist, or transmit the environment variable to any destination. The use of `uv run` may also involve dependency resolution whose security properties are not specified by this project. The issue is not evidence that the included Skill intentionally steals the key. It is a confirmed insecure trust boundary: sensitive information is extracted from a global credential store and delivered to code whose contents and integrity are not controlled by the audited package. ### Attack Path 1. An attacker gains the ability to replace or modify `/Users/withme/.openclaw/shared/generate_image.py`, or compromises code imported by that script. 2. A user invokes the image-generation stage of the Skill. 3. The embedded Python expression reads the Google API key from `$HOME/.openclaw/openclaw.json`. 4. The shell exports the key as `GEMINI_API_KEY` to the external process. 5. The compromised proces ...[truncated 772 chars]- Remediation
View remediation
