Back to skill

Security audit

GPT Image 2 图片换背景

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed AI image background tool, but it handles an API key and local uploads with loose endpoint and file scoping that users should review before installing.

Install only if you trust AI Hive with the images and prompts you provide. Keep the API key private, avoid custom AI_HIVE_BASE_URL or --base-url values unless you fully trust the endpoint, and do not use the upload command on unrelated local files.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imagegen.py:91
Finding

Bearer API Key Can Be Sent to an Untrusted or Plaintext Endpoint

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:69
Finding

Runtime Dependency Is Installed Without Version or Integrity Pinning

Content
View full analysis
Remediation
View remediation
``` 2. Generate and commit hashes for the selected package and all transitive dependencies. Install them using: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Use a lock-file workflow that records all transitive dependency versions. 4. Install only from an explicitly trusted package index and avoid configurations that merge public and private indexes in a way that permits dependency confusion. 5. Run dependency vulnerability and provenance checks in continuous integration. 6. Perform installation inside a dedicated virtual environment rather than the system Python environment. 7. Update `SKILL.md` and the import error message so they point users to the pinned dependency file instead of recommending an unconstrained installation. ]]>
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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a narrowly scoped background-replacement tool, but the detected behavior includes much broader functions such as generic chat, video generation, user-info access, model enumeration, uploads/downloads, browser interaction, and API-key initialization. This mismatch is dangerous because users and reviewers may trust the skill with sensitive media or data under a limited-use assumption, while the implementation appears capable of performing unrelated and potentially privacy-impacting actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file contains unrelated chat and video generation capabilities despite the skill claiming to be only for image background replacement. In an agent-skill ecosystem, hidden or unnecessary extra capabilities expand the attack surface and may let callers invoke higher-risk functions that bypass user expectations, review assumptions, or permission boundaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing natural-language content exclusively in Chinese, and there is no indication that the skill is region-specific or that users can opt into another language. Under the policy rule for language/locale constraints, forcing a single language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill exposes executable examples that rely on shell, file, environment, and network capabilities, but it does not declare any tool scope or allowed-tools boundary. This weakens least-privilege controls and can let the agent invoke broader capabilities than users or reviewers would expect, increasing the chance of unintended file access, network calls, or command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The description says to use this skill for a wide range of generic tasks such as background replacement, scene swapping, ID-photo backgrounds, localization environments, and batch background versions. It does not define explicit trigger phrases, activation boundaries, or negative examples, so the skill could be invoked for ordinary editing requests more broadly than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill metadata and instructions are written in Chinese, and one example explicitly reserves space for Japanese typography while stating not to generate translation. This indicates a locale-specific behavior without documenting user choice or an explicit opt-in, which can conflict with language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module docstring and nearly all user-facing prompts and help text in this file are written only in Chinese, which effectively imposes a specific language on users. The file does not offer any language selection, locale opt-in, or documented justification for being Chinese-only.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Account-info retrieval and model enumeration are not necessary for a dedicated background-replacement skill and expose additional metadata about the user's account and available services. This violates least privilege and can aid reconnaissance, billing discovery, or unauthorized capability discovery if the skill is invoked in broader agent workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a narrowly scoped GPT Image 2 background-replacement tool, but the exposed generate path forwards arbitrary prompts and parameters to a generic image generation endpoint. This scope mismatch can mislead users and higher-level agents into granting broader image editing/generation capability than intended, weakening least-privilege assumptions and policy enforcement.

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 placeholder uses Chinese text ('请替换为你的APIKey'), which imposes a specific language in user-facing configuration content. There is no indication that the skill is intended only for Chinese-speaking users or that alternative language/localization is supported.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The top-level docstring states this file is a '通用 AI 能力调用工具' wrapping text chat, image generation, video generation, model queries, media upload, and task polling. That directly conflicts with the skill manifest/name, which present the file as a specialized GPT Image 2 background-replacement skill.

Content

No source excerpt is available for this finding.