Back to skill

Security audit

TikTok Shop 电商图片生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

This skill uses AI Hive to generate TikTok Shop images and uploads user-selected media, with no evidence of hidden execution, theft, or destructive behavior.

Install in a virtual environment, pin dependencies if possible, and only pass product or reference files you are comfortable uploading to AI Hive. Be aware that init stores an API key locally and generated outputs download to the configured output directory.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Note
Location
SKILL.md:78
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 78
Vulnerability Type: Unpinned runtime dependency
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instruction retrieves requests and its transitive dependencies without version constraints, cryptographic hashes, a lockfile, or an isolated environment. Consequently, the installed artifacts may differ over time and depend on the user's configured Python package index.

This weakens build reproducibility and supply-chain integrity. If the selected package index or a future dependency release is compromised, malicious or altered installation artifacts could be installed. No malicious package, unsafe package source, or currently compromised dependency was identified in the audited project; the finding concerns the absence of dependency pinning and integrity verification.

Attack Path

  1. A user follows the documented setup instruction.
  2. pip resolves the latest compatible requests package and transitive dependencies from the configured package index.
  3. An attacker who has compromised the index, a relevant package release, or the user's package-resolution configuration supplies a malicious artifact.
  4. The artifact is installed in the environment targeted by pip3.
  5. Malicious package code can execute during installation or when scripts/imagegen.py subsequently imports requests.

Impact Assessment

Successful exploitation could execute code with the privileges of the user running pip3 or the Skill. Depending on the installation environment, this may permit access to that user's files, API credentials available to the process, and network resources.

The scope could be broader if the command is run with elevated privileges or in a shared global Python environment. Under the documented command, no privilege escalation is inherently obtained.

Remediation
View remediation

Remediation Suggestions

  1. Create a reviewed requirements file that pins requests and all transitive dependencies to exact versions.
  2. Generate and record cryptographic hashes for every permitted distribution.
  3. Install with hash enforcement:
bash
python3 -m pip install --require-hashes -r requirements.txt
  1. Perform installation inside a dedicated virtual environment rather than the system-wide Python environment.
  2. Configure an approved HTTPS package index and disable untrusted extra indexes.
  3. Review and update pinned dependencies through a controlled process that includes vulnerability and provenance checks.
  4. Consider documenting a reproducible setup such as:
bash
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install --require-hashes -r requirements.txt
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 (9)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains user-facing natural language that consistently uses Chinese for all substantive release notes. Under the policy, forcing a specific language without user opt-in or a documented region-specific justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes local Python scripts and instructs installation plus task execution, implying shell, network, and file capabilities, but it does not declare any explicit tool scope or permissions boundary. In an agent environment, this can lead to overbroad execution authority, making unintended file access, network calls, or command execution more likely if the skill is invoked automatically or reused in a broader workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description is broadly phrased as a general solution for many TikTok Shop image-generation and editing use cases, without clear invocation constraints or boundaries. In agent routing systems, this can cause the skill to trigger in overly broad contexts, increasing the chance that shell/network-enabled automation runs on ambiguous or user-controlled inputs without sufficient review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is presented as a TikTok Shop image-generation/editing wrapper, but the file embeds a much broader generic AI client including chat, video generation, model enumeration, user-info access, and media upload. This scope mismatch is dangerous because users or orchestrators may grant trust, permissions, or data based on the narrow skill description while the code exposes additional capabilities that can be invoked or repurposed for unrelated operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and user-facing CLI guidance are written entirely in Chinese, and the rest of the script continues this pattern for prompts, errors, and help text. This imposes a specific language/locale on all users without offering a language choice or documenting a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code includes a user-info endpoint that retrieves account information and wallet balance despite the skill being described as an image-generation tool. Even if not exposed in the final wrapper CLI, bundling account-inspection functionality violates least privilege and increases the chance of unintended data exposure, misuse by other callers, or future expansion that leaks billing/account metadata.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file implements full video-generation support even though the skill is marketed as image generation/editing for TikTok Shop. This hidden breadth increases attack surface and creates a deceptive-capability problem: downstream systems may approve the skill for image-only workflows while the code can process additional media types and perform higher-cost or policy-sensitive operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language description combines English with Chinese terms in a way that implicitly enforces multilingual output or interpretation, but it does not state that the user can choose their preferred language. Under the policy rule, locale or language behavior should be opt-in or clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example API key value includes the Chinese phrase "请替换为你的APIKey", which imposes a specific language in user-facing configuration content. There is no indication that this locale choice is optional or justified as region-specific, so it may violate the language/locale policy.

Content

No source excerpt is available for this finding.