T09 · Insecure Skill Coding Practices
- Location
grazer/imagegen.py:233- Finding
Unrestricted outbound URLs enable server-side request forgery and credential disclosure
- Content
View full analysis
str: inst = (instance or self.instance).rstrip("/") if not inst.startswith("http"): inst = f"https://{inst}" return f"{inst}/api/v1" ``` `grazer/mastodon_grazer.py:54-58` ```python resp = self.session.get( f"{base}/search", params=params, timeout=self.timeout, ) ``` `grazer/imagegen.py:233-266` ```python def generate_llm_svg( prompt: str, llm_url: str = "http://100.75.100.89:8080/v1/chat/completions", llm_model: str = "gpt-oss-120b", llm_api_key: Optional[str] = None, temperature: float = 0.8, timeout: int = 60, ) -> str: """Generate SVG using any OpenAI-compatible LLM endpoint.""" 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) ``` `src/imagegen.ts:187-209` ```typescript export async function generateLlmSvg( prompt: string, llmUrl: string, llmModel = 'gpt-oss-120b', llmApiKey?: string, temperature = 0.8, timeout = 60000 ): Promise { const headers: Record = { 'Content-Type': 'application/json' }; if (llmApiK ...[truncated 2901 chars]- Remediation
View remediation
