T09 · Insecure Skill Coding Practices
- Location
scripts/generate_gourmet.py:347- Finding
Unvalidated API endpoint can expose the bearer credential and private refrigerator images
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it says, but it uploads private fridge photos and API credentials to configurable cloud endpoints without enough scoping or privacy disclosure.
Review before installing. Use only non-sensitive fridge photos, avoid visible medications or identifying labels, and do not set WAN_API_URL to an untrusted or unknown host. Prefer a dedicated DashScope API key with limited quota, run in a clean virtual environment, and be aware that the tool sends images and prompts to cloud AI services.
scripts/generate_gourmet.py:347Unvalidated API endpoint can expose the bearer credential and private refrigerator images
SKILL.md:139Unpinned runtime dependency installation creates avoidable supply-chain exposure
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
for word in ["汤", "soup", "炖", "stew", "braise"]):
cooking_method = "simmered"
dish_type = "soup or stew"
# 构建强约束提示词
ingredients_str = ", ".join(key_ingredients[:6]) if key_ingredients else "fresh vegetables"
# 根据菜品类型添加具体的摆盘描述
plating_description = ""
negative_prompt = ""
if "salad" in dish_type.lower():
plating_description = "Fresh colorful salad in a white bowl, mixed raw vegetables with dressing, cold dish"
negative_prompt = "NO cooked meat, NO fish, NO hot dish, NO grilled items, NO roasted meat"
elif "roll" in dish_type.lower() or "wrap" in dish_type.lower():
plating_description = "Elegant rolled wraps on a plate, cut to show colorful fillings inside"
negative_prompt = "NO whole fish, NO meat slab, NO plain plate"
The skill explicitly asks users to photograph the inside of their refrigerator and upload that image to an external AI service, but it does not warn users that the photo may contain sensitive personal information such as medications, identifiable products, household habits, or other incidental details. This creates a privacy and informed-consent gap: users may disclose more than they realize to a third-party cloud provider without understanding retention, processing, or sharing implications.
This markdown file documents setting a WAN_API_KEY and sending a local fridge image to a remote API for generation, but it does not warn users that their image and related data may be transmitted to an external service. Under the markdown criteria for SQP-2, user-facing documentation should disclose behaviors that could affect privacy or data handling.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Linux/macOS
export WAN_API_KEY="your-wan-api-key-here"
export WAN_API_URL="https://api.wan.xxx/v1/images/generate"
# Windows (PowerShell)
$env:WAN_API_KEY="your-wan-api-key-here"
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# Linux/macOS
export WAN_API_KEY="your-wan-api-key-here"
export WAN_API_URL="https://api.wan.xxx/v1/images/generate"
# Windows (PowerShell)
$env:WAN_API_KEY="your-wan-api-key-here"
The skill base64-encodes a user-supplied fridge photo and sends it to an external multimodal API for ingredient recognition without any explicit privacy notice or consent flow. Fridge images can reveal household habits, medications, brands, family context, or other sensitive personal information, so undisclosed transfer is a meaningful privacy risk.
This is a duplicate report of the same external transmission at line 573. The underlying issue is the same: a personal fridge image is sent off-device to a cloud API without explicit warning.
try:
print(f"🔍 正在识别冰箱中的食材...")
response = requests.post(
"https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
json=vl_payload,
headers=headers,
This is a duplicate report of the same external transmission at line 573. The underlying issue is the same: a personal fridge image is sent off-device to a cloud API without explicit warning.
try:
print(f"🔍 正在识别冰箱中的食材...")
response = requests.post(
"https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
json=vl_payload,
headers=headers,
Recipe generation uploads the user's fridge photo to a remote multimodal service but does not clearly tell the user that their image leaves the local environment. Because the content of a fridge photo may contain sensitive information, the hidden external transmission creates a legitimate privacy and data-handling concern.
This is a duplicate report of the external transmission in the recipe-generation path at line 785. The risk remains undisclosed upload of potentially sensitive user image data to a third-party AI service.
try:
print(f" 正在生成菜谱...")
response = requests.post(
"https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
json=vl_payload,
headers=headers,
This is a duplicate report of the external transmission in the recipe-generation path at line 785. The risk remains undisclosed upload of potentially sensitive user image data to a third-party AI service.
try:
print(f" 正在生成菜谱...")
response = requests.post(
"https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation",
json=vl_payload,
headers=headers,
The surrounding comments say this mode is '基于菜谱生成' and '更贴合菜谱', but the implementation hard-codes '强制所有菜都显示为热菜' and describes the output as a hot stir-fried dish even if the parsed recipe indicates soup, salad, wraps, or other preparations. This is an active contradiction between documented intent and actual behavior.
This request sends generation payloads, including user image data in some modes, to a remote service endpoint. In context, the danger is not arbitrary exfiltration to an unknown host but failure to clearly disclose third-party processing of personal content.
print(f" 时间: {time_name}")
try:
response = requests.post(
self.api_url,
json=payload,
headers=headers,
The image/video generation path sends user image data and prompts to a remote API endpoint, potentially including custom requirements and recipe-derived content, without an explicit privacy warning. In this skill context, users may reasonably assume local processing of a personal fridge photo, so silent upload increases privacy exposure.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
time.sleep(poll_interval)
print(f" 第 {i+1} 次查询...", end=" ")
query_response = requests.get(query_url, headers=headers, timeout=30)
if query_response.status_code != 200:
print(f"查询失败: {query_response.status_code}")
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
query_url = f"https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}"
try:
response = requests.get(query_url, headers=headers, timeout=30)
if response.status_code == 200:
return response.json()
The printed message states the generated image/video was '基于您的冰箱照片独家生成', yet the code explicitly disables image use in the 2.7-t2i and 2.1-t2v branches by setting text-only payloads and even comments that these modes do not use the fridge image. This is a direct contradiction in inline/user-facing documentation about what data the model actually used.
This code file contains natural-language statements and data entirely in Chinese, including the top-level description asserting a Chinese recipe database, without any indication that the language is optional or tied to a documented locale-specific requirement. Under the policy rule for language/locale constraints, forcing a specific language without user opt-in is a natural-language policy concern.
The file content, headings, and inline guidance are presented entirely in Chinese, which effectively forces a specific language for users without offering an alternative or documenting a justified locale restriction. This matches the policy category for language or locale constraints expressed through natural-language content.
The ingredient-identification prompt explicitly requires output '使用中文', and similar recipe prompts also require Chinese output. This is a natural-language locale constraint imposed by the skill without any visible user opt-in or configurable language selection.
Both recipe prompt branches instruct the model to respond '使用中文', which enforces a specific language regardless of user preference. This is a locale-policy issue because the file contains no mechanism for choosing another language or explicitly opting into Chinese-only behavior.