T09 · Insecure Skill Coding Practices
- Location
scripts/review.py:125- Finding
Undisclosed transmission of repository source-code diffs to a configurable external endpoint
- Content
View full analysis
Dict[str, Any]: api_key = os.getenv("LLM_API_KEY") api_url = os.getenv("LLM_API_URL", "https://api.deepseek.com/v1/chat/completions") model = os.getenv("LLM_MODEL", "deepseek-chat") if not api_key: return {"error": "LLM_API_KEY not set"} ``` ```python payload = { "model": model, "temperature": 0, "messages": [{"role": "user", "content": prompt}], } data = post_with_retry( api_url, headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}, payload=payload, timeout=180, ) ``` The prompt contains the reviewed Git diff, truncated to 120,000 characters: ```python Diff: {diff_text[:120000]} ``` The request helper sends that payload to the supplied URL: ```python r = requests.post(url, headers=headers, json=payload, timeout=timeout) ``` ### Technical Analysis The review operation reads changed source code from a Git repository and embeds it in an LLM prompt. The resulting payload is transmitted to `LLM_API_URL`, which is entirely controlled through an environment variable and is not restricted to an approved host or HTTPS scheme. External LLM processing may be necessary for the optional LLM review feature. However, the implementation exceeds a safe least-disclosure model because: - External transmission is enabled by the normal review workflow rather than by explicit per-run consent. - The active `SKILL.md` does not disclose that repository contents leave the local environment. - No secret scanning or redaction is applied before transmission. - No destination allowlist or certificate-policy hardening is im ...[truncated 1668 chars]- Remediation
View remediation
