Back to skill

Security audit

GPT Image 2 广告图片

Security checks for vulnerabilities and agentic risk

Overview

This skill is mainly a disclosed AI Hive ad-image generator, with some broader unused helper code and install hygiene issues but no evidence of hidden exfiltration, destructive behavior, or unsafe automatic execution.

Install only in a normal user account or virtual environment, pin requests yourself if reproducibility matters, and upload only files you intend to send to AI Hive. Expect an AI Hive API key to be stored locally in ~/.ai-hive/config.json if you use init.

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

Warning
Location
SKILL.md:68
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:68-72
Vulnerability Type: Unpinned runtime dependency
Risk Level: Medium

Vulnerable Code Snippet:

bash
pip3 install requests
python3 "$SKILL_PATH/scripts/imagegen.py" init --skill-name gpt-image-2-ad-image
python3 "$SKILL_PATH/scripts/imagegen.py" task --task-id <taskId>

Technical Analysis

The documented installation command retrieves requests without specifying an audited version, dependency lock file, package hash, or trusted package index. Consequently, the exact code installed is mutable and may differ between installations performed at different times.

This creates supply-chain exposure if the package registry, a transitive dependency, the selected package release, or the package-resolution path is compromised. It also permits future incompatible releases to change the script's network behavior without a corresponding review of this project.

The issue does not establish that the current requests package is malicious. The risk arises because the instructions trust mutable external package contents at installation time without reproducibility or integrity verification.

Attack Path

  1. An attacker compromises a future requests release, one of its resolved dependencies, or the package distribution channel used by the victim.
  2. A user follows the documented pip3 install requests command.
  3. pip resolves and installs the attacker-controlled or compromised release because no version or hash constraint is present.
  4. Malicious package code executes during installation or when scripts/imagegen.py imports requests.
  5. The malicious code operates with the privileges of the user running pip or the skill and may access that user's files, environment variables, and outbound network connection.

Impact Assessment

Successful exploitation can obtain the privileges of the account that installs or runs the skill. With ...[truncated 500 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the unconstrained installation command with an audited, exact version constraint, for example through a dedicated requirements.txt.

  2. Generate and verify cryptographic hashes for the package and all transitive dependencies, using an installation command such as:

    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Maintain a lock file that records the complete dependency graph for each supported Python environment.

  4. Configure an approved HTTPS package index rather than relying on an unspecified local or global pip configuration.

  5. Review dependency updates before changing pinned versions, including release provenance, vulnerability advisories, and transitive dependency changes.

  6. Recommend installation in an isolated virtual environment with ordinary user privileges, and explicitly advise against running pip as root.

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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared purpose is tightly framed as GPT Image 2 ad-creative generation, but the implementation reportedly includes broader capabilities such as generic chat, video generation, user/account queries, model enumeration, arbitrary media upload, and interactive API-key initialization/browser-opening behaviors. This mismatch is dangerous because operators may grant trust or deployment approval based on the benign description while the actual code can access unrelated functions and data flows, enabling overreach, data exfiltration, or unexpected user-impacting actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file's user-facing natural-language content is entirely in Chinese, with no indication that the skill supports other languages or that Chinese-only output is an intentional, justified regional constraint. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill exposes operational code paths that can read/write files, access environment variables, use the network, and invoke the shell, but it does not declare any tool or permission boundaries in the manifest. That creates unnecessary privilege ambiguity: a caller or hosting platform may treat the skill as narrowly scoped for ad-image generation while the implementation can perform broader actions, increasing the blast radius if the script is modified, misused, or supplied adversarial inputs.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description lists many generic advertising contexts and product names as situations to 'use this skill' without specifying exact trigger phrases, exclusions, or activation constraints. This broad scope increases the chance of unintended invocation in ordinary ad-design discussions, especially because it mixes Chinese and English keywords covering multiple ad platforms and workflows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file consistently instructs and exemplifies the skill entirely in Chinese, while the description targets broad ad-creative use cases and does not state that the language is optional or region-specific. For a generally applicable skill, this can amount to an implicit locale policy constraint without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module-level documentation describes a '通用 AI 能力调用工具' wrapping text chat, image generation, video generation, model query, media upload, and task polling. For a skill whose stated purpose is specifically GPT Image 2 ad-image creation, these extra capabilities are not justified by the manifest, even if some are not exposed through skill_main in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains user-facing natural-language descriptions and prompts that are consistently Chinese-only, including the module docstring and later CLI help text. That can violate language/locale policy when users are not given an opt-in choice and no region-specific justification is stated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest describes a narrowly scoped skill for producing GPT Image 2 advertising images and A/B-testable creatives. However, the exported skill CLI includes separate task and upload commands that let a caller inspect arbitrary generation tasks and upload files to the platform without actually generating ad images, which is broader than the stated end-user purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The example API key placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. The file does not offer a language choice or explain why a Chinese-only locale is required, so it conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.