Back to skill

Security audit

LongTask System

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed long-running multi-agent task runner, but it gives task files broad influence over agent sessions and persistent local state, so users should review it carefully before installing.

Install only if you want a long-running OpenClaw multi-agent workflow runner and you trust whoever can create or edit its task JSON files. Review tasks before launching the daemon, restrict which agents and sessions it may target, avoid untrusted task parameters, consider removing /new for single-agent use, and fix the jq and HTML escaping issues before using it with shared or untrusted inputs.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
notify_agent.sh:67
Finding

Forced Session Reset and Untrusted Agent Instruction Injection

Content
View full analysis
/dev/null 2>&1; then # 使用 openclaw CLI 发送消息到指定 Agent 的指定 Session if openclaw agent --agent "$AGENT_ID" --session-id "$FULL_SESSION" --message "$MESSAGE" 2>/dev/null; then CLI_SUCCESS=true ``` The behavior is also explicitly declared in `SKILL.md:11`: ```text ... every subtask is forcibly executed after resetting the conversation through /new ... ``` ### Technical Analysis The notification begins with the OpenClaw `/new` control instruction, which resets the target Agent's conversation. Immediately afterward, mutable fields read from a task JSON file are concatenated into the new Agent message: - `TASK_DESCRIPTION` - `STEP_NAME` - `PARAMS` - `TASK_NAME` - Agent and session selection fields There is no schema-level distinction between descriptive data and executable Agent instructions. There is also no validation that task parameters contain only data, no escaping or quoting protocol for prompt content, and no user confirmation before the message is submitted to OpenClaw. Consequently, an attacker who can add or modify a task JSON file can place additional instructions inside one of these fields. Because `/new` first discards the previous conversational context, the injected content is delivered in a fresh session where prior constraints, task context, or user warnings may no longer be present. This is an instr ...[truncated 1853 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
complete_step.sh:62
Finding

jq Program Injection Through Dynamically Constructed State-Update Expressions

Content
View full analysis
"$tmp_file" 2>/dev/null; then mv "$tmp_file" "$file" return 0 else rm -f "$tmp_file" return 1 fi } ``` Similar unsafe interpolation occurs in: - `notify_agent.sh:33-48` - `notify_agent.sh:116` - `consume_inbox.sh:26` - `daemon.sh:115-119` - `daemon.sh:176-241` ### Technical Analysis Shell arguments and JSON-derived values are inserted directly into jq source code. They are not passed as data with `jq --arg` or as validated numeric values with `jq --argjson`. For example, `OUTPUT_PATH` is placed between literal jq quotation marks. An input containing a quotation mark followed by jq operators can terminate the intended string and append additional state transformations. A conceptual payload of the following form can alter the top-level status while still leaving a syntactically valid expression: ```text x" | .status = "completed" ...[truncated 2206 chars]
Remediation
View remediation
&2 exit 1 } ``` 3. Validate `RESULT` against an exact allowlist: ```bash case "$RESULT" in success|failed) ;; *) exit 1 ;; esac ``` 4. Set the step status according to the validated result instead of always assigning `done`. 5. Replace all other interpolated jq filters in `daemon.sh`, `notify_agent.sh`, and `consume_inbox.sh` with fixed filters using `--arg` or `--argjson`. 6. Confirm that exactly one step matches the supplied ID before modifying the file. 7. Add file locking around read-modify-write operations to prevent concurrent updates from overwriting each other. 8. Create temporary files with `mktemp` in the same protected directory and enforce restrictive file permissions. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
cockpit_renderer.py:27
Finding

Stored HTML and JavaScript Injection in Generated Cockpit

Content
View full analysis
0 else 0 # 构建子任务列表 HTML rows_html = "" task_agent_id = data.get('agent_id', 'unknown') for step in steps: status = step.get('status', 'pending') step_name = step.get('name', 'Unknown Step') agent_id = step.get('agent_id', task_agent_id) ``` ```python rows_html += f"""
{status_icon}
{step_name}
@{agent_id} is on duty
{badge}
""" ``` ```python full_html = f""" Pet Cockpit | {task_name} ``` ```python
"{description ...[truncated 2426 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
cockpit_renderer.py:94
Finding

Unpinned Remote JavaScript Executed by the Local Cockpit

Content
View full analysis
``` The same generated references are present in `tasks/cockpit.html:7-8`. ### Technical Analysis The cockpit loads executable JavaScript from `https://cdn.tailwindcss.com` without: - An immutable version. - A cryptographic integrity hash. - A restrictive Content Security Policy. - A locally reviewed copy. The effective JavaScript payload can therefore change after the Skill package has been audited. If the CDN, DNS resolution, network path, or upstream asset is compromised, arbitrary JavaScript can execute whenever a user opens the cockpit. The Google Fonts stylesheet is not executable in the same way, but it produces an external request that exposes viewer network metadata such as IP address, request time, browser headers, and referrer behavior to a third party. This is a supply-chain exposure rather than evidence that the current CDN content is malicious. ### Attack Path 1. An operator generates and opens `tasks/cockpit.html`. 2. The browser requests the current script from `cdn.tailwindcss.com`. 3. The remote response is trusted without a version pin or integrity verification. 4. A compromised or malicious upstream response executes in the cockpit page context. 5. The script can modify the dashboard, issue browser-permitted requests, redirect the viewer, or combine with other browser-context weaknesses. ### Impact Assessment A successful supply-chain compromise can affect every user who opens the dashboard while the remote asset is malicious. The impact includes: - Arbitrary JavaScript execution in the cockpit page. - Dashboard spoofing and malicious redirects. - ...[truncated 265 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% 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 79)May include surrounding context.

md
screen -d -m -S longtask bash daemon.sh my_task

# 方案2: setsid(Linux 环境)
setsid bash daemon.sh my_task > longtask_log/daemon.log 2>&1 &

# 或前台调试
./daemon.sh my_task

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script removes the consumed task from agent_inbox.json by writing a filtered version to a temporary file and replacing the original. Although comments describe the behavior, there is no user-facing warning, prompt, or visible runtime notice before performing this irreversible inbox mutation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file uses Chinese-only natural-language instructions and messages, including operational guidance embedded in comments and runtime strings, without any indication that language is configurable or intentionally region-scoped. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script sends a constructed message containing task name, description, step details, and parameters to another agent via the openclaw CLI. Although there is fallback/error output, there is no confirmation prompt or explicit user-facing disclosure that task data will be transmitted to another agent/session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

When CLI delivery fails, the script writes a JSON entry containing task identifiers, parameters, and the full message body to agent_inbox.json. The code logs success after the write, but it does not provide advance disclosure or confirmation that user/task data will be persisted to disk in a shared inbox file.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This JSON manifest describes activation in very general terms such as writing an article and researching exposed issues, but it does not specify any narrow invocation context, allowed trigger phrases, or exclusion conditions. Because SQP-1 applies to manifest files, these broad descriptions could overlap with common article-writing or research requests and make unintended invocation more likely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The root HTML element sets lang="zh-CN", and the page content is largely Chinese, which indicates a fixed language/locale choice. The file does not present this as optional or explain that the skill is intentionally region-specific, so it appears to force a locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This JSON task file is a manifest-type file, so natural-language policy checks apply. The description is explicitly in Chinese and, together with later metadata naming Chinese-target platforms and actors, indicates a fixed language/locale workflow without any sign that the user can choose or opt into that locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JSON task file specifies the skill purpose entirely in Chinese, and the task appears to direct article creation in Chinese by default. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The step name and associated task framing indicate the generated content is expected in Chinese, but the file provides no indication that users can select another language. This can violate the language/locale policy when a single language is imposed implicitly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The metadata field triggered_by is set to a broad natural-language value (红运) without any visible binding to a unique identity, authorization context, or activation constraint. In agent/task orchestration systems, ambiguous human-readable trigger sources can enable spoofing, misattribution, or unintended task execution if downstream components trust this field for routing, auditing, or permission decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The generated document hard-codes lang="zh-CN", which imposes a specific language/locale on all rendered output. Under the policy, locale constraints should either be user-selectable or clearly justified as region-specific; neither is evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file includes user-facing comments and messages in Chinese, and later emits Chinese warning/status text to users. Under the policy rule, forcing a specific language without opt-in can be a natural-language policy violation when no language choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script's natural-language comments are written only in Chinese, which imposes a language choice without offering an alternative or documenting that the skill is intended for a Chinese-speaking audience. This can conflict with organizational language/locale policy when no opt-in or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script includes operational comments in Chinese, imposing a specific language context in the skill file without offering any user choice or documenting that the skill is region-specific. The policy applies to natural-language content in all file types, including comments.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The comment at L124 says the script performs an "原子性追加消息" (atomic append), but the implementation reads the whole JSON file, writes a temporary file, and renames it without any locking. This can lose updates if multiple instances run concurrently, so the documentation overstates the safety of the operation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description field uses Chinese text only ("示例任务模板"), which indicates a fixed language choice in a user-facing template. The file does not provide any user opt-in, alternative locale, or justification that this template is intended only for a Chinese-language environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The step name at this line is user-facing natural language and is fixed to Chinese ("子任务1"). Because the template does not expose a locale option or explain a region-specific requirement, this creates a language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The step name at this line is user-facing natural language and is fixed to Chinese ("子任务2"). Because the template does not expose a locale option or explain a region-specific requirement, this creates a language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The step name at this line is user-facing natural language and is fixed to Chinese ("子任务3"). Because the template does not expose a locale option or explain a region-specific requirement, this creates a language policy concern.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The page unconditionally reloads itself every 3 seconds via setTimeout(() => location.reload(), 3000). While not directly leading to code execution or data theft, this can disrupt user interaction, create unnecessary network load, and mask unwanted behavior by preventing stable inspection of the page.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The automatic reload happens without any notice, countdown, or opt-out for the user. This reduces transparency and can degrade trust and usability, especially if users are reading content or attempting to interact with the page when it refreshes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description field is written only in Chinese ("测试驾驶舱渲染修复"), which imposes a specific language in natural-language task metadata without indicating any user choice or opt-in. The policy allows locale constraints only when explicitly justified or optional, which is not shown here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.