Back to skill

Security audit

minimax-plan-usage

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it advertises, but it can send your MiniMax API key to a configurable server, so it needs careful review before installation.

Install only if you trust the environment that will run it. Prefer leaving MINIMAX_API_HOST unset, use MINIMAX_API_KEY through a protected secret mechanism, and avoid passing the key with --api-key. A safer version should hardcode or allowlist MiniMax HTTPS hosts and remove command-line secret entry.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/check_usage.py:10
Finding

API Credential Exfiltration Through an Unvalidated Configurable Host

Content
View full analysis
dict: url = f"{API_HOST}/v1/api/openplatform/coding_plan/remains" resp = requests.get(url, headers={"Authorization": f"Bearer {api_key}"}, timeout=30) resp.raise_for_status() ``` ### Technical Analysis The request destination is constructed from the unvalidated `MINIMAX_API_HOST` environment variable. The script then unconditionally transmits the MiniMax API key to that destination in an HTTP `Authorization` header. No validation ensures that the configured URL: - Uses HTTPS. - Resolves to an approved MiniMax hostname. - Does not contain unexpected URL components. - Represents the endpoint documented by the Skill. Consequently, an actor who can influence the process environment or deployment configuration can redirect the authenticated request to an attacker-controlled server. The use of a timeout and `raise_for_status()` does not prevent credential disclosure because the authorization header has already been transmitted before either control takes effect. The `requests` library also follows redirects by default. Redirect handling should therefore be constrained as defense in depth, although the directly configurable initial destination is sufficient to exploit the vulnerability. ### Attack Path 1. The victim has a valid MiniMax credential stored in `MINIMAX_API_KEY`. 2. An attacker influences the Skill's launch environment, service configuration, wrapper script, or other mechanism that sets `MINIMAX_API_HOST`. 3. The attacker sets the variable to a server under their control, for example `https://attacker.example`. 4. The user invokes the MiniMax usage Skill. 5. The script sends a request to: `https://attac ...[truncated 851 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/check_usage.py:42
Finding

API Key Exposure Through Command-Line Arguments

Content
View full analysis
` 2. The API key becomes part of the process argument vector. 3. During execution, a local user or monitoring process with sufficient process-inspection access reads the argument vector. 4. Alternatively, the command is retained in shell history, automation logs, or CI/CD output. 5. The observer extracts the key and uses it against MiniMax services within the credential's authorized scope. ### Impact Assessment Successful exploitation discloses the MiniMax API key to a local observer or to any party with access to command histories or automation logs. The exposed key may permit unauthorized consumption of plan quota and use of any MiniMax API capabilities assigned to it. This issue does not directly provide local privilege escalation. Its impact is bounded by the API credential's privileges and by the attacker's ...[truncated 62 chars]
Remediation
View remediation
Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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 (4)

Tainted flow: 'url' from os.environ.get (line 14, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
92% confidence
Finding

The request destination is derived from the MINIMAX_API_HOST environment variable and the script sends the Bearer API key to that host in the Authorization header. If an attacker can influence the environment or packaging/runtime configuration, they can redirect the request to an attacker-controlled server and exfiltrate the credential. In this skill’s context, the script’s purpose is to query account usage with a sensitive API key, which makes host manipulation more dangerous because credential disclosure is the primary secret at risk.

Content

Scanner excerpt · scripts/check_usage.py (reported line 15)May include surrounding context.

python
def check_usage(api_key: str) -> dict:
    url = f"{API_HOST}/v1/api/openplatform/coding_plan/remains"
    resp = requests.get(url, headers={"Authorization": f"Bearer {api_key}"}, timeout=30)
    resp.raise_for_status()
    return resp.json()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill invokes an exec-based command, requires an API key from the environment, and performs network access, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an overbroad execution surface where the runtime may grant more capability than users or reviewers expect, increasing the risk of secret exposure or unintended external access if the skill is modified or misused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The user-facing title, description, features, and usage instructions are presented in Chinese, while the file also contains English metadata earlier. This creates a natural-language locale constraint without explicit opt-in or a stated region-specific justification, which matches the policy violation criteria for forced language or locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script’s docstring, error messages, and formatted output are presented in Chinese only, with no option for the user to select another language. This is a natural-language policy concern because it imposes a locale/language choice rather than offering user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.