Back to skill

Security audit

MiniMax Token Plan Quota

Security checks for vulnerabilities and agentic risk

Overview

This is a narrow MiniMax quota-checking skill with disclosed API-key use, but users should handle the key storage guidance carefully.

Install only if you are comfortable giving the skill access to a MiniMax API key for quota checks. Prefer setting MINIMAX_API_KEY in a protected environment or secret manager. If using ~/.openclaw/.env, create ~/.openclaw with 0700 permissions and the .env file with 0600 permissions, and edit the file instead of blindly running the documented printf command. Avoid passing real keys with --api-key or inline shell commands, and rotate any key that may have been saved in shell history or logs.

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

Warning
Location
scripts/check_token_plan_quota.py:63
Finding

Credential setup guidance can overwrite existing secrets and create an insufficiently protected key file

Content
View full analysis
~/.openclaw/.env ``` ``` From `scripts/check_token_plan_quota.py:63-69`: ```python print( f"未找到 {ENV_FILE_HINT}(实际路径:{DEFAULT_ENV_FILE})。请先创建并填写,例如:", file=sys.stderr, ) print( 'mkdir -p ~/.openclaw && printf "MINIMAX_API_KEY=你的key\\n" > ~/.openclaw/.env', file=sys.stderr, ) ``` ### Technical Analysis The recommended shell command uses the `>` redirection operator to write the API key. This truncates `~/.openclaw/.env` before writing the new value. Although the script only prints the command rather than executing it automatically, a user following the documented guidance can erase other credentials and configuration already stored in that file. The command also does not explicitly secure the directory or file permissions. The resulting access mode depends on the user's current `umask`. With a permissive `umask`, the `.env` file may be readable by other local users, exposing the MiniMax API key. The guidance is especially unsafe when the file exists but merely lacks `MINIMAX_API_KEY`, because the documentation still recommends replacing the entire file rather than safely editing or appending to it. ### Attack Path 1. The user invokes the quota-checking script without a resolvable MiniMax API key. 2. The script prints the credential setup command, or the user copies the equivalent command from `SKILL.md`. 3. The user executes the command. 4. If `~/.openclaw/.env` already exists, shell redirection truncates it and deletes any other environment variables or credentials. 5. If the user's `umask` permits grou ...[truncated 813 chars]
Remediation
View remediation
` redirection for an existing shared environment file. - Instruct the user to edit the file with a text editor, or append the variable only after confirming that the key is absent. - Create the credential directory with mode `0700` and the credential file with mode `0600`. - Avoid embedding a real secret directly in a shell command, since commands may be retained in shell history. - Detect an existing `MINIMAX_API_KEY` entry before appending to avoid duplicate or conflicting definitions. - Use guidance similar to: ```bash mkdir -p ~/.openclaw chmod 700 ~/.openclaw touch ~/.openclaw/.env chmod 600 ~/.openclaw/.env printf '%s\n' 'MINIMAX_API_KEY=replace-with-your-key' >> ~/.openclaw/.env ``` This example should only be recommended after confirming that the variable does not already exist. Preferably, tell the user to open the file in an editor and add the value manually. The script's printed guidance and `SKILL.md` must be updated together so they do not provide conflicting security instructions. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/check_token_plan_quota.py:138
Finding

API key accepted through a command-line argument can leak through process metadata and shell history

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

The skill directs users to place a live API key in a plaintext ~/.openclaw/.env file and states the bundled script will read it automatically. Storing credentials in a predictable local file and encouraging command-line injection of secrets increases the chance of accidental disclosure through file access, logs, shell history, or other skills/tools with filesystem visibility.

Content

Scanner excerpt · SKILL.md (reported line 43)May include surrounding context.

bash
mkdir -p ~/.openclaw
printf "MINIMAX_API_KEY=你的key\n" > ~/.openclaw/.env

Commands

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/check_token_plan_quota.py (reported line 11)May include surrounding context.

python
CN_ENDPOINT = "https://www.minimaxi.com/v1/api/openplatform/coding_plan/remains"
GLOBAL_ENDPOINT = "https://www.minimax.io/v1/api/openplatform/coding_plan/remains"
ENV_FILE_HINT = "~/.openclaw/.env"
DEFAULT_ENV_FILE = os.path.expanduser(ENV_FILE_HINT)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/check_token_plan_quota.py (reported line 68)May include surrounding context.

python
file=sys.stderr,
        )
        print(
            'mkdir -p ~/.openclaw && printf "MINIMAX_API_KEY=你的key\\n" > ~/.openclaw/.env',
            file=sys.stderr,
        )
    else:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill clearly instructs use of shell, network access, environment variables, and local file reads (~/.openclaw/.env) but does not declare any tool scope or permission boundaries. That increases the risk of over-broad execution because an agent may invoke capabilities not explicitly constrained by the skill manifest, making credential and network operations less auditable and easier to misuse.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The skill explicitly instructs creation of a persistent directory and .env file under ~/.openclaw, which creates durable session state containing sensitive authentication material. Persisting credentials beyond the immediate task broadens the attack surface because later sessions, unrelated skills, or compromised local processes may read and reuse the stored key.

Content

Scanner excerpt · SKILL.md (reported line 42)May include surrounding context.

  • If ~/.openclaw/.env is missing or lacks MINIMAX_API_KEY, guide the user to add:
bash
mkdir -p ~/.openclaw
printf "MINIMAX_API_KEY=你的key\n" > ~/.openclaw/.env

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/check_token_plan_quota.py (reported line 68)May include surrounding context.

python
file=sys.stderr,
        )
        print(
            'mkdir -p ~/.openclaw && printf "MINIMAX_API_KEY=你的key\\n" > ~/.openclaw/.env',
            file=sys.stderr,
        )
    else:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script allows a secret API key to be passed directly on the command line via --api-key. On many systems, command-line arguments can be exposed through shell history, process listings, audit logs, or job runners, which can unintentionally disclose the credential to other local users or logging systems.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Several user-facing error and guidance messages are hardcoded in Chinese, while the script otherwise uses English identifiers and help text. This forces a specific language for part of the interaction without user opt-in or documented locale justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.