Back to skill

Security audit

MiniMax Vision Captcha

Security checks for vulnerabilities and agentic risk

Overview

This CAPTCHA/image-analysis skill has legitimate vision-use pieces, but it also enables CAPTCHA bypass and ships an unsafe script that can upload unintended screenshots and allow command injection.

Review carefully before installing. Do not use this for CAPTCHA or slider challenges unless you are certain it is allowed for that site and account. For benign OCR or screenshot analysis, provide only explicit, reviewed image paths, redact sensitive content first, and avoid running the included helper until the command-injection bug and automatic screenshot fallback are fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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/solve-captcha.js:81
Finding
Shell Command Injection Through Unsanitized Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/solve-captcha.js`, lines 81–82 **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```js const cmd = `mcporter call minimax-coding-plan.understand_image prompt="${prompt}" image_source="${imagePath}"`; const result = execSync(cmd, { encoding: 'utf-8', timeout: 30000 }); ``` ### Technical Analysis The script constructs a shell command by directly interpolating the user-controlled `prompt` and `imagePath` values. These values are populated from command-line arguments and are not escaped or validated before being passed to `execSync`. Because `execSync` executes the constructed string through a shell, enclosing values in double quotes does not make them safe. An attacker can use quote termination, command substitution, backticks, or other shell syntax to execute additional commands. The `prompt` argument provides a direct exploitation route without needing to satisfy the image existence check applied to `imagePath`. ### Attack Path 1. An attacker persuades a user or automation system to invoke the script with a malicious `--prompt` value. 2. The argument is assigned directly to the `prompt` variable. 3. The value is interpolated into the `cmd` shell-command string. 4. Shell metacharacters or command substitutions embedded in the value are interpreted by the shell. 5. The injected command executes with the permissions of the account running the Skill. For example, a malicious prompt containing a quote breakout or shell command substitution could cause an additional local command to run when the MiniMax request is initiated. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the invoking process. Depending on those privileges, an attacker could: - Read application files, environment variables, tokens, or other credentials accessible to the invoking user. - Modify or delete local files. - Execute additiona ...[truncated 363 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Avoid constructing a shell-command string. Invoke the executable directly and pass each argument separately: ```js const { execFileSync } = require('child_process'); const result = execFileSync( 'mcporter', [ 'call', 'minimax-coding-plan.understand_image', `prompt=${prompt}`, `image_source=${imagePath}` ], { encoding: 'utf-8', timeout: 30000, shell: false } ); ``` Additional hardening should include: 1. Verify that every option requiring a value actually has a following argument. 2. Reject null bytes and unexpected control characters. 3. Resolve the image path with `fs.realpathSync` and verify it is within an explicitly permitted directory. 4. Apply reasonable length limits to prompts and paths. 5. Use a restricted execution account with only the filesystem permissions required for image analysis. 6. Avoid logging sensitive prompts or filesystem paths unless explicitly requested. 7. Add automated tests containing quotes, command substitutions, backticks, semicolons, and newline characters to confirm they are treated only as literal argument data. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/solve-captcha.js:51
Finding
Automatic Disclosure of an Unintended Browser Screenshot<![CDATA[ ## Vulnerability Details **File Location**: `scripts/solve-captcha.js`, lines 51–62 and 81–82 **Vulnerability Type**: Unintended sensitive-file selection and external data disclosure **Risk Level**: Medium ### Vulnerable Code ```js // 如果没有指定图片,查找最新的截图 if (!imagePath) { const mediaDir = '/root/.openclaw/media/browser'; try { const files = fs.readdirSync(mediaDir) .filter(f => f.endsWith('.png')) .map(f => ({ name: f, time: fs.statSync(path.join(mediaDir, f)).mtime })) .sort((a, b) => b.time - a.time); if (files.length > 0) { imagePath = path.join(mediaDir, files[0].name); console.log('使用最新截图:', files[0].name); } ``` The automatically selected file is subsequently submitted for image analysis: ```js const cmd = `mcporter call minimax-coding-plan.understand_image prompt="${prompt}" image_source="${imagePath}"`; const result = execSync(cmd, { encoding: 'utf-8', timeout: 30000 }); ``` ### Technical Analysis When no image path is supplied, the script enumerates `/root/.openclaw/media/browser`, sorts all PNG files by modification time, and selects the newest one without verifying its origin, purpose, content, or relationship to the current request. The selected screenshot is then supplied to the configured MiniMax vision service through `mcporter`. The latest screenshot may belong to another browsing workflow and may contain authentication pages, messages, personal information, account details, or other sensitive content. Although the documentation describes screenshot analysis, it does not clearly disclose that omitting an image causes the script to inspect a privileged browser-media directory and automatically submit the newest PNG. Merely printing the selected filename does not provide meaningful consent because submission follows immediately without confirmation. ### Attack Path 1. A browser screenshot containing sensitive content is stored in `/root/.openclaw/media/browser`. 2. The Skill is i ...[truncated 1315 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Require the caller to provide an explicit image path and remove the automatic latest-screenshot fallback: ```js if (!imagePath) { console.error('An explicit image path is required.'); process.exit(1); } ``` If automatic selection is an essential feature, implement all of the following controls: 1. Make automatic selection an explicit option, such as `--latest-screenshot`, rather than the default. 2. Display the canonical path and require interactive confirmation before transmitting the image. 3. Restrict selection to a task-specific directory rather than a shared browser-history directory. 4. Associate screenshots with the current browser target or task identifier and reject unrelated files. 5. Enforce an allowlist of permitted directories after canonicalizing the path to prevent path traversal and symbolic-link confusion. 6. Run with least privilege and avoid accessing `/root` unless elevated access is strictly required. 7. Clearly document that image content is sent to an external vision service, including applicable retention and privacy implications. 8. Consider local redaction or sensitive-content detection before transmission. 9. Avoid retaining screenshots longer than necessary and apply restrictive filesystem permissions. ]]>
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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The script builds a shell command with both `prompt` and `imagePath` interpolated directly into a string passed to `execSync`. Because these values come from command-line arguments and are not safely escaped, an attacker can inject shell metacharacters and execute arbitrary commands on the host, which is far more dangerous than the stated image-recognition purpose.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The skill description is broad enough to trigger on general image analysis, screenshot extraction, and CAPTCHA-related tasks, which increases the chance the agent will invoke it in contexts involving sensitive visual data or prohibited automation. Broad activation criteria are especially risky here because the skill explicitly covers CAPTCHA solving, making accidental misuse more likely.

Ssd 4

Medium
Confidence
98% confidence
Finding
The skill directly provides a workflow for using vision analysis to solve CAPTCHA and slider challenges, which are access-control and anti-abuse mechanisms. Enabling automated or assisted CAPTCHA solving materially supports bypass of protections intended to prevent scripted access, fraud, and account abuse.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation instructs users to send screenshots or image paths to an external vision model without warning that images may contain sensitive information such as credentials, personal data, or internal application content. This creates a real risk of unintended data exfiltration to a third-party service.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger list includes broad phrases such as '图片识别' and '视觉分析', which can match many unrelated user intents and cause the skill to activate unexpectedly. In this skill’s context, unintended activation is more concerning because it performs captcha and image-analysis tasks, which could route screenshots or sensitive visual content to the skill when the user did not specifically request captcha handling.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script sends the selected image to an external vision service (`mcporter call ... understand_image`) without any user-facing notice, consent flow, or minimization of potentially sensitive screenshot contents. Since the tool auto-selects recent browser screenshots, it may exfiltrate credentials, personal data, or session-related information from images users did not explicitly intend to upload.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/solve-captcha.js:82