Back to skill

Security audit

拼多多 电商图片生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches an AI image-generation workflow, but it sends credentials to a configurable API endpoint and can upload arbitrary local files without enough safeguards.

Review before installing. Only use this skill with trusted prompts and explicit image paths, avoid the standalone upload command for anything except intended product media, do not set a custom AI_HIVE_BASE_URL unless you fully trust that endpoint, and treat ~/.ai-hive/config.json as a stored API credential.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/imagegen.py:91
Finding

API Credential Disclosure Through an Unrestricted Base URL

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:259
Finding

Arbitrary Local File Upload Through Insufficient Media Validation

Content
View full analysis
" raise SystemExit(f"OSS 上传失败 ({oss_resp.status_code}): {detail}") print(f"[3/3] 确认上传完成...") result = client.complete_upload(media_id) print(f"[ok] mediaId = {media_id}") return media_id ``` The upload command exposes the unrestricted path directly: ```python def cmd_upload(client, args): media_id = upload_media(client, args.file) print(f"\nmediaId: {media_id}") ...[truncated 2157 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:78
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
``` The script repeats the same unpinned installation guidance: ```python try: import requests except ImportError: print("缺少依赖:requests。请运行 pip3 install requests", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis The installation instructions retrieve the latest package version selected by the configured Python package index. No exact version, lock file, integrity hash, or isolated environment is specified. This makes installation non-reproducible and means the code that is imported at runtime can change independently of the audited skill. The package name is legitimate and no malicious dependency is embedded in the repository, but the installation process lacks controls against a compromised package release, package-index compromise, or an untrusted configured mirror. Installing directly with `pip3` may also modify the active interpreter environment and cause dependency conflicts with unrelated applications. ### Attack Path 1. A user follows the documented `pip3 install requests` instruction. 2. `pip` contacts its configured package index or mirror. 3. The index selects a package release at installation time because no version is pinned. 4. If the selected release or configured index has been compromised, attacker-controlled package code is installed. 5. A later invocation imports `requests`, causing the installed code to execute with the privileges of the user running the skill. This path requires compromise or malicious control of the package source, mirror, or selected release; the audited repository itself does not contain a malicious `requests` ...[truncated 434 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes shell commands, installs packages, accesses local files, and can make networked API calls through imagegen.py, but it does not declare any permissions or allowed-tools constraints. This creates an authorization gap where an agent may grant broader capabilities than necessary, increasing the risk of unintended command execution, filesystem access, or data exfiltration if the skill or its inputs are abused.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description contains broad activation phrases covering many ecommerce-image scenarios without clear boundaries, which can cause an agent to invoke this skill in loosely related contexts. Because the skill executes code and performs network/file operations, overbroad triggering raises the chance of unnecessary privileged execution and misuse on unintended user requests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file is presented as a Pinduoduo ecommerce image-generation/editing skill, but it actually exposes a much broader general-purpose AI client with chat, video, model listing, account inspection, and media-upload features. This scope mismatch is dangerous because users, reviewers, or orchestration layers may grant trust or permissions based on the narrow stated purpose while the code can perform materially different actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language descriptions and CLI prompts entirely in Chinese, such as the module docstring and later user-facing help/output text. Because the skill does not offer users a language/locale option and does not justify a China-specific locale restriction, it violates the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill includes a user-info endpoint that can retrieve user account and wallet/balance information, which is unrelated to ecommerce image generation. In a skill ecosystem, unnecessary access to account metadata increases privacy exposure and expands the blast radius if the skill is invoked by an untrusted workflow or socially engineered user.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The general text chat function is outside the declared scope of an ecommerce image-editing skill and turns the file into a broader AI interaction client. That hidden capability can be abused for prompt exfiltration, policy bypass attempts, or unintended data transfer to external models under the guise of a narrow image tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Video generation materially exceeds the declared purpose of generating/editing Pinduoduo product images and broadens the external API actions the skill can perform. This increases misuse potential, cost exposure, and review evasion because a seemingly image-only skill can submit richer media-generation jobs than users expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing natural language almost exclusively in Chinese, including the substantive changelog entries. Under the policy rule for language/locale, forcing a specific language without user opt-in or justification is a violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description combines Chinese and English in a way that implies a fixed bilingual presentation, but it does not state that users can choose their preferred language. This can violate language/locale policy expectations when a skill imposes a presentation language without opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The top-level documentation explicitly describes the file as a general AI capability tool, conflicting with the manifested identity of a Pinduoduo-specific image skill. Documentation inconsistency is dangerous because it obscures true capabilities during review and can cause operators to misclassify the trust level and permissions appropriate for the tool.

Content

No source excerpt is available for this finding.