Back to skill

Security audit

minimax-websearch

Security checks for vulnerabilities and agentic risk

Overview

This search helper has a coherent purpose, but it needs review because it runs mutable third-party code and uses an unsafe shell command while handling an API key.

Review before installing. Use only a trusted, pinned version of the MiniMax MCP package, avoid putting secrets into copied config files, and treat every search query as data sent to MiniMax or fallback providers. Do not set MINIMAX_PYTHON or MINIMAX_API_HOST from untrusted instructions; the current script should be hardened to launch Python without a shell before use in a sensitive environment.

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

Error
Location
scripts/minimax_websearch.js:38
Finding

Arbitrary Command Execution Through MINIMAX_PYTHON

Content
View full analysis

Vulnerability Details

File Location: scripts/minimax_websearch.js:38-42 and scripts/minimax_websearch.js:65-72
Vulnerability Type: OS command injection through an environment-controlled executable path
Risk Level: High

Vulnerable Code

js
// Python interpreter (default to E:\.uv-venv on Windows)
const defaultPy = process.platform === 'win32'
  ? 'E:\\.uv-venv\\Scripts\\python.exe'
  : path.join(process.env.HOME || '/usr/local', '.uv-venv', 'bin', 'python');

const pythonExe = process.env.MINIMAX_PYTHON || defaultPy;
const apiHost = process.env.MINIMAX_API_HOST || 'https://api.minimaxi.com';
js
const result = execSync(`"${pythonExe}" -m minimax_mcp.server`, {
  env: { ...process.env, MINIMAX_API_KEY: apiKey, MINIMAX_API_HOST: apiHost, FASTMCP_LOG_LEVEL: 'ERROR', REQUESTS_CA_BUNDLE: VENV_CERTIFI_CA },
  input,
  maxBuffer: 10 * 1024 * 1024,
  timeout: 30000,
  shell: true,
  windowsHide: true
});

Technical Analysis

The value of MINIMAX_PYTHON is copied directly from the process environment and interpolated into a command string passed to execSync. The invocation explicitly enables shell: true, causing the resulting string to be interpreted by the platform command shell rather than invoking the Python executable directly.

Wrapping the value in double quotes does not provide adequate protection. An attacker who can modify the skill's environment or its OpenClaw configuration can insert a closing quote and shell control characters into MINIMAX_PYTHON, escape the intended executable argument, and append an arbitrary command.

This is especially significant because the child environment includes all existing process environment variables and explicitly contains MINIMAX_API_KEY. Any injected process would execute in that environment and could access the credential.

Attack Path

  1. The attacker obtains the ability to influence the OpenClaw environment conf ...[truncated 1171 chars]
Remediation
View remediation

Remediation Suggestions

Replace shell-based execution with an argument-based child-process API:

js
const { execFileSync } = require('child_process');

const result = execFileSync(pythonExe, ['-m', 'minimax_mcp.server'], {
  env: {
    ...process.env,
    MINIMAX_API_KEY: apiKey,
    MINIMAX_API_HOST: apiHost,
    FASTMCP_LOG_LEVEL: 'ERROR',
    REQUESTS_CA_BUNDLE: VENV_CERTIFI_CA
  },
  input,
  maxBuffer: 10 * 1024 * 1024,
  timeout: 30000,
  windowsHide: true,
  shell: false
});

Additional hardening should include:

  1. Resolve pythonExe to an absolute path.
  2. Verify that the resolved path exists and is a regular executable file.
  3. Optionally restrict the interpreter to an administrator-approved path or directory.
  4. Reject values containing null bytes and avoid passing executable paths through a shell under all circumstances.
  5. Construct a minimal child environment instead of inheriting every variable through ...process.env, where operationally feasible.

T08 · Insecure Dependencies

Warning
Location
SKILL_en.md:27
Finding

Unpinned Third-Party MCP Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:27 and SKILL_en.md:27
Vulnerability Type: Mutable, unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code

powershell
# Install MCP package
E:\.uv-venv\Scripts\pip.exe install minimax-coding-plan-mcp

The Chinese documentation contains the equivalent unpinned command:

powershell
# 安装 MCP 包
E:\.uv-venv\Scripts\pip.exe install minimax-coding-plan-mcp

Technical Analysis

The installation instructions request the latest package version available from pip's configured package index. No exact version or package hash is enforced. Consequently, the code installed by users can change after this skill has been reviewed.

This contradicts the technical-details sections of the documentation, which identify the intended dependency as minimax-coding-plan-mcp==0.0.4. Merely mentioning a version in descriptive text does not cause pip to enforce that version.

The dependency is security-sensitive because the skill starts it as executable Python code:

js
execSync(`"${pythonExe}" -m minimax_mcp.server`, ...)

The dependency also receives MINIMAX_API_KEY in its environment. A compromised, malicious, or unexpectedly incompatible future release would therefore execute locally and have direct access to the supplied API credential.

Attack Path

  1. A user follows the documented installation command.
  2. Pip resolves the package name to whichever release is current in the configured package index.
  3. A compromised upstream release, compromised package-index account, unsafe mirror, or unintended future version is downloaded and installed.
  4. The user invokes the web-search script.
  5. The script executes the installed minimax_mcp.server module and supplies the MiniMax API key in its environment.
  6. Harmful dependency code could access the credential and perform any action allowed to the user's Python pro ...[truncated 727 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the documented, reviewed version explicitly:

    powershell
    E:\.uv-venv\Scripts\pip.exe install "minimax-coding-plan-mcp==0.0.4"
    
  2. Prefer a locked requirements file containing hashes, and install it with hash enforcement:

    powershell
    E:\.uv-venv\Scripts\pip.exe install --require-hashes -r requirements.lock
    
  3. Pin and hash transitive dependencies as well as the top-level package.

  4. Ensure both language versions of the documentation use the same secured installation command.

  5. Document the trusted package index and consider using an organization-controlled mirror.

  6. Review and deliberately update the lock file when adopting a newer dependency release rather than automatically installing the latest version.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (8)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill performs web searches through external providers (MiniMax, Brave Search, and potentially Qwen Chat) but does not clearly warn users that their queries and possibly surrounding task context will be transmitted to third-party services. This can expose sensitive prompts, internal project details, or personal data through normal use, especially because the fallback chain changes providers based on runtime state.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
65% confidence
Finding

uvx/uv tool run commands without ==version create a rug-pull risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code launches a Python subprocess and passes the user query plus API configuration to an external MCP server that performs a web search against a remote API host. While the script has usage text and env-var requirements, it does not clearly warn the user that their query will be sent off-box to a remote service, which is a safety-relevant disclosure for networked operations in code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language comment is written only in Chinese and provides no language choice or opt-in. Under the policy, forcing a specific language without user choice is a locale/language policy violation unless clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The usage strings specify the query as '搜索关键词', indicating a Chinese-language interaction pattern, but there is no indication that users may provide queries in other languages or choose locale behavior. This can conflict with language/locale policy expectations when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.