T09 · Insecure Skill Coding Practices
- Location
scripts/build_index.py:52- Finding
Document Contents Can Be Transmitted to an Arbitrary Plaintext Embedding Endpoint
- Content
View full analysis
list[float]: """Get embedding from Ollama API.""" response = requests.post( f"{api_url}/api/embeddings", json={"model": model, "prompt": text}, timeout=120 ) response.raise_for_status() return response.json()["embedding"] ``` The document chunks are passed directly to this function: ```python emb = get_embedding(chunk["text"], model, api_url) ``` The destination is caller-controlled: ```python parser.add_argument( "--api", "-a", default=DEFAULT_OLLAMA_API, help=f"Ollama API URL (default: {DEFAULT_OLLAMA_API})" ) ``` ### Technical Analysis Every indexed document is divided into chunks and placed in the `prompt` property of an HTTP POST request. The `--api` option permits the caller to select an arbitrary destination without: - Restricting the destination to loopback or another approved embedding service. - Requiring HTTPS for non-local endpoints. - Warning the user that document contents will leave the process. - Validating the hostname, IP address, port, URL scheme, or redirects. - Requiring explicit authorization before remote document processing. Use of an embedding service is necessary for semantic indexing. However, allowing unrestricted destinations exceeds the minimum network privileges needed for a locally oriented skill. It also conflicts with the offline and “No cloud” positioning in `SKILL.md`. This behavior creates both a confidentiality risk and an SSRF-like network-access primitive. The process can be instructed to send attacker-selected document content to an external server or make requests to internal HT ...[truncated 1568 chars]- Remediation
View remediation
