T09 · Insecure Skill Coding Practices
- Location
SKILL.md:25- Finding
API Key Disclosed Through Verification and Troubleshooting Commands
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be for Gemini image generation, but its setup can expose your API key and its declared command permissions are broader than needed.
Install only if you are comfortable giving the skill access to a Gemini API key and sending prompts or source images to Google services. Do not run the documented echo commands for GEMINI_API_KEY; use a boolean presence check instead, and consider narrowing/removing the broad curl and unrestricted python3 permissions before use.
SKILL.md:25API Key Disclosed Through Verification and Troubleshooting Commands
SKILL.md:12Overly Broad Bash Network and Code-Execution Permissions
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Project .env file:
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore # add immediately — never commit keys
source .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Project .env file:
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore # add immediately — never commit keys
source .env
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo 'GEMINI_API_KEY=your-key-here' >> .env
echo ".env" >> .gitignore # add immediately — never commit keys
source .env
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
## API Reference
| Property | Value |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| Model | `gemini-3.1-flash-image-preview` |
| Endpoint | `https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-image-preview:generateContent` |
The search-grounded operation explicitly enables googleSearch with webSearch and imageSearch, which causes user prompts to be sent to external live search services. The skill metadata and workflow mention grounded generation but do not clearly warn that prompt contents may leave the local environment and be disclosed to third parties, creating a privacy and data-handling risk if users include sensitive project details, internal names, or personal data in prompts.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
### Step 1: Obtain a Key
1. Go to https://aistudio.google.com/app/apikey
2. Create a new project key or copy an existing one
3. Confirm the key has access to `gemini-3.1-flash-image-preview`
### Step 2: Set the Environment Variable