Back to skill

Security audit

商品图片套图生成与编辑|Product Image Suite

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward AI Hive product-image workflow with disclosed API use and local credential storage, but users should treat the API key and uploaded reference images carefully.

Install in a virtual environment, consider pinning requests, only upload reference images you are allowed to send to AI Hive, and use the auth command only if you are comfortable storing the API key locally in your home 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

Warning
Location
SKILL.md:174
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 174
Vulnerability Type: Unpinned package installation from a third-party package repository
Risk Level: Medium

Vulnerable Code:

bash
pip3 install requests

Technical Analysis

The documented installation command installs the latest version of requests and its transitive dependencies without a version constraint, lockfile, or cryptographic hash verification. Consequently, the dependency code installed by users can differ from the code available when this project was audited.

If a future release or transitive dependency is compromised, package installation or subsequent import and execution could run attacker-controlled code. Installation from a source distribution can also execute package build logic. The application imports requests and uses it for authenticated API requests, reference-image uploads, and generated-image downloads, so a malicious dependency could observe or modify this sensitive network activity.

Attack Path

  1. An attacker compromises a future release of requests, one of its transitive dependencies, or the relevant package-distribution path.
  2. A user follows the documented pip3 install requests command.
  3. pip resolves and installs the uncontrolled compromised release.
  4. Malicious package or build code executes during installation or when scripts/product_suite.py imports and uses the dependency.
  5. The malicious code operates with the privileges of the user running pip or the Skill and may access data available to that process.

Impact Assessment

Exploitation could permit arbitrary code execution with the privileges of the installing or executing user. Within that scope, an attacker could potentially access the AI Hive API key supplied through command-line arguments, the AI_HIVE_API_KEY environment variable, or ~/.ai-hive/config.json; read reference images selected for upload; alter API requests and ...[truncated 306 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the unconstrained installation command with a reviewed dependency manifest containing exact versions.
  2. Generate and record cryptographic hashes for every direct and transitive dependency, then require hash verification during installation:
    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Use a lock-generation tool such as pip-tools to resolve and pin the complete dependency graph reproducibly.
  4. Install dependencies inside a dedicated virtual environment under an unprivileged account rather than into the system Python environment.
  5. Regularly scan pinned dependencies for known vulnerabilities and update them through a controlled review process.
  6. Consider documenting a trusted package index explicitly and using deployment controls that prevent fallback to unapproved repositories.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill clearly instructs execution of local Python scripts, package installation, network access to a fixed external API, and use of files and environment-derived paths, but it does not declare any explicit tool scope or permissions. That mismatch is dangerous because consumers or enforcement layers cannot accurately constrain what the skill may do, increasing the risk of unintended shell, file, or network actions if the skill is invoked in a permissive runtime.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is primarily written in Chinese and presents the skill as producing localized assets for multiple markets, but it does not state that users may choose their preferred language or locale. Under the policy rule, forcing a specific language without opt-in is a natural-language locale violation.

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 user-facing error/help strings shown in this file are written in Chinese, and the CLI description/help text continues this pattern throughout the script. The file does not provide any opt-in language selection or explain that the skill is intentionally limited to a Chinese-speaking locale, which creates a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest describes a product image suite generation/editing workflow, but this file also reads API credentials from environment variables and a local config file, and directs users to an auth flow. Those capabilities are operational/account-management features rather than direct image-generation behavior, and they are not reflected in the stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The auth command writes a long-lived API key to ~/.ai-hive/config.json. Saving credentials locally is a separate account/configuration capability and is not part of the manifest's described scope of producing consistent ecommerce image suites.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.