T09 · Insecure Skill Coding Practices
- Location
scripts/image_generator.py:171- Finding
Unrestricted Server-Supplied Image URL Enables SSRF
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This custom image generator is mostly transparent, but needs review because it can fetch arbitrary image URLs returned by a provider, including unintended internal addresses.
Install only if you trust the configured image API provider and are comfortable sending prompts and request metadata to it. Avoid sensitive prompts, review where images are saved, and prefer providers that return base64 image data or otherwise ensure returned image URLs cannot point to internal or untrusted destinations.
scripts/image_generator.py:171Unrestricted Server-Supplied Image URL Enables SSRF
The skill documents use of environment variables and outbound network access to a third-party API, but it does not declare any explicit tool scope or permissions. This creates a transparency and governance gap: an agent may invoke capabilities beyond what users or platform policy reviewers can easily assess, increasing the risk of unintended secret use and external data transmission.
The skill’s goal/ability description explains that it calls a third-party image API, but it does not clearly warn users that their prompts and related request data will be transmitted to an external provider. This can lead to inadvertent disclosure of sensitive prompts, proprietary data, or personal information to a non-local service.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### 支持的服务商示例
- OpenAI DALL-E: `https://api.openai.com/v1/images/generations`
- Azure OpenAI: `https://your-resource.openai.azure.com/openai/deployments/your-deployment/images/generations?api-version=2023-06-01-preview`
- 其他兼容 OpenAI 格式的 API 服务商
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### 支持的服务商示例
- OpenAI DALL-E: `https://api.openai.com/v1/images/generations`
- Azure OpenAI: `https://your-resource.openai.azure.com/openai/deployments/your-deployment/images/generations?api-version=2023-06-01-preview`
- 其他兼容 OpenAI 格式的 API 服务商
This code file contains natural-language documentation entirely in Chinese, including the module docstring and usage examples, with no indication that the skill is region-specific or that users can opt into another language. Under the policy rule, forcing a specific language without user choice is a natural-language policy violation.
The skill sends user-supplied prompts and an API bearer token to a configurable third-party endpoint from environment variables, and it also follows provider-returned image URLs with a second outbound request. In this skill context, external transmission is expected, but the lack of allowlisting or validation of the destination makes secret exposure and SSRF-style access to unintended hosts more dangerous if the API URL or returned image URL is malicious or misconfigured.
print(f"模型: {model}")
print(f"尺寸: {size}, 数量: {n}, 质量: {quality}")
response = requests.post(
api_url,
headers=headers,
json=data,
The skill notes elsewhere that images are saved in the current directory, but it lacks an explicit warning emphasizing local filesystem persistence and the resulting data-handling implications. Users may assume outputs are transient when they are actually written to disk, which can expose sensitive or regulated generated content to other local processes or users.