T05 · Unauthorized Access and Privilege Escalation
- Location
generate.py:243- Finding
Undisclosed Transfer of Generated Images to a Hard-Coded External Service
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-generation skill has a coherent core purpose, but it automatically uploads generated content to an under-disclosed external service and ships a plaintext bearer token.
Review this carefully before installing. It can send generated images to Feishu and to an external OSS service, includes a plaintext bearer token that should be considered compromised, and fetches server-supplied URLs without validation. Do not use it with private prompts or images unless the token is removed/rotated, destinations are disclosed and controlled, and external transfers require explicit user approval.
generate.py:243Undisclosed Transfer of Generated Images to a Hard-Coded External Service
config.local.json:2Long-Lived Bearer Token Committed in Plaintext Configuration
generate.py:243Unrestricted Server-Supplied URL Fetch with External Exfiltration Path
README.md:45Unpinned Third-Party Dependency Installation
The skill is presented as an image-generation helper, but it also downloads files locally and sends them through Feishu, which introduces data transfer, storage, and credential dependencies not disclosed in the primary description. This mismatch can mislead users and reviewers about the real data-handling behavior and expands the attack surface beyond simple prompt-to-image generation.
The code executes an external local script to send files to Feishu, which materially expands the skill's capabilities beyond image generation. This creates a hidden execution and data-transfer path whose behavior is not visible here and may permit unintended disclosure or abuse if the external script or its environment is compromised.
The README documents very broad natural-language trigger phrases for automatic invocation, such as generic requests to generate or draw an image. In an agent environment, overly broad triggers can cause unintended skill activation from ambiguous user input, increasing the chance of surprise execution, prompt-routing mistakes, or misuse of image-generation actions when the user did not clearly intend to call this specific skill.
The skill uses network, shell, file access, and likely environment-backed integrations, but declares no explicit tool scope or permissions boundary. That makes its effective capabilities much broader than what a reviewer or runtime policy can safely infer, increasing the risk of unauthorized network calls, filesystem writes, and message delivery side effects.
The trigger phrases are broad enough to match many ordinary image-related requests, so the skill may auto-activate when the user did not intend to invoke this specific workflow. In this skill, over-triggering is more dangerous because activation leads to network requests, local file writes, and downstream message delivery rather than a harmless text-only response.
The workflow states that generated images are automatically downloaded locally and sent to Feishu without any user-facing notice or consent about storage and transmission. This can expose sensitive prompts or generated content to unintended persistence and sharing channels, especially if users assume the operation is confined to generation only.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# 1. 提交任务
curl -X POST "http://localhost:8082/image/generate" \
-H "Content-Type: application/json" \
-d '{
"prompt":"图片描述",
The skill advertises image generation, but the implementation also automatically redistributes generated images to external OSS and Feishu systems. That mismatch increases privacy and data-handling risk because user content is sent to third parties beyond the minimum expected function.
The module docstring is written as an instruction/description entirely in Chinese, and the CLI help/output strings throughout the file are also Chinese-only, with no indication that users may choose another language. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is documented and justified.
The skill reads OSS and Feishu-related credentials from environment variables and local config despite presenting itself as an image-generation helper. This is risky because it introduces undisclosed credential use and enables silent external transmission of user-generated content.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
cmd = ['python3', FEISHU_SENDER_SCRIPT, '--file', temp_file.name, '--receive-id', chat_id]
print(f"📤 执行命令: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
print(f"📤 返回: {result.stdout}")
if result.stderr:
print(f"📤 错误: {result.stderr}", file=sys.stderr)
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
cmd = ['python3', FEISHU_SENDER_SCRIPT, '--file', temp_file.name, '--receive-id', chat_id]
print(f"📤 执行命令: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
print(f"📤 返回: {result.stdout}")
if result.stderr:
print(f"📤 错误: {result.stderr}", file=sys.stderr)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
try:
response = requests.post(
f"{BASE_URL}/image/generate",
json=payload,
timeout=10
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
while time.time() - start_time < max_wait:
try:
response = requests.get(
f"{BASE_URL}/task/query",
params={"taskId": task_id},
timeout=10
Generated images are automatically uploaded to OSS and sent to Feishu without an explicit warning or confirmation in the user flow. For an image-generation skill, this is especially dangerous because prompts and outputs may contain sensitive personal, proprietary, or regulated content that users do not expect to be redistributed.
The code downloads arbitrary URLs returned by the local generation service and then re-uploads the fetched content to an external OSS endpoint. This creates an SSRF-style trust boundary issue: if the upstream service is compromised or malicious, it can cause the skill to fetch internal resources or sensitive local-network endpoints and exfiltrate the responses to external storage.
files = {'file': (filename, img_response.content, 'image/png')}
headers = {'Authorization': f'Bearer {OSS_TOKEN}'}
upload_response = requests.post(
OSS_UPLOAD_URL,
files=files,
headers=headers,
The skill description and example invocations are presented entirely in Chinese, implying a fixed language expectation for use. The file does not mention multilingual support, user opt-in, or a justified region-specific scope.
The skill documents a persistent local storage path and naming convention, but gives no user-facing disclosure about retention, cleanup, or filesystem effects. Even if the content is benign, persistent storage of generated images can create privacy, disk usage, and unauthorized access risks on the host system.