T09 · Insecure Skill Coding Practices
- Location
scripts/xhs-image.py:49- Finding
Custom API endpoints can receive provider credentials and user-supplied images
- Content
View full analysis
bytes: """文生图""" url = f"{self.api_base.rstrip('/')}/v1/images/generations" payload = { "model": self.model, "prompt": prompt, "size": self.size, "n": 1, "response_format": "b64_json" } if seed is not None: payload["seed"] = seed headers = { "Authorization": f"Bearer {self.api_key}", "Content-Type": "application/json" } log_info(f"Generating image via {self.provider} ({self.model}) size {self.size}") try: response = requests.post(url, json=payload, headers=headers, timeout=120) response.raise_for_status() def edit(self, prompt: str, base_image_path: str, ...[truncated 5886 chars]- Remediation
View remediation
