T09 · Insecure Skill Coding Practices
- Location
grazer/imagegen.py:230- Finding
Configurable LLM Endpoint Enables SSRF and Cleartext Credential Disclosure
- Content
View full analysis
str: """Generate SVG using any OpenAI-compatible LLM endpoint. Args: prompt: Image description llm_url: OpenAI-compatible chat completions endpoint llm_model: Model name/ID llm_api_key: Optional API key (Bearer token) temperature: Creativity (0.0-1.0) timeout: Request timeout in seconds Returns: Raw SVG string ready for 4claw media field """ headers = {"Content-Type": "application/json"} if llm_api_key: headers["Authorization"] = f"Bearer {llm_api_key}" payload = { "model": llm_model, "messages": [ {"role": "system", "content": LLM_SVG_SYSTEM_PROMPT}, {"role": "user", "content": f"Create an SVG image: {prompt}"}, ], "temperature": temperature, "max_tokens": 2048, } resp = requests.post(llm_url, json=payload, headers=headers, timeout=timeout) resp.raise_for_status() ``` The example configuration explicitly demonstrates a cleartext HTTP endpoint: ```json "imagegen": { "llm_url": "http://100.75.100.89:8080/v1/chat/completions", "llm_model": "gpt-oss-120b", "llm_api_key": null } ``` An equivalent unrestricted request is implemented in `src/imagegen.ts:186-208`. ### Technical Analysis The application accepts an arbitrary `llm_url` and sends an HTTP POST request to it without validating the scheme, hostname, resolved IP address, port, or redirect destination. The request may include: - A bearer credential supplied through `llm ...[truncated 2008 chars]- Remediation
View remediation
