Back to skill

Security audit

Maxun

Security checks for vulnerabilities and agentic risk

Overview

This Maxun skill appears to be a real service integration, but it requests excessive local execution authority and includes unsafe helper-script behavior that users should review before installing.

Review this skill before installing. Use it only with a narrowly scoped execution policy, keep approval prompts on for run and abort actions, avoid running it from directories containing untrusted .env files, and do not allow arbitrary MAXUN_BASE_URL values to receive your Maxun API key.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/maxun.sh:43
Finding
Arbitrary Python Code Execution Through Unsafe Limit Interpolation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/maxun.sh`, lines 43–47 **Vulnerability Type**: Python code injection caused by unsafe interpolation **Risk Level**: High ### Vulnerable Code ```bash list) LIMIT="${2:-}" _get "/api/sdk/robots" | python3 -c " import json, sys raw = '${LIMIT}' limit = int(raw) if raw.isdigit() else None ``` ### Technical Analysis The second command-line argument is inserted directly into source code passed to `python3 -c`. Shell quoting does not make this safe because the interpolation occurs inside a Python string literal. An argument containing a single quote can terminate that literal and introduce arbitrary Python statements. Although `SKILL.md` directs the agent to invoke exactly `maxun list`, the packaged script itself accepts a second argument. The vulnerability remains reachable by direct invocation, by another caller using the helper, or if the agent’s command-generation restrictions are bypassed. For example, a value constructed to close `raw = '...'`, execute Python code, and comment out the remainder could invoke `os.system`, `subprocess`, or Python file and network APIs. The injected Python process runs with the same user identity and environment as the Skill. ### Attack Path 1. The attacker obtains influence over the second argument passed to `maxun.sh list`, either through direct invocation or compromised command construction. 2. The attacker supplies an argument containing a single quote and additional Python syntax. 3. Bash substitutes that value into the multiline `python3 -c` program. 4. The injected syntax escapes the intended `raw` string literal. 5. Python executes the attacker-controlled statements with the Skill process’s privileges. ### Impact Assessment Successful exploitation permits arbitrary local code execution. The attacker could read or modify files available to the gateway user, access environment variables such as `MAXUN_API_KEY`, issue network requests, invoke other prog ...[truncated 176 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Never interpolate an argument into dynamically generated Python source. Pass the value as a normal process argument and read it through `sys.argv`: ```bash LIMIT="${2:-}" _get "/api/sdk/robots" | python3 -c ' import json import sys raw = sys.argv[1] limit = int(raw) if raw.isdigit() else None data = json.load(sys.stdin) # Continue processing data here. ' "$LIMIT" ``` Also enforce an explicit shell-side validation rule before invoking Python: ```bash if [[ -n "$LIMIT" && ! "$LIMIT" =~ ^[0-9]+$ ]]; then echo '{"error":"limit must be a positive integer"}' >&2 exit 2 fi ``` Restrict the execution policy to the documented commands and argument formats instead of relying only on instructions in `SKILL.md`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/maxun.sh:14
Finding
Arbitrary Shell Execution Through Automatic Sourcing of Working-Directory .env<![CDATA[ ## Vulnerability Details **File Location**: `scripts/maxun.sh`, lines 14–18 **Vulnerability Type**: Execution of an untrusted configuration file as shell code **Risk Level**: High ### Vulnerable Code ```bash if [ -f .env ]; then set -a source .env set +a fi ``` ### Technical Analysis Bash `source` does not parse `.env` as passive configuration data. It executes the file as shell code in the current process. Consequently, command substitutions, function definitions, redirections, external commands, and other shell constructs in `.env` execute immediately. The path is relative to the current working directory rather than a fixed, trusted Skill directory. A repository, temporary directory, or other attacker-influenced working directory can therefore provide the `.env` file executed by the helper. This behavior is unnecessary for the declared functionality because `SKILL.md` already requires `MAXUN_API_KEY` to be provided through the host environment. ### Attack Path 1. An attacker creates or modifies `.env` in a directory from which the Skill will be invoked. 2. The file contains shell commands in addition to, or instead of, environment assignments. 3. A user or agent invokes any `maxun.sh` command while that directory is the current working directory. 4. The script detects `.env` and sources it before processing the command. 5. Bash executes the attacker’s commands with the same privileges as the Skill process. ### Impact Assessment This provides arbitrary shell command execution before any Maxun API operation occurs. The attacker can access the Skill’s environment, steal `MAXUN_API_KEY`, alter executable lookup behavior, modify files, invoke network utilities, or run additional payloads. Under the documented full gateway execution configuration, the impact extends to all resources accessible to that gateway identity. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions Remove automatic `.env` loading and require `MAXUN_API_KEY` to be supplied by the OpenClaw environment configuration: ```bash API_KEY="${MAXUN_API_KEY:-}" ``` If dotenv support is essential, use a parser that only accepts a narrowly defined `KEY=VALUE` format and never evaluates shell syntax. Load from a fixed, trusted path with ownership and permission checks rather than from the current working directory. Additional hardening should include: - Rejecting unexpected variable names. - Rejecting command substitutions, shell metacharacters, and multiline values. - Requiring the configuration file to be owned by the expected user. - Rejecting group-writable or world-writable configuration files. - Avoiding changes to `PATH`, shell startup variables, and command-related environment variables. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/maxun.sh:20
Finding
Maxun API Key Disclosure Through Unrestricted Base URL Override<![CDATA[ ## Vulnerability Details **File Location**: `scripts/maxun.sh`, lines 20–33 **Vulnerability Type**: Credential exfiltration through attacker-controlled request destination **Risk Level**: High ### Vulnerable Code ```bash BASE_URL="${MAXUN_BASE_URL:-https://app.maxun.dev}" API_KEY="${MAXUN_API_KEY:-}" if [[ -z "$API_KEY" ]]; then echo '{"error": "MAXUN_API_KEY environment variable is not set"}' >&2 exit 1 fi AUTH_HEADER="x-api-key: $API_KEY" _get() { curl -sf -H "$AUTH_HEADER" -H "Content-Type: application/json" "$BASE_URL$1" } ``` The same destination is also used for authenticated POST requests: ```bash _post() { local path="$1" local body="${2:-{}}" curl -sf -X POST -H "$AUTH_HEADER" -H "Content-Type: application/json" \ -d "$body" "$BASE_URL$path" } ``` ### Technical Analysis The script sends `MAXUN_API_KEY` in the `x-api-key` header to any destination selected through `MAXUN_BASE_URL`. There is no scheme validation, hostname allowlist, or trust-boundary check before attaching the credential. This is particularly dangerous in combination with the automatic `.env` sourcing behavior. An attacker-controlled `.env` does not need to contain executable shell syntax to cause credential disclosure; it can simply assign an attacker URL to `MAXUN_BASE_URL`. The next list, get, run, result, runs, or abort operation sends the key to that server. A configurable endpoint can be legitimate for development or self-hosting, but attaching a production secret to an unrestricted destination violates least-privilege and credential-scoping principles. ### Attack Path 1. The attacker controls an environment value or a working-directory `.env` file. 2. The attacker sets `MAXUN_BASE_URL` to a server they operate. 3. The victim invokes any supported Maxun command. 4. `_get` or `_post` constructs a request to the attacker’s URL. 5. `curl` includes `x-api-key: <MAXUN_API_KEY>` in the request. 6. The attacker records the header and reuses the creden ...[truncated 366 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Prefer a fixed service endpoint: ```bash readonly BASE_URL="https://app.maxun.dev" ``` If endpoint customization is required, validate the URL before creating authenticated requests: - Require the `https` scheme. - Compare the parsed hostname against an explicit allowlist. - Reject embedded credentials, fragments, unexpected ports, and malformed hosts. - Maintain separate credentials for development, self-hosted, and production endpoints. - Do not send the API key until the destination has passed validation. - Keep redirect behavior disabled unless every redirect target is independently validated. For example, endpoint selection could be limited to a small explicit case statement rather than accepting an arbitrary URL. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:93
Finding
Unrestricted Gateway Command Execution with User Approval Disabled<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 93–104 **Vulnerability Type**: Excessive execution privileges and disabled confirmation **Risk Level**: High ### Vulnerable Code ```json "tools": { "exec": { "host": "gateway", "security": "full", "ask": "off" } }, "env": { "MAXUN_API_KEY": "your-api-key-here" } ``` ### Technical Analysis The setup instructions grant the Skill full command-execution access on the gateway and explicitly disable approval prompts. The declared functionality only requires execution of a fixed helper with a small set of Maxun subcommands. Full gateway execution is therefore broader than the minimum privileges necessary. This configuration removes an important security boundary around state-changing operations such as starting or aborting robot runs. It also amplifies the impact of the Python injection and unsafe `.env` sourcing vulnerabilities: exploitation does not require a user to approve the resulting command execution. Instruction-level restrictions such as requiring an exact `maxun list` command are not an adequate substitute for enforceable tool permissions. ### Attack Path 1. The user follows the documented setup and enables `exec` with `security: "full"` and `ask: "off"`. 2. The Skill receives unrestricted gateway command-execution capability without interactive approval. 3. An attacker exploits an argument-injection path, places a malicious `.env`, or otherwise influences command generation. 4. The resulting commands execute automatically under the gateway identity. 5. The attacker accesses every local or network resource available to that identity. ### Impact Assessment The configuration can expose files, environment variables, credentials, network access, and executable tools available to the gateway user. It also permits unauthorized Maxun operations without confirmation. The exact system-wide impact depends on the gateway identity’s permissions, but the configuration substantially exce ...[truncated 70 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Replace unrestricted execution with an allowlisted execution profile that permits only the packaged Maxun helper and its documented subcommands. The policy should: - Resolve the helper through a fixed absolute path. - Permit only `list`, `get`, `run`, `result`, `runs`, and `abort`. - Validate robot and run identifiers against strict formats. - Reject shell operators, additional commands, arbitrary executables, and unexpected arguments. - Keep user approval enabled for state-changing operations, especially `run` and `abort`. - Execute under a dedicated low-privilege identity with minimal filesystem and network access. - Expose only the required `MAXUN_API_KEY` secret to the helper process. - Apply outbound network restrictions so authenticated traffic can reach only approved Maxun endpoints. Tool-level controls should enforce these restrictions even if Skill instructions or generated commands are compromised. ]]>
Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
Findings (11)

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The setup directs users to enable the `exec` tool with `security: full`, which grants unrestricted shell execution for a skill that only needs to interact with a specific service. This broadens the blast radius from a scoped API integration to arbitrary command execution if the skill is abused, modified, or combined with prompt injection.

Missing User Warnings

High
Confidence
97% confidence
Finding
The setup disables execution confirmation (`ask: off`) while the skill can run and abort scraping jobs, removing an important human-in-the-loop safeguard. If the skill is invoked mistakenly or influenced by untrusted content, commands can execute immediately without user awareness or approval.

Credential Access

High
Category
Privilege Escalation
Content
set -euo pipefail

if [ -f .env ]; then
  set -a
  source .env
  set +a
Confidence
91% confidence
Finding
The script sources a local .env file as shell code, not as passive configuration. If an attacker can modify .env in the working directory, they can achieve arbitrary command execution when the skill runs, and the auto-export behavior can also expose unexpected variables to subprocesses.

Credential Access

High
Category
Privilege Escalation
Content
if [ -f .env ]; then
  set -a
  source .env
  set +a
fi
Confidence
88% confidence
Finding
The .env loading block exports all variables from a locally sourced file into the environment of curl and python3 subprocesses. In the context of an agent skill, this increases risk because untrusted workspace content can influence execution and propagate attacker-controlled environment variables into downstream tools.

External Script Fetching

High
Category
Supply Chain
Content
AUTH_HEADER="x-api-key: $API_KEY"

_get() {
  curl -sf -H "$AUTH_HEADER" -H "Content-Type: application/json" "$BASE_URL$1"
}

_post() {
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill invokes shell execution via the `exec` tool but does not declare a restrictive tool scope such as `allowed-tools` or permissions boundaries. That creates ambiguity about what the skill is allowed to execute and increases the risk that prompt-driven behavior or future edits could expand into arbitrary command execution beyond the intended Maxun wrapper commands.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger description is broad enough that common phrases about scraping or robots may invoke the skill unexpectedly, increasing the chance of unintended execution. In a skill that can launch or abort jobs, over-invocation raises the risk of unauthorized actions or unnecessary data collection.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The documentation adds an `abort` capability that is not reflected in the manifest description or argument hint, so the skill can perform a more destructive action than users and orchestrators would reasonably expect. Hidden or under-declared capabilities weaken reviewability and can lead to accidental invocation of state-changing operations.

Session Persistence

Medium
Category
Rogue Agent
Content
## Error Handling

- No robots found → tell user to create one at https://app.maxun.dev
- Robot still running → call exec with `maxun result <robotId> <runId>`

## Setup (for new installations)
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.

External Transmission

Medium
Category
Data Exfiltration
Content
AUTH_HEADER="x-api-key: $API_KEY"

_get() {
  curl -sf -H "$AUTH_HEADER" -H "Content-Type: application/json" "$BASE_URL$1"
}

_post() {
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The `abort` command triggers an irreversible action against an in-progress run via a POST request, but this path has no confirmation prompt and no user-facing warning near the operation itself. While the command name implies stopping a run, the code does not disclose the impact at execution time beyond the terse usage label.

Static analysis

No suspicious patterns detected.