T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/api_client.py:30- Finding
Undisclosed Financial API Client Accesses an Unrelated Credential and External Service
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This image-generation skill mostly does what it says, but it includes unrelated financial API code and an unsafe dependency file, so it should be reviewed before installation.
Review before installing. Use a virtual environment, avoid pip installing the supplied requirements.txt unless the external package provenance is verified, do not run artifact/scripts/api_client.py unless you intentionally want Tushare financial API access, and do not print API keys while troubleshooting. Treat prompts sent through OpenAI or Stability AI modes as data shared with those providers; use --use-local for local fallback when sensitive prompt content is involved.
scripts/api_client.py:30Undisclosed Financial API Client Accesses an Unrelated Credential and External Service
requirements.txt:1Self-Referential External Package Creates an Unsafe Supply-Chain Installation Path
SKILL.md:197Troubleshooting Documentation Instructs Users to Print the Full OpenAI API Key
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
# 下载图片
import requests
img_response = requests.get(image_url)
with open(output_path, "wb") as f:
f.write(img_response.content)
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"samples": 1
}
response = requests.post(url, headers=headers, json=body)
if response.status_code != 200:
raise Exception(f"Stability AI 错误: {response.text}")
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
prompt = f"{prefix},{style_name}风格,{user_prompt},{suffix}"
return prompt
def generate_with_openai(prompt, output_path, aspect_ratio):
This markdown file presents all user-facing instructions and examples exclusively in Chinese. That can violate a language/locale policy when the skill forces a specific language experience without offering the user an explicit language choice or documenting the locale restriction.
The entire README is written in Chinese and the skill is tailored to '小红书' content generation, but it does not explicitly state that the skill is region/language-specific or offer users a language option. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.
The natural-language instructions and usage guidance are entirely in Chinese, and the file does not indicate that this language restriction is optional or tied to a justified region-specific requirement. Under the stated policy, forcing a specific language without user opt-in is a locale-policy issue.
The usage and feature description promotes third-party image generation services but does not clearly warn users that their prompts may be sent to external providers. Users may unknowingly include confidential business, personal, or proprietary content in prompts, leading to unintended disclosure to cloud vendors.
The security section claims that all generation happens locally and that user images are not uploaded, but earlier sections explicitly state the skill can send prompts to OpenAI and Stability AI cloud APIs. This creates a misleading privacy and data-flow representation that may cause users to submit sensitive prompts under false assumptions about local-only processing.
The script's user-facing comments and output strings are exclusively in Chinese, including errors and usage guidance. This can violate a language/locale policy when the skill forces a specific language without user opt-in or justification.
This code file's natural-language documentation and operational messages are exclusively in Chinese, including the module docstring and later user-facing error/log text. Under the policy for natural-language violations, forcing a specific language without opt-in is reportable when no alternative language choice or locale justification is provided.
This manifest description uses broad promotional phrasing such as 'AI一键生成' and '立即体验' but does not define any specific activation phrases, scope limits, or exclusion conditions. In a manifest file, this kind of generic capability description can make it unclear when the skill should be invoked versus other general image-generation tools.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
else: # 9:16
width, height = 720, 1280
url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/text-to-image"
headers = {
"Authorization": f"Bearer {os.getenv('STABILITY_API_KEY')}",
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"samples": 1
}
response = requests.post(url, headers=headers, json=body)
if response.status_code != 200:
raise Exception(f"Stability AI 错误: {response.text}")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 调用脚本
try:
result = subprocess.run(
[sys.executable, str(script_path), prompt, "-o", output_path],
capture_output=True,
text=True,
The CLI help explicitly requires the prompt to be in Chinese via the string '图片描述(中文)', and the surrounding descriptions/comments indicate the skill is designed around Chinese-only usage. This is a natural-language locale constraint presented without offering the user a language choice or documenting a justified region-specific requirement.
This markdown file documents OpenAI DALL-E 3 and Stability AI as primary generation methods, which implies sending user prompts to third-party services. The README provides setup details and recommendations but does not warn users that their prompt content may be transmitted off-device to external providers.
The description says the tool is focused on '家装/美食/穿搭 3 大热门赛道' and '3个赛道任选', but elsewhere on the same line it advertises '家装、美食、穿搭、旅行 4大热门赛道'. This is a direct contradiction in the skill's own documentation about the scope of supported categories.
The natural-language description is entirely Chinese and tightly framed around Xiaohongshu-specific usage, but it does not state whether this locale/language targeting is intentional or whether users can opt into another language. This may violate language/locale policy expectations when a skill is exposed in broader multilingual environments.
No suspicious patterns detected.