Back to skill

Security audit

AI电商专家|小红书电商 图片视频全内容

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for IMIVA ecommerce content generation, but it runs a mutable external npm package with broad inherited credentials and exposes broadly scoped MCP calls.

Review before installing. Use only a dedicated, low-scope IMIVA token, avoid running it in environments containing unrelated secrets, prefer a pinned reviewed npm package version, and require explicit confirmation before creating paid tasks or using non-default endpoints.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
scripts/imiva_mcp.py:14
Finding

Automatic Execution of an Unpinned npm Package

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:14, scripts/imiva_mcp.py:54-62; also documented in SKILL.md:46,86-94 and references/mcp-config.example.json:4-9
Vulnerability Type: T08: Insecure Dependencies
Risk Level: High

Vulnerable Code

python
PACKAGE = "@infimind/ecom-content-cli@latest"
python
proc = subprocess.Popen(
    [npx, "-y", PACKAGE],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True,
    bufsize=1,
    env=env,
)

The example configuration contains the same mutable dependency:

json
{
  "command": "npx",
  "args": [
    "-y",
    "@infimind/ecom-content-cli@latest"
  ]
}

Technical Analysis

The helper launches @infimind/ecom-content-cli@latest through npx -y. The latest tag is mutable and can resolve to a different package version each time the helper is executed. The -y option suppresses the installation confirmation, allowing the resolved package to be downloaded and executed automatically.

Consequently, the effective executable payload is not fixed to the code reviewed in this audit. A compromised npm publisher account, malicious package update, registry compromise, or upstream supply-chain incident could cause arbitrary code to run during an otherwise legitimate Skill invocation.

Attack Path

  1. An attacker compromises the npm package publisher, publication pipeline, or another relevant part of the package supply chain.
  2. The attacker publishes a malicious release and assigns it the latest distribution tag.
  3. A user follows the documented configuration or runs scripts/imiva_mcp.py.
  4. npx -y resolves, downloads, and starts the malicious release without an interactive confirmation.
  5. The malicious package executes with the operating-system privileges and environment of the invoking user.
  6. It may access available files, the MCP token, ...[truncated 700 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace @latest with an exact, reviewed package version, such as @infimind/ecom-content-cli@1.2.3.
  2. Use a lockfile and verify package integrity with a trusted registry checksum.
  3. Prefer installing dependencies during a controlled build or setup phase rather than downloading executable code at runtime.
  4. Remove -y where practical so unexpected installation changes require explicit approval.
  5. Review package updates before changing the pinned version.
  6. Run the MCP package in a sandbox with restricted filesystem, environment, and network access.
  7. Apply the same version pinning to SKILL.md, references/mcp-config.example.json, and the Python helper so all supported invocation paths remain consistent.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/imiva_mcp.py:51
Finding

External MCP Process Inherits the Entire Parent Environment

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:51-62
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation, T09: Insecure Skill Coding Practices
Risk Level: High

Vulnerable Code

python
env = os.environ.copy()
env["MCP_TOKEN"] = token
env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL))
proc = subprocess.Popen(
    [npx, "-y", PACKAGE],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    text=True,
    bufsize=1,
    env=env,
)

Technical Analysis

os.environ.copy() copies every environment variable from the Python process into the child npm process. The child only requires a limited runtime environment, the MCP token, and an API endpoint, but it receives all variables available to the caller.

Developer and automation environments commonly contain unrelated sensitive values, including cloud credentials, source-control tokens, CI/CD credentials, signing keys, database connection strings, and API keys. Passing these values to mutable third-party code violates least privilege and unnecessarily expands the consequences of a dependency compromise or defect.

Attack Path

  1. The user or automation environment contains unrelated sensitive environment variables.
  2. The helper calls os.environ.copy(), collecting all those values.
  3. The helper starts the externally sourced npm package with the copied environment.
  4. A compromised, malicious, or defective dependency enumerates its process environment.
  5. The dependency stores, uses, or transmits credentials unrelated to the IMIVA task.
  6. The attacker uses the exposed credentials against their corresponding services, subject to each credential's permissions.

Impact Assessment

The immediate privilege scope is the complete set of credentials and configuration inherited from the caller. Depending on the execution envir ...[truncated 460 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace os.environ.copy() with a minimal allowlisted environment.
  2. Include only variables required to start the runtime, such as a controlled PATH, MCP_TOKEN, and the validated API endpoint.
  3. Do not forward cloud, repository, CI/CD, database, or unrelated application credentials.
  4. Run the MCP process under a dedicated low-privilege account or sandbox.
  5. Restrict filesystem and network access to the minimum required for the requested operation.
  6. Pin and review the external package before execution.
  7. Add automated tests verifying that sensitive variables such as AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, and similar credentials are not present in the child environment.

Example hardening pattern:

python
env = {
    "PATH": os.environ.get("PATH", ""),
    "MCP_TOKEN": token,
    "API_URL": DEFAULT_API_URL,
}

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imiva_mcp.py:51
Finding

Environment-Controlled API Endpoint Can Redirect Authentication Traffic

Content
View full analysis

Vulnerability Details

File Location: scripts/imiva_mcp.py:51-53
Vulnerability Type: T09: Insecure Skill Coding Practices
Risk Level: Medium

Vulnerable Code

python
env = os.environ.copy()
env["MCP_TOKEN"] = token
env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL))

Technical Analysis

The helper accepts IMIVA_API_URL or the generic API_URL environment variable without validating the URL scheme, hostname, or destination. It then starts the MCP package with both this endpoint and the valid MCP_TOKEN.

A poisoned shell profile, CI/CD variable, wrapper script, or parent process can therefore redirect the MCP client to an attacker-controlled endpoint. Whether the token is transmitted directly depends on the external package's authentication implementation, but the helper provides no control preventing such disclosure. Non-HTTPS URLs are also accepted, creating a potential plaintext-transport risk.

The use of the generic API_URL fallback increases the chance of accidental redirection because that variable may already be defined for an unrelated application.

Attack Path

  1. An attacker modifies the process environment, a shell initialization file, a CI/CD variable, or a wrapper command.
  2. The attacker sets IMIVA_API_URL or API_URL to an endpoint under their control.
  3. The user invokes scripts/imiva_mcp.py with a valid MCP_TOKEN.
  4. The helper forwards the attacker-controlled endpoint and token to the external MCP process.
  5. The MCP process connects to the supplied endpoint.
  6. If its authentication behavior transmits the token to that endpoint, the attacker captures it and may use it to access the associated IMIVA account.

Impact Assessment

Potential impact includes:

  • Disclosure of the IMIVA MCP token.
  • Unauthorized task creation or account operations allowed by that token.
  • Consumption of account credits.
  • Ex ...[truncated 273 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use the fixed production endpoint https://imiva.ecpro.com unless custom endpoints are an explicit product requirement.
  2. Remove the generic API_URL fallback to avoid collisions with unrelated application configuration.
  3. Parse custom URLs and require the https scheme.
  4. Enforce an allowlist of approved hostnames.
  5. Reject URLs containing user information, unexpected ports, fragments, or unapproved redirect destinations.
  6. Require explicit user confirmation before sending a production token to any non-default endpoint.
  7. Ensure the upstream client does not forward authorization headers or tokens across cross-origin redirects.
  8. Consider using separate, limited-scope tokens for development or approved non-production endpoints.

Example validation policy:

python
from urllib.parse import urlparse

api_url = os.environ.get("IMIVA_API_URL", DEFAULT_API_URL)
parsed = urlparse(api_url)
if parsed.scheme != "https" or parsed.hostname != "imiva.ecpro.com":
    raise SystemExit("Unapproved IMIVA API endpoint.")
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/imiva_mcp.py (reported line 51)May include surrounding context.

python
def invoke(method: str, params: dict | None = None) -> dict:
    npx, token = require_runtime()
    env = os.environ.copy()
    env["MCP_TOKEN"] = token
    env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL))
    proc = subprocess.Popen(

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents shell execution, environment-variable use, and file-path handling, but does not declare any explicit tool allowlist or permissions boundary. In an agent environment, that ambiguity can let the model invoke broader local capabilities than users expect, increasing the chance of unintended command execution, local file access, or exposure of secrets such as MCP tokens.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest sets language: zh-CN, and the skill content is written entirely in Chinese while also including broad English invocation text, but it does not state that the skill is intentionally limited to Chinese-only operation or provide an opt-in language choice. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The user-facing name, description, and default prompt are entirely in Chinese and appear to prescribe a single language experience. The file does not indicate that users can choose another language or that the locale restriction is intentional and justified, which may violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation without any visible activation constraints, so the agent may auto-select this skill for loosely related ecommerce or content-generation requests. In a skill that can trigger real MCP workflows and generate business content, broad automatic routing increases the chance of unintended tool use, accidental task creation, or disclosure of user-provided commercial assets to the wrong skill path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code automatically forwards MCP_TOKEN and API_URL to an external npm package without any user disclosure or confirmation at execution time. In this skill context, that means enterprise credentials may be silently used with a remotely sourced tool, increasing the risk of unintended credential exposure or opaque third-party processing.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/imiva_mcp.py (reported line 54)May include surrounding context.

python
env = os.environ.copy()
    env["MCP_TOKEN"] = token
    env["API_URL"] = os.environ.get("IMIVA_API_URL", os.environ.get("API_URL", DEFAULT_API_URL))
    proc = subprocess.Popen(
        [npx, "-y", PACKAGE],
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes a generic MCP proxy interface (list-tools and arbitrary tools/call) rather than enforcing the narrowly described Xiaohongshu ecommerce-content workflow. That mismatch expands capability beyond user expectations and can be abused to access unrelated token-authorized operations through the same skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Any MCP tool authorized by the provided token can be enumerated and invoked, even if unrelated to Xiaohongshu content generation. In a credentialed enterprise environment, this broad delegated access can lead to misuse of powerful backend tools, data access, or unintended actions well outside the advertised scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The manifest metadata identifies create_koc_note_package_task as the primary tool, and the top-level description emphasizes that tool specifically. However, the file later documents and promotes use of create_product_main_image_task, create_detail_page_task, create_video_generation_task, get_user_credits, and get_user_tasks, showing broader operational behavior than the manifest's narrow tool framing suggests.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The introductory documentation repeatedly presents the skill as focused on '小红书电商 图片视频全内容'. Later sections broaden the intended use to a long list of channels including Taobao, JD, Pinduoduo, Amazon, TikTok Shop, Shopify, Shopee, Lazada, Temu, AliExpress, SHEIN, Etsy, and Instagram, which contradicts the earlier narrow positioning rather than merely adding implementation detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The runtime error messages are written only in Chinese, which imposes a specific language on all users without any visible opt-in or locale selection. This is a natural-language policy concern because the skill does not provide an alternative language or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Several command-line help and validation strings are only in Chinese, including argument errors and parser descriptions. Because the file gives no way to choose language and no documented locale restriction, this appears to enforce a specific language by default.

Content

No source excerpt is available for this finding.