Back to skill

Security audit

Long Running Tasks

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for autonomous development, but it should be reviewed carefully because it sets up persistent agents that can change, commit, and push code with weak guardrails.

Use this only for trusted repositories and task files. Start in a sandbox, avoid permission-bypass flags, use a dedicated least-privilege git credential, disable auto-push until changes are reviewed, and prefer a supervised runner with private runtime files and safe prompt passing instead of raw shell interpolation.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
references/orchestrator-cron.md:66
Finding

Autonomous worker command and instruction injection through untrusted project task content

Content
View full analysis
/tmp/lrt-[PROJECT_SLUG]-worker.log 2>&1 & echo $! > $PID_FILE sleep 2 && kill -0 $(cat $PID_FILE) 2>/dev/null && echo "worker verified" || echo "WARNING: worker failed to start" The task prompt must include: - "Read [CONTEXT_FILE] and TODO.md for project context." - The specific task description copied from TODO.md. - "Run tests before committing. Fix failures before proceeding." - "Check off the completed item in TODO.md." - "Commit and push using the project's commit convention." - "Run: openclaw system event --text 'Done: [BRIEF_SUMMARY]' --mode now" ``` Related template: ```text You are working on [PROJECT_NAME]. Read [CONTEXT_FILE] and TODO.md for full context. YOUR TASK: [Paste the specific task description from TODO.md] ``` ### Technical Analysis The orchestrator reads task content from repository-controlled `TODO.md` and copies it into `[TASK_PROMPT]`. That prompt is then interpolated into a shell command inside single quotes: ```sh nohup [AGENT_COMMAND] '[TASK_PROMPT]' ``` No escaping, argument-array construction, content validation, or trust-boundary enforcement is specified. If task or context content contains a single quote followed by shell syntax, it can terminate the quoted argument and inject additional shell commands. The injected commands execute with the operating-system permissions and credentials of ...[truncated 2499 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/orchestrator-cron.md:41
Finding

Predictable shared temporary files permit PID spoofing and unsafe process termination

Content
View full analysis
/dev/null succeeds): another orchestrator is running. Exit with "orchestrator already running". - If that PID is dead: the lock is stale. Remove $LOCK_FILE and continue. Write your own PID ($$) to $LOCK_FILE. Set a trap to remove $LOCK_FILE on exit: trap 'rm -f $LOCK_FILE' EXIT Step 2 — Check for running worker: If $PID_FILE exists: - Read the PID inside it. - If PID is alive: - Get latest commit: cd [PROJECT_PATH] && git log --oneline -1 - Get commit timestamp: git log -1 --format=%ct HEAD - If commit is < 30 minutes old: report one-line status ("worker active, last commit: min ago"), exit. - If commit is >= 30 minutes old: worker is stalled. Kill it (kill $PID), remove $PID_FILE. Include "killed stalled worker" in report. Continue to Step 3. - If PID is dead: remove $PID_FILE. Continue to Step 3. ``` The documented runtime convention also uses predictable shared paths: ```text /tmp/lrt--worker.pid /tmp/lrt--orchestrator.lock /tmp/lrt--last-commit /tmp/lrt--worker.log ``` ### Technical Analysis The orchestration design places control and state files directly in the shared `/tmp` directory using predictable names derived from a project slug. It does not require: - Private-directory permissions. - Atomic file creation. - Symbolic-link rejection. - Ownership and file-type validation. - Restrictive file permissions. - Validation that th ...[truncated 2533 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (13)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

bash
touch /path/to/project/.pause    # pause — orchestrator skips spawning
rm /path/to/project/.pause       # resume

The orchestrator still runs on schedule but reports "paused" instead of spawning.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

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

md
- **Permission-bypass flags.** Agent CLIs often offer flags that skip safety prompts. Do not use these until you've verified the pipeline in safe mode. See `references/orchestrator-cron.md` for details.

External Model or Provider Selection

High
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

Scanner excerpt · references/orchestrator-cron.md (reported line 106)May include surrounding context.

md
claude

# Codex (sandboxed by default)
codex exec

# Any agent that accepts a prompt argument
<agent-binary> <flags>

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/orchestrator-cron.md (reported line 120)May include surrounding context.

bash
touch [PROJECT_PATH]/.pause     # pause
rm [PROJECT_PATH]/.pause        # resume

Or disable the cron job: cron tool with action: "update", patch: { "enabled": false }.

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 · SKILL.md (reported line 50)May include surrounding context.

md
## Setup

### 1. Create TODO.md in the project root

Structured task queue. Each task must be self-contained enough for a cold-start agent:

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

Launching an agent with nohup in the background creates durable autonomous execution outside the initiating session, which is a real persistence mechanism. In this skill's context, that persistence is the feature, but it increases risk because the worker can continue modifying code, using credentials, and pushing commits without real-time human oversight.

Content

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

Start the first task yourself in safe (default) mode. The orchestrator takes over after this:

bash
cd /path/to/project && nohup <agent-command> '<task prompt>' > /tmp/lrt-<project>-worker.log 2>&1 &
echo $! > /tmp/lrt-<project>-worker.pid

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 · assets/context-file-template.md (reported line 3)May include surrounding context.

Project Context File Template

Create this file in the project root (commonly named CLAUDE.md or AGENTS.md) so cold-start agents have the context they need without exploring the codebase.

markdown
# [Project Name]

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

Using nohup to detach a long-lived worker creates persistent unattended execution that can continue modifying the repository after the initiating session ends. In this context, the background process is explicitly instructed to read project context, perform tasks, and commit changes, which increases the risk of uncontrolled or hard-to-audit actions.

Content

Scanner excerpt · references/orchestrator-cron.md (reported line 74)May include surrounding context.

md
Step 5 — Spawn worker:
  Run:
    cd [PROJECT_PATH] && nohup [AGENT_COMMAND] '[TASK_PROMPT]' > /tmp/lrt-[PROJECT_SLUG]-worker.log 2>&1 &
    echo $! > $PID_FILE
    sleep 2 && kill -0 $(cat $PID_FILE) 2>/dev/null && echo "worker verified" || echo "WARNING: worker failed to start"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The document explicitly warns against permission-bypass flags, but the overall workflow still directs an autonomous worker to modify code, check off tasks, commit, and push changes based on TODO.md content. That creates a real security risk if project files, task descriptions, or prompts are untrusted, because the agent is still being instructed to perform impactful actions without mandatory human review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template instructs workers to modify TODO.md and then commit and push changes without any disclosure that these actions change repository state and may publish work to a remote. In an agent setting, this can lead to unauthorized persistence or exfiltration of code and metadata, especially if the user only intended local analysis or code generation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template directs execution of an external command (openclaw system event ...) without explaining its effects or obtaining consent. External commands may send data off-host, trigger side effects, or leak task details, making this risky in a generic worker prompt template.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template creates conflicting instructions: it says not to modify code outside task scope, while also requiring workers to update TODO.md and commit/push changes regardless of whether those actions are within the requested scope. This can normalize out-of-scope repository changes and cause agents to alter project state beyond the user's explicit authorization.

Content

No source excerpt is available for this finding.

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
85% confidence
Finding

Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Content

Scanner excerpt · references/orchestrator-cron.md (reported line 112)May include surrounding context.

text

> **Security note:** Some agents offer flags that bypass permission checks (e.g., `--dangerously-skip-permissions`, `--yolo`). Do not use these unless you have validated the worker prompts and TODO.md contents in a test repo first. Start with default (safe) mode and only relax permissions after you trust the pipeline.

## Shutdown