T09 · Insecure Skill Coding Practices
- Location
SKILL.md:38- Finding
Manual Health Check Exposes OpenAI and Pinecone API Keys
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent database health check, but one documented fallback command can print full OpenAI and Pinecone API keys into logs or chat output.
Review this skill before installing. Its normal script is mostly scoped to health checks, but avoid using the documented manual grep command unless it is changed to a redacted presence check. If these commands have already been run in captured logs or agent transcripts, rotate exposed OpenAI or Pinecone keys.
SKILL.md:38Manual Health Check Exposes OpenAI and Pinecone API Keys
The skill instructs the agent to read a local .env file and grep for sensitive credential names, which directly accesses secrets during routine health checks. Even though the stated purpose is configuration validation, this creates a credential-access path that could expose API keys in command output, logs, tool traces, or downstream summaries, especially in an adversarial or multi-tenant agent environment.
cd /home/Mike/.openclaw/workspace/rag-pinecone-starter
[ -f .env ] && grep -E '^(OPENAI_API_KEY|PINECONE_API_KEY)=' .env
If either key is blank, report as not connected yet.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# RAG/Pinecone check
if [ -d "$RAG_DIR" ]; then
env_file="$RAG_DIR/.env"
if [ ! -f "$env_file" ]; then
rag_status="WARN"
rag_detail="Missing .env file"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# RAG/Pinecone check
if [ -d "$RAG_DIR" ]; then
env_file="$RAG_DIR/.env"
if [ ! -f "$env_file" ]; then
rag_status="WARN"
rag_detail="Missing .env file"
This code reads API secrets directly from the .env file into shell variables. While done for a connectivity check, direct secret handling increases exposure risk because secrets may be inherited by subprocesses, captured in debugging/tracing, or accidentally surfaced through future logging or error-handling changes.
env_file="$RAG_DIR/.env"
if [ ! -f "$env_file" ]; then
rag_status="WARN"
rag_detail="Missing .env file"
else
openai_key=$(grep -E '^OPENAI_API_KEY=' "$env_file" | head -n1 | cut -d= -f2-)
pinecone_key=$(grep -E '^PINECONE_API_KEY=' "$env_file" | head -n1 | cut -d= -f2-)
No suspicious patterns detected.