T09 · Insecure Skill Coding Practices
- Location
seedream_api.py:40- Finding
Unrestricted Local File Encoding and External Upload
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a plausible Seedream image-generation skill, but it needs Review because reference-image paths can cause any readable local file to be uploaded and generated-image downloads are not constrained.
Review this skill before installing if you work with private files or sensitive prompts. Use it only with a Volcengine API key you intend to use for Seedream, avoid passing local paths unless you are certain the file is a non-sensitive image, and be aware that prompts, reference images, URLs, and optional web_search requests are sent to an external provider. Generated images are downloaded automatically by default.
seedream_api.py:40Unrestricted Local File Encoding and External Upload
seedream_api.py:150Unvalidated Response URL Download with No Resource Limits
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
if tools:
data["tools"] = tools
response = requests.post(API_URL, headers=headers, json=data)
result = response.json()
if "data" in result:
The README instructs users to send prompts to the Volcengine Seedream API but does not clearly warn that all prompt content will be transmitted to an external third-party service. Users may unknowingly submit sensitive, proprietary, or personal data in prompts, creating a privacy and data-governance risk. In an agent skill context, this omission is more dangerous because prompts may be composed from broader user context rather than only explicit user text.
The skill declares access to environment variables and makes outbound network requests, but it does not define any explicit tool scope such as permissions or allowed-tools. This increases the chance that an agent runtime will grant broader capabilities than intended, making secret access and external transmission less visible to policy enforcement and reviewers.
The description says the skill should be used whenever a user needs image generation, which is broad enough to auto-trigger on many ordinary requests without clear consent or boundary checks. In a skill that can read secrets and perform network actions, overbroad routing increases the risk of unnecessary invocation, unintended data transmission, and policy bypass through ambiguous prompts.
The trigger example '用户说"生成一张xxx图片"时,直接运行' is very generic and instructs direct execution without qualification or safety gating. Because the skill performs external API calls and may process local paths or URLs, such broad examples make accidental or manipulated invocation more likely.
The code sends user-supplied prompt data and potentially image references to an external API endpoint, which is an external transmission of possibly sensitive data. In this skill's context, outbound transmission is expected for functionality, but it still creates privacy and data-handling risk if users provide confidential prompts, local file content, or internal URLs.
"size": "2048x2048"
}
response = requests.post(API_URL, headers=headers, json=data)
result = response.json()
if "data" in result:
The skill exposes a generic tools parameter and explicitly supports capabilities like web_search, even though the skill's stated purpose is image generation. This broadens the remote capability surface and allows user-supplied requests to trigger external data retrieval unrelated to the declared scope, increasing privacy and policy risk.
If image is provided as a local path, the code base64-encodes the file and sends it to the remote Seedream API without an explicit warning or consent step at the call site. In a skill context, this can lead to accidental disclosure of local or sensitive images to a third-party provider.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if tools:
data["tools"] = tools
response = requests.post(API_URL, headers=headers, json=data)
result = response.json()
if "data" in result:
The CLI advertises and forwards web-search functionality (--tools) that is outside the narrow purpose of generating images. This can cause unexpected outbound network use and data sharing, especially when prompts or related context are sent to a third-party service with auxiliary tools enabled.
All user-facing instructions and examples in the README are presented only in Chinese, with no indication that another language is supported or that the locale restriction is intentional. Under the policy, forcing a specific language without user opt-in can be a natural-language policy issue unless the constraint is clearly documented and justified.
The top-level natural-language documentation is written only in Chinese, which imposes a specific language without any opt-in or alternative. Under the policy, language-specific instructions should either offer a choice or clearly justify the locale constraint.
No suspicious patterns detected.