T09 · Insecure Skill Coding Practices
- Location
SKILL.md:74- Finding
Unnecessary plaintext Gemini API credential setup
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 74-79
Vulnerability Type: Unnecessary plaintext secret storage
Risk Level: MediumVulnerable Code
markdown ## Requirements - **ChromaDB** — Local vector database (`pip install chromadb`) - **Gemini API key** — For generating embeddings (optional, falls back to text search) - Get key at: https://makersuite.google.com/app/apikey - Save to: `~/.openclaw/credentials/gemini.json` as `{"api_key": "YOUR_KEY"}`Technical Analysis
The setup instructions direct users to place a Gemini API key in a plaintext JSON file without requiring owner-only file permissions or recommending a secret-management facility.
This credential is not necessary for the reviewed implementation.
semantic_memory.pyuses ChromaDB'sDefaultEmbeddingFunctionand does not read~/.openclaw/credentials/gemini.json. The instruction therefore requests sensitive credential storage beyond the minimum access necessary for the Skill's declared implementation.The documentation also conflicts with the code: it states that Gemini provides embeddings, while the implementation uses ChromaDB's built-in embedding function.
Attack Path
- A user follows the documented setup procedure.
- The user creates
~/.openclaw/credentials/gemini.jsoncontaining a valid API key. - The file receives permissions determined by the user's shell, editor, and umask because no restrictive mode is required.
- If those permissions allow access, another local account, unrelated process, backup service, or diagnostic tool reads the key.
- The exposed key is used against the associated Gemini account, subject to its configured permissions and quotas.
Impact Assessment
Successful exploitation can disclose the user's Gemini API credential. An attacker could consume the associated API quota, incur charges where billing is enabled, or access API capabilities granted to that key. T ...[truncated 162 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the Gemini credential instructions because the current implementation does not use that credential.
- Update the documentation to state that embeddings are generated by ChromaDB's built-in embedding function.
- If Gemini support is implemented later, obtain the credential from an environment variable, operating-system credential store, or dedicated secret manager.
- If file-based storage is unavoidable, create the credential directory with mode
0700and the credential file with mode0600. - Never log the API key or include it in command-line arguments.
- Document credential rotation and revocation procedures.
