Back to skill

Security audit

mini-swe-agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is a Review item because it makes an agent run an autonomous coding tool through Bash in always-on unattended mode, with weak safeguards against unsafe commands or unintended file changes.

Install only if you are comfortable with a secondary coding agent making changes and possibly running commands without prompts. Use it in an isolated repository or container, keep secrets out of the environment, avoid feeding untrusted issue text directly into the command, and review the exact command, resulting diff, and command output before accepting changes.

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
SKILL.md:8
Finding
Shell Command Injection Through User-Controlled Problem Statements## Vulnerability Details **File Location**: `SKILL.md`, lines 8–16; duplicated at lines 38–47 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```markdown ## Usage When a complex coding task is requested, formulate a concise, descriptive problem statement and run the `mini` CLI using a bash tool. ```bash mini --yolo "Fix the authentication logic in /src/auth.py to ensure tokens expire after 3600 seconds" Rules Autonomy: Always use the --yolo flag so the agent runs autonomously without waiting for user input. Formatting: Escape double quotes inside the problem statement if necessary. ``` ### Technical Analysis The skill instructs the agent to place a problem statement derived from a user's request into a Bash command. Its only stated sanitization measure is escaping double quotation marks. Escaping double quotes does not make untrusted content safe inside a double-quoted Bash argument. Bash continues to evaluate command substitutions using `$(...)` and backticks inside double quotes. Depending on how the command is assembled, newlines, backslashes, and other shell syntax may introduce additional parsing risks. For example, if an attacker supplies a problem statement containing `$(arbitrary-command)`, constructing the documented command as shell text can cause Bash to execute that command before invoking `mini`. The same unsafe guidance appears in the installation-copy content later in the file. ### Attack Path 1. An attacker places shell substitution syntax in a coding request, issue description, or other text used to formulate the problem statement. 2. The agent follows the skill and interpolates that text into `mini --yolo "..."`. 3. The command is passed to a Bash tool as shell source. 4. Bash evaluates embedded `$(...)` or backtick substitution despite the surrounding double quotes. 5. The injected command executes with the filesystem, network, environment, and cre ...[truncated 599 chars]
Remediation
## Remediation Suggestions - Do not construct a shell command by interpolating the problem statement into command text. - Invoke `mini` through a structured process API with an argument array, equivalent to `["mini", "--yolo", problemStatement]`, without `shell=true`. - If the available execution interface only accepts shell source, apply a well-tested POSIX shell-quoting routine to the complete argument rather than merely escaping double quotes. - Reject or safely handle control characters, command substitutions, backticks, and unexpected newlines as defense in depth. - Keep user-controlled issue and repository content separate from executable instructions. - Add tests covering payloads containing `$(...)`, backticks, quotation marks, backslashes, semicolons, and newlines. - Correct both copies of the instructions so the installed version does not preserve the vulnerable pattern.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:14
Finding
Mandatory Unrestricted Autonomous Agent Execution## Vulnerability Details **File Location**: `SKILL.md`, line 14; duplicated at line 46 **Vulnerability Type**: Excessive autonomous execution privileges **Risk Level**: Medium ### Vulnerable Code ```markdown Autonomy: Always use the --yolo flag so the agent runs autonomously without waiting for user input. ``` The duplicated installation copy states: ```markdown * **Autonomy:** Always use the `--yolo` flag so the agent runs autonomously without waiting for user input. ``` ### Technical Analysis The skill mandates `--yolo` mode for every qualifying task. This removes interactive approval boundaries while providing no corresponding requirements for sandboxing, least-privilege execution, writable-path restrictions, network isolation, credential removal, command allowlisting, or mandatory review. Complex software repositories can contain malicious instructions in issue text, documentation, tests, build scripts, filenames, or generated output. An autonomous subcontractor with broad tool access may treat such content as actionable and execute commands or make changes beyond the legitimate task. Mandatory unrestricted operation therefore amplifies repository prompt injection, unsafe build behavior, and destructive mistakes. ### Attack Path 1. An attacker contributes malicious or misleading content to a repository or issue that the agent is asked to process. 2. The host agent delegates the task using the mandatory `--yolo` flag. 3. The subcontractor explores the repository and encounters attacker-controlled instructions or executable project content. 4. Because confirmation is disabled, it may run commands, install components, access files, or modify resources without review. 5. Those operations execute with every permission and credential exposed to the subcontractor process. 6. Damage may occur before the host agent performs any post-execution verification. ### Impact Assessment The instruction can expose all re ...[truncated 503 chars]
Remediation
## Remediation Suggestions - Remove the requirement to always use `--yolo`; make approval-based execution the default. - Require explicit, informed user authorization before enabling autonomous mode. - Run autonomous jobs in an isolated sandbox with only the target repository mounted as writable. - Remove unrelated credentials and secrets from the environment. - Disable network access by default and enable only narrowly required destinations. - Restrict executable commands and prevent access to sensitive host paths. - Require a proposed plan or change preview before execution for high-impact operations. - Review the resulting diff and command log, then run controlled tests before accepting changes. - Define stop conditions for destructive commands, dependency installation, permission changes, and operations outside the declared project scope. - Apply the same corrections to the duplicated installation copy in `SKILL.md`.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Ae1

High
Category
analysis-evasion
Content
ecessary OpenClaw skills directory (if it doesn't already exist) and write the `SKILL.md` file directly into it.
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill promotes end-to-end autonomous code editing for bug fixes and feature work without warning that user files may be modified or that commands may execute without interactive confirmation. Because it is positioned as a general-purpose subcontractor for complex tasks, the lack of disclosure and approval gates increases the chance of destructive edits, unsafe code introduction, or execution side effects.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill explicitly instructs the agent to invoke a shell-based autonomous coding tool with `--yolo`, which implies unattended execution of code exploration and modification. In this context, the command is driven by a natural-language problem statement and lacks safeguards such as confirmation, sandboxing, scope restrictions, or approval before file changes, making unintended or unsafe actions substantially more likely.

Session Persistence

Medium
Category
Rogue Agent
Content
### 2. How to Build/Install It

Instead of creating it manually, you can run this single command in your terminal. It will create the necessary OpenClaw skills directory (if it doesn't already exist) and write the `SKILL.md` file directly into it.

```bash
mkdir -p ~/.openclaw/skills/mini-swe-agent && cat << 'EOF' > ~/.openclaw/skills/mini-swe-agent/SKILL.md
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.

Skill Enumeration

Medium
Category
Agent Snooping
Content
Instead of creating it manually, you can run this single command in your terminal. It will create the necessary OpenClaw skills directory (if it doesn't already exist) and write the `SKILL.md` file directly into it.

```bash
mkdir -p ~/.openclaw/skills/mini-swe-agent && cat << 'EOF' > ~/.openclaw/skills/mini-swe-agent/SKILL.md
# mini-swe-agent

Run complex software engineering tasks autonomously using the mini-swe-agent CLI.
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Static analysis

No suspicious patterns detected.