Back to skill

Security audit

小红书爆款笔记封面生成与编辑

Security checks for vulnerabilities and agentic risk

Overview

This is a Xiaohongshu cover-image generation skill that uses AI Hive with user-provided prompts/images and an API key; I found caveats, but no hidden automatic or destructive behavior.

Install only if you are comfortable giving this skill an AI Hive API key and uploading the reference images you select to AI Hive. Use a virtual environment, prefer pinned dependencies, and avoid passing private files as reference images unless you intend them to be uploaded.

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:80
Finding

Unpinned Third-Party Runtime Dependency

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:80
Vulnerability Type: Unpinned package installation
Risk Level: Low

Vulnerable Code

bash
pip3 install requests

Technical Analysis

The installation instructions retrieve and install the latest available version of the requests package without enforcing an audited version, cryptographic hashes, or a dependency lock file.

Although requests is a legitimate package and no malicious dependency is currently identified, this installation method does not produce reproducible environments. A future compromised release, compromised package-publishing account, or distribution-channel compromise could cause users to install code that was not reviewed with this project. The package is subsequently imported and used by scripts/imagegen.py, so package-level code executes in the Python process when the Skill runs.

Attack Path

  1. An attacker compromises the upstream package publication process, package account, or dependency distribution channel.
  2. A malicious or otherwise compromised release becomes the version selected by pip3 install requests.
  3. A user follows the installation command in SKILL.md.
  4. The unreviewed release is installed into the selected Python environment.
  5. The user invokes scripts/imagegen.py.
  6. Python imports the installed package, allowing malicious package code to execute with the privileges of the user running the Skill.

Impact Assessment

Successful exploitation could execute arbitrary Python code with the invoking user’s privileges. Depending on that user’s access, this could expose local files, environment variables, the AI Hive API key, generated media, and network-accessible resources. It could also alter files available to the user or interfere with API requests.

The practical likelihood is limited because exploitation requires compromise of a trusted upstream package or its distribution path; the audit found no evidence that the current ...[truncated 30 chars]

Remediation
View remediation

Remediation Suggestions

  1. Declare dependencies in a version-controlled requirements file instead of installing an unconstrained latest release.
  2. Pin requests and all transitive dependencies to reviewed versions.
  3. Generate and verify cryptographic hashes, then require hash validation during installation:
bash
python3 -m pip install --require-hashes -r requirements.txt
  1. Generate the locked dependency set with a reproducible dependency-management tool and review dependency changes before updating it.
  2. Install dependencies inside a dedicated virtual environment with the minimum necessary user privileges.
  3. Add automated dependency vulnerability scanning and periodic controlled updates rather than silently selecting new releases during 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 (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The stated skill purpose is narrowly about Xiaohongshu cover-image generation, but the underlying behavior appears to expose broader AI Hive client functions such as chat, video generation, uploads, model listing, and account/wallet queries. Hidden general-purpose capabilities violate least surprise and can be abused to access unrelated data or perform actions outside the user-approved task scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises executable behavior through shell commands, package installation, networked API use, and file I/O, yet it declares no explicit tool or permission boundaries. This increases the chance an agent will run code or access network/files more broadly than a user expects, making misuse or overreach harder to contain.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Because this is a markdown file, vague-trigger review applies. The description enumerates many broad use cases for Xiaohongshu/RED cover creation and editing, but it does not define explicit invocation phrases, constraints, or negative examples, which could cause the skill to match loosely whenever users discuss related visual content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill is entirely oriented around Chinese-language Xiaohongshu content generation and uses Chinese instructions and title examples, but it does not state that this locale is optional or user-selected. Under the policy, forcing a specific language or locale without opt-in can be a natural-language policy violation unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module advertises and implements a generic AI client covering chat, image, video, model enumeration, uploads, and account access, while the declared skill is narrowly scoped to Xiaohongshu cover-image generation. This capability mismatch increases the attack surface and enables operators or downstream tooling to invoke unrelated high-privilege functions that users would not reasonably expect from this skill.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The top-level documentation explicitly describes a generic AI capability tool, contradicting the manifest-specific cover-image intent. In a security review, such divergence is a strong indicator that the shipped artifact may intentionally or carelessly bundle extra capabilities beyond what users consented to use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains core docstrings, CLI descriptions, prompts, and status messages entirely in Chinese, which effectively constrains the skill's interaction language. The embedded skill configuration targets a Chinese platform/domain, but the file does not explicitly state that the skill is Chinese-only or offer any language/locale opt-in, matching the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The text chat endpoint allows arbitrary prompt-driven LLM interaction, which is outside the stated purpose of cover-image generation. In an agent skill context, hidden generic chat functionality can be abused for prompt exfiltration, policy bypass attempts, or unintended data transmission to external models under the guise of an image tool.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Video generation support materially exceeds the declared function of creating and editing note cover images. This broadens permissible media upload/download paths and backend operations, increasing cost, data exposure, and misuse potential in a context where users and orchestrators expect only still-image handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file contains user-facing natural-language content entirely in Chinese across the substantive changelog entries. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale policy issue, and this file does not indicate any language choice or regional limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The placeholder value 请替换为你的APIKey is presented only in Chinese, which imposes a specific language on users reading the configuration example. There is no indication that the skill is region-specific or that other language options are supported, so this is 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
90% confidence
Finding

User-info retrieval exposes account metadata and wallet balance that are unrelated to generating cover images. In a narrowly scoped creative skill, this violates least privilege and may leak sensitive billing or account information if the command is invoked by an agent or user who assumes image-only behavior.

Content

No source excerpt is available for this finding.