Back to skill

Security audit

Preqstation

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for delegating coding work, but it tells agents to run powerful local coding CLIs with safety controls disabled and unsafe shell command construction.

Install only if you trust the mapped repositories, local CLI agents, and task inputs, and understand that this skill can create branches/worktrees, modify code, run background processes, and bypass normal approval or sandbox controls. Prefer revising it to require explicit invocation, keep sandboxes enabled by default, and pass prompts/paths as safely escaped arguments or files before using it broadly.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:82
Finding
Shell Command Injection Through Unescaped User-Controlled Prompt Content<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:82-83, 145-182` **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```text 4. `objective` - use the user request as the execution objective ``` ```text Task ID: <task or N/A> Project Key: <project key or N/A> User Objective: <objective> Execution Requirements: 1) Work only inside <cwd>. 2) Complete the requested work. 3) After completion, return a short completion summary. ``` ```bash bash pty:true workdir:<cwd> command:"claude --dangerously-skip-permissions '<rendered_prompt>'" ``` ```bash bash pty:true workdir:<cwd> command:"codex exec --dangerously-bypass-approvals-and-sandbox '<rendered_prompt>'" ``` ```bash bash pty:true workdir:<cwd> command:"GEMINI_SANDBOX=false gemini -p '<rendered_prompt>'" ``` ### Technical Analysis The skill instructs OpenClaw to use the original user request as the execution objective and interpolate it into `<rendered_prompt>`. That rendered prompt is then placed inside a single-quoted shell argument. No escaping, argument-array construction, or validation is prescribed before the user-controlled objective reaches the shell command. A single quote in the objective can terminate the intended prompt argument. Subsequent shell metacharacters can then introduce an additional command. The prompt template does not mitigate this issue: wrapping untrusted content in a larger template does not make it safe for shell interpolation. ### Attack Path 1. An attacker submits a PREQSTATION request containing a single quote followed by shell syntax. 2. The skill copies the complete request into the `objective` field. 3. The objective is inserted into `<rendered_prompt>`. 4. The rendered prompt is embedded into the documented command as `'<rendered_prompt>'`. 5. The attacker-provided quote terminates the prompt argument. 6. The shell interprets the remaining injected text as syntax or an additional command. 7. The injected command execut ...[truncated 980 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not build shell command strings by concatenating prompt content. 2. Invoke each engine through a structured argument array so the prompt is passed as one literal argument without shell parsing. 3. If the execution interface supports only shell command strings, apply a well-tested shell-escaping operation to every dynamic value, such as Bash-compatible `%q` serialization. 4. Prefer passing large prompts through standard input or a securely created prompt file rather than interpolating them into command text. 5. Quote and validate every other dynamic value, including worktree paths, project keys, task identifiers, and engine names. 6. Add regression tests using single quotes, double quotes, command substitutions, semicolons, newlines, backticks, and shell redirection characters. 7. Retain sandbox and approval controls so a quoting failure does not immediately become unrestricted host compromise. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:58
Finding
Coding Agents Are Required to Run With Permission and Sandbox Protections Disabled<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:58-61, 166-188` **Vulnerability Type**: Excessive privileges and disabled execution isolation **Risk Level**: High ### Vulnerable Code ```text 4. Use `dangerously-*` / sandbox-disable flags only for actual coding execution with local trusted CLIs. ``` ```text Why `dangerously-*` flags are retained: - This skill targets non-interactive PTY/background execution. - Permission prompts can block unattended runs; these flags avoid that blocking behavior. - These flags are allowed only after passing the required safety gates above and only in resolved task worktrees. - If your environment does not allow these flags, fail fast with a short reason instead of silently falling back. ``` ```bash bash pty:true workdir:<cwd> command:"claude --dangerously-skip-permissions '<rendered_prompt>'" ``` ```bash bash pty:true workdir:<cwd> command:"codex exec --dangerously-bypass-approvals-and-sandbox '<rendered_prompt>'" ``` ```bash bash pty:true workdir:<cwd> command:"GEMINI_SANDBOX=false gemini -p '<rendered_prompt>'" ``` ### Technical Analysis Every supported engine execution mode explicitly disables or bypasses a major safety mechanism: - Claude is launched with permission checks skipped. - Codex is launched with approvals and sandboxing bypassed. - Gemini is launched with its sandbox disabled. The skill relies on a Git worktree and an explicit working directory as safety gates. A working directory is not a security boundary. An unsandboxed process can generally use absolute or relative paths to access other locations available to the host account, inspect environment variables, invoke local programs, communicate over the network, and interact with other processes. Coding agents also process potentially hostile repository content. Instructions embedded in source files, issue descriptions, generated artifacts, or dependency scripts can influence an agent even when the original user is trusted. Disabling a ...[truncated 1724 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Keep each engine's sandbox and approval mechanisms enabled by default. 2. Remove `--dangerously-skip-permissions`, `--dangerously-bypass-approvals-and-sandbox`, and `GEMINI_SANDBOX=false` from standard execution paths. 3. Run agents in a dedicated container or virtual machine when unattended operation is required. 4. Mount only the task worktree into that environment and make unrelated host directories inaccessible. 5. Use a non-privileged, task-specific operating-system account with no inherited SSH agent, cloud credentials, or unrelated environment secrets. 6. Apply deny-by-default network restrictions and allow only destinations required for the task. 7. Require explicit, informed user approval for any exceptional unsandboxed execution, with a clear description of the requested access. 8. Add enforcement that rejects execution when isolation cannot be established rather than treating a worktree as sufficient confinement. 9. Rotate or remove credentials from the agent environment and use narrowly scoped, short-lived credentials where access is necessary. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:132
Finding
Unquoted Dynamic Paths and Git Parameters Permit Shell or Argument Injection<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:132-133, 223-224, 264-272, 278-281` **Vulnerability Type**: Shell and command-line argument injection **Risk Level**: Medium ### Vulnerable Code ```bash git -C <project_cwd> worktree add -b codex/<project_key> <cwd> HEAD git -C <project_cwd> worktree add <cwd> codex/<project_key> ``` ```bash git -C <project_cwd> worktree add -b codex/<project_key> /tmp/openclaw-worktrees/<project_key> HEAD bash pty:true workdir:/tmp/openclaw-worktrees/<project_key> command:"codex exec --dangerously-bypass-approvals-and-sandbox '<rendered_prompt>'" ``` ```bash git worktree add -b codex/<project_key> /tmp/<project_key>-review <base_branch> bash pty:true workdir:/tmp/<project_key>-review command:"codex review --base <base_branch>" REVIEW_DIR=$(mktemp -d) git clone <repo> "$REVIEW_DIR" cd "$REVIEW_DIR" && gh pr checkout <pr_number> bash pty:true workdir:"$REVIEW_DIR" command:"codex review --base origin/main" ``` ```bash git worktree add -b codex/<project_key> /tmp/<project_key> main bash pty:true workdir:/tmp/<project_key> background:true command:"codex exec --dangerously-bypass-approvals-and-sandbox 'Fix issue #101. Commit after validation.'" bash pty:true workdir:/tmp/<project_key> background:true command:"codex exec --dangerously-bypass-approvals-and-sandbox 'Fix issue #102. Commit after validation.'" ``` ### Technical Analysis The documented commands interpolate dynamic values without consistently quoting them. Relevant values include: - `<project_cwd>` - `<project_key>` - `<cwd>` - `<base_branch>` - `<repo>` - `<pr_number>` Some of these values originate directly from user input, while others come from the mutable `MEMORY.md` project mapping. Unquoted shell values can undergo word splitting, glob expansion, and shell metacharacter interpretation. Values beginning with a hyphen can also be interpreted as command options unless the command syntax explicitly terminates option processing. Although the proj ...[truncated 1895 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pass commands as executable-and-argument arrays instead of formatted shell strings. 2. Quote every dynamic path and reference when shell invocation cannot be avoided. 3. Use `--` before positional path arguments wherever the relevant command supports it. 4. Canonicalize project and worktree paths and verify that they remain under approved roots. 5. Validate project keys against a strict pattern such as `^[a-z0-9]+(?:-[a-z0-9]+)*$`. 6. Validate PR numbers as decimal integers only. 7. Validate Git references using `git check-ref-format` and reject shell metacharacters and option-like values. 8. Restrict repository inputs to approved local checkouts or explicitly approved URL schemes and hosts. 9. Treat `MEMORY.md` values as untrusted configuration and validate them again at every execution. 10. Add tests covering spaces, leading hyphens, wildcard characters, quotes, semicolons, command substitution, newlines, and path traversal. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Vague Triggers

Medium
Confidence
96% confidence
Finding
The README instructs the agent to invoke this skill based on broad natural-language cues such as any request about PREQSTATION work, mapped projects, or messages containing keywords like 'preq' or 'preqstation'. Because this skill can launch coding CLIs and create worktrees, ambiguous activation increases the chance of unintended delegation into a code-executing workflow without sufficiently explicit user intent.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The README describes creating git worktrees, launching external CLI tools with PTY access, and managing background processes, but it does not prominently warn about repository modification, long-running execution, or process-control side effects. In a skill whose purpose is to run coding agents in local workspaces, missing safety warnings and guardrails can lead to accidental filesystem changes or unattended execution in the wrong project.

Vague Triggers

Medium
Confidence
94% confidence
Finding
This markdown file defines activation triggers, so vague-trigger review applies. The trigger `preq` is a short, ambiguous token that is not sufficiently constrained and could appear in ordinary abbreviations or project-specific shorthand, increasing the chance of unintended invocation.

Session Persistence

Medium
Category
Rogue Agent
Content
2. Respect the engine the user requested. If unspecified, default to `claude`.
3. Do not kill sessions only because they are slow; poll/log first.
4. Never launch coding agents in `~/clawd/` or `~/.openclaw/`.
5. Treat resolved project path as a primary checkout source only; create a git worktree before launching any coding agent.
6. Never run coding-agent commands in the primary checkout path.
7. PR review must run in a temp clone or git worktree, never in a live primary checkout.
8. Keep execution scoped to resolved worktree `<cwd>` only.
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.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
### Gemini CLI

```bash
bash pty:true workdir:<cwd> command:"GEMINI_SANDBOX=false gemini -p '<rendered_prompt>'"
```

## Bash execution interface (required)
Confidence
99% confidence
Finding
This skill explicitly disables Gemini's sandbox with `GEMINI_SANDBOX=false` and elsewhere endorses `dangerously-*` execution flags, enabling an LLM-driven coding agent to run with reduced containment. In the context of a skill that interprets natural-language requests and launches local CLIs against developer workspaces, this materially increases the risk of arbitrary file modification, secret access, destructive commands, or lateral impact from prompt injection and mis-scoped tasks.

Static analysis

No suspicious patterns detected.