Back to skill

Security audit

Aigc.Bak

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
generate.py:243
Finding

Undisclosed Transfer of Generated Images to a Hard-Coded External Service

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
config.local.json:2
Finding

Long-Lived Bearer Token Committed in Plaintext Configuration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
generate.py:243
Finding

Unrestricted Server-Supplied URL Fetch with External Exfiltration Path

Content
View full analysis
0: # resultUrls 已填充,任务真正完成 print(f"✅ 生成完成!") # 上传到用户 OSS oss_urls = upload_to_oss(result_urls) # 上传到飞书 feishu_keys = [] for url in result_urls: key = upload_to_feishu(url) feishu_keys.append(key) ``` The supplied URL is fetched and its response body is uploaded externally: ```python def upload_to_oss(image_urls): """上传图片到用户 OSS""" uploaded_urls = [] for url in image_urls: print(f"📤 上传图片到 OSS: {url}") try: # 下载原图 img_response = requests.get(url, timeout=30) img_response.raise_for_status() # 获取文件名 parsed = urlparse(url) filename = os.path.basename(parsed.path) or f"aigc_{int(time.time())}.png" # 上传到 OSS 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, timeout=30 ) ``` ### Technical Analysis The application treats `resultUrls` from the localhost generation service as trusted. It performs `requests.get()` against each value without validating: - URL scheme - Destination hostname - Resolved IP address - Loopback, private, link-local, or reserved address ranges - Redirect destinations - Response content type - Response body size - Whether the res ...[truncated 2067 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
README.md:45
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (18)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

bash
# 1. 提交任务
curl -X POST "http://localhost:8082/image/generate" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt":"图片描述",

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · generate.py (reported line 107)May include surrounding context.

python
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)

Tainted flow: 'cmd' from os.environ.get (line 104, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · generate.py (reported line 107)May include surrounding context.

python
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)

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · generate.py (reported line 153)May include surrounding context.

python
}
    
    try:
        response = requests.post(
            f"{BASE_URL}/image/generate",
            json=payload,
            timeout=10

Tainted flow: 'task_id' from requests.post (line 165, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · generate.py (reported line 183)May include surrounding context.

python
while time.time() - start_time < max_wait:
        try:
            response = requests.get(
                f"{BASE_URL}/task/query",
                params={"taskId": task_id},
                timeout=10

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tainted flow: 'files' from requests.get (line 260, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
95% confidence
Finding

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.

Content

Scanner excerpt · generate.py (reported line 263)May include surrounding context.

python
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,

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.