T09 · Insecure Skill Coding Practices
- Location
SKILL.md:268- Finding
Shell Command Injection in the Embedding Service Request
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This RAG retrieval skill has a coherent purpose, but it needs Review because its normal retrieval path can expose user code and contains unsafe shell-based requests that could run injected commands.
Review this skill carefully before installing. Use it only with trusted local embedding, reranking, LLM, and TiDB services; avoid sensitive repositories until the shell-based curl calls are replaced with structured HTTP client calls, user-codebase retrieval is opt-in, and TiDB uses a scoped read-only account.
SKILL.md:268Shell Command Injection in the Embedding Service Request
SKILL.md:325Shell Command Injection in the Reranking Service Request
SKILL.md:355User Source Code May Be Disclosed to a Configurable LLM Endpoint
SKILL.md:283TiDB Retrieval Uses an Unrestricted Root Account
The unconditional trigger 'always called by coding-orchestrator before generation' causes this skill to run on every coding task, including ones that may contain secrets, proprietary code, or sensitive prompts. Because this skill performs networked retrieval and optional inclusion of user codebase chunks, overly broad auto-invocation increases unintended data exposure and expands the attack surface without explicit user consent.
The standalone trigger 'find docs about X' is vague and underspecified, which can cause the skill to activate for loosely related requests and send user queries to retrieval, embedding, reranking, and database components unexpectedly. In this skill's context, vague activation is more dangerous because it can include user_codebase material and route content through multiple services.
The skill does not warn users that their queries and potentially user_codebase content may be transmitted to localhost network services for embedding and reranking. Even if those services are local, they are separate network-reachable processes with their own logging and compromise risks, so the lack of disclosure undermines informed consent and safe handling of sensitive code.
The embedding helper transmits supplied text to an HTTP service using curl, which creates a real data-exposure path for user queries and potentially sensitive code fragments. In this skill, the risk is amplified because the tool is broadly triggered and supports user_codebase retrieval, so proprietary source or secrets present in prompts can be sent to another process or service without strong validation, authentication, or user awareness.
# Assumes an embedding model is loaded globally
# In practice, run a persistent MLX server and HTTP call it
response = await shell.run(
f"curl -X POST http://localhost:8888/embed "
f"-H 'Content-Type: application/json' "
f"-d '{json.dumps({\"texts\": texts})}'"
)
The docstring at L261-L262 says embeddings are produced 'via local MLX nomic-embed-text or bge-m3', suggesting in-process local model use. The actual code at L268-L272 invokes curl against http://localhost:8888/embed, and even comments at L267 acknowledge an HTTP call instead, so the documentation contradicts the implementation approach.
The docstring at L317-L318 says candidates are reranked 'using bge-reranker-v2-m3 (local)'. In practice, L325-L329 shell out to curl and call http://localhost:8889/rerank, which is a different execution model than the documentation implies; the nearby comment at L324 confirms this networked endpoint behavior.