Back to skill

Security audit

cron-callback-session

Security checks for vulnerabilities and agentic risk

Overview

The skill openly implements session callback and message injection, but it asks users to broaden session routing and optionally cross-agent routing in ways that need careful review before installation.

Install only if you deliberately need cron or external jobs to send results back into an existing OpenClaw/QClaw session. Prefer keeping visibility at tree when possible, avoid visibility=all and wildcard agent-to-agent rules, limit targets to explicit sessions, run gateway restarts only during a maintenance window, and restore the default routing setting after use.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:42
Finding
Overly Broad Cross-Session Message Injection Permissions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:42-45, 73-78, 168-181` **Vulnerability Type**: Cross-session authorization boundary weakening **Risk Level**: High ### Vulnerable Configuration and Payload ```text tools.sessions.visibility = agent ``` ```json { "sessionTarget": "isolated", "payload": { "kind": "agentTurn" }, "delivery": { "mode": "none" } } ``` The payload instructions direct the isolated Agent turn to invoke `sessions_send` with a complete target session key. ### Technical Analysis The Skill recommends changing session visibility from the default `tree` scope to `agent`. Under the default scope, a session can communicate only with sessions in the same session tree. The recommended `agent` scope instead permits communication among arbitrary sessions owned by the same Agent identity. This change weakens a security boundary globally to support a callback to one particular session. It is broader than the minimum permission required for the documented use case. The callback also carries an instruction-oriented message into a target session that retains its prior context and potentially has access to privileged tools. If a sibling session, isolated cron task, or external process is compromised, it can attempt to inject attacker-controlled instructions into other sessions belonging to the same Agent. The target Agent may process the injected content as trusted inter-session input unless provenance and authorization are independently enforced. The documentation warns that the setting is broader than the default and recommends restoring it later. However, this is a manual control and does not prevent forgotten configuration changes or abuse while the broader permission remains active. ### Attack Path 1. An operator follows the Skill and changes `tools.sessions.visibility` from `tree` to `agent`. 2. A malicious or compromised cron task, sibling session, or external process obtains or predicts a valid target se ...[truncated 861 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Preserve `tools.sessions.visibility = tree` as the default. 2. Use a narrowly scoped callback mechanism restricted to one authorized source session and one target session. 3. Generate an unguessable, single-use callback identifier rather than exposing a persistent session key as the sole routing authority. 4. Authenticate inter-session messages and include verifiable source identity, job identity, creation time, and expiration time. 5. Constrain callback payloads to a structured result schema instead of accepting arbitrary Agent instructions. 6. Treat inter-session content as untrusted data and prevent it from directly authorizing privileged tool calls. 7. Require explicit user approval before broadening visibility and display the exact scope and duration of the change. 8. Restore the previous visibility setting automatically after the callback completes, including failure and timeout paths. 9. Log all cross-session send attempts, including source, target, cron job, payload type, and delivery result. 10. Apply rate limits and replay protection to prevent repeated or duplicated injections. ]]>

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:212
Finding
Wildcard Cross-Agent Injection Configuration<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:212` **Vulnerability Type**: Unrestricted cross-Agent message injection **Risk Level**: High ### Vulnerable Configuration ```text visibility=all agentToAgent.enabled=true allow * ``` The documentation states that this configuration allows an isolated cron session to inject messages into arbitrary sessions across Agents. ### Technical Analysis The Skill documents an optional configuration that combines global session visibility with wildcard Agent-to-Agent authorization. This removes both the session-tree boundary and the Agent identity boundary. Once enabled, a compromised Agent or isolated task can send instruction-bearing content to unrelated persistent sessions. Because the receiving session may possess different tools, credentials, data access, or operational authority, this becomes a privilege-expansion path across Agent boundaries. A warning that the configuration is high risk does not enforce source authentication, target authorization, payload validation, or user consent. The wildcard allow rule is especially dangerous because it does not constrain communication to a predefined pair of Agents required for a particular callback. ### Attack Path 1. An operator enables `visibility=all`. 2. The operator enables Agent-to-Agent communication with a wildcard `allow *` rule. 3. An attacker compromises any Agent, cron task, or process capable of invoking `sessions_send`. 4. The attacker identifies a persistent session belonging to another Agent. 5. The attacker injects a crafted instruction into that session. 6. The receiving Agent processes the message in its own security context and may invoke tools unavailable to the original attacker. 7. The attacker can repeat this process against additional sessions because the wildcard rule imposes no specific source or target restriction. ### Impact Assessment This configuration can expand a compromise from one Agent to unrelated Agents and persi ...[truncated 440 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the wildcard `allow *` recommendation. 2. Use explicit source-Agent and target-Agent allowlists. 3. Restrict each authorization rule to specific persistent session identifiers or narrowly defined callback endpoints. 4. Require mutual authentication for Agent-to-Agent messages. 5. Sign payloads and verify signatures, timestamps, intended recipients, and nonces before processing. 6. Separate informational callback data from executable Agent instructions. 7. Require target-side user confirmation before an injected message can trigger privileged tools. 8. Apply capability-based authorization so the sender can submit only the result type required by the workflow. 9. Record immutable audit logs for all cross-Agent messages and alert on unexpected source-target combinations. 10. Automatically expire temporary cross-Agent permissions after the approved task completes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:110
Finding
Unsafe Force-Termination and Manual Gateway Restart Procedure<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:110-145` **Vulnerability Type**: Destructive process management and denial-of-service risk **Risk Level**: Medium ### Vulnerable Commands ```powershell Get-CimInstance Win32_Process -Filter "Name='node.exe'" | Where-Object { $_.CommandLine -match "openclaw-gateway" } | Select-Object ProcessId, CreationDate Stop-Process -Id <PID1>, <PID2> -Force Start-Sleep -Seconds 3 Start-Process -FilePath $node ` -ArgumentList "--title=openclaw-gateway","--no-warnings","--max-semi-space-size=128","--max-old-space-size=4096",$mjs,"gateway","run","--port","$port" ` -WindowStyle Hidden ` -PassThru ``` ### Technical Analysis The documented restart procedure force-terminates gateway processes and manually launches a hidden replacement. The process-discovery condition relies primarily on an executable name and command-line substring. It does not verify the executable path, process owner, service identity, parent process, expected installation directory, or cryptographic identity before termination. Force termination can interrupt every active session, cron task, and operation handled by the gateway. If the selected process identifiers are stale or incorrectly chosen, an unrelated process may be terminated. If the replacement executable path, module path, port, or arguments are incorrect, the gateway may not recover. Launching the replacement with a hidden window also reduces immediate visibility into startup failures. The documentation contains explicit warnings and manual verification steps, which reduce accidental misuse, but the procedure still relies on fragile manual process handling rather than an atomic service-management operation. ### Attack Path 1. An operator or Agent follows the documented restart instructions. 2. Process selection matches one or more `node.exe` processes containing the expected command-line substring. 3. The process identifiers are copied manually without validating ow ...[truncated 971 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer an officially supported Windows service manager or supervisor restart operation. 2. Require explicit user confirmation immediately before terminating gateway processes. 3. Validate the process executable path, owner, installation directory, command line, listening port, and service identity. 4. Avoid manually entered process identifiers where possible; resolve and validate the target immediately before termination. 5. Gracefully stop the gateway and wait for active tasks to drain before using force termination. 6. Preserve the existing gateway configuration and exact launch parameters before shutdown. 7. Perform preflight validation of the replacement executable, module path, configuration file, and port. 8. Launch the replacement with captured logs rather than relying exclusively on a hidden process. 9. Add an automatic rollback or recovery routine if the new gateway fails its health check. 10. Verify process creation time, port ownership, authenticated HTTP health, and session connectivity before declaring success. 11. Use a maintenance window and notify users that active sessions will be interrupted. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Ssd 4

High
Confidence
97% confidence
Finding
This section lays out a complete procedure for weakening session isolation (visibility=agent), restarting the gateway so the weaker policy takes effect, and then using that access to inject messages across sessions. That is dangerous because it normalizes privilege broadening and operationalizes cross-session command delivery, undermining isolation guarantees that would otherwise block unauthorized or unintended message routing.

Ssd 4

High
Confidence
98% confidence
Finding
The cron payload instructs an isolated session to send a crafted message into a target session while suppressing normal message/output behavior, which creates a covert indirect injection chain. This is dangerous because it enables hidden or hard-to-audit inter-session control flow where an external scheduler can trigger actions inside another conversation with its full context, potentially causing unauthorized task execution or confusing provenance.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The description says to use the skill when the user asks phrases like '定时任务完成后回到本对话继续推进' or '让任务结果上报到同一对话', but it does not clearly delimit whether this applies only to cron/OpenClaw session-injection workflows or to any request about continuing work in the same conversation. Without exclusions or negative examples, these trigger descriptions are broad enough to overlap with ordinary task-continuation requests.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The skill explicitly documents how to expand from same-session callbacks into cross-agent message injection by enabling broader visibility and agent-to-agent routing. This turns a narrowly scoped callback mechanism into a general lateral-messaging capability that can be abused to inject instructions into unrelated agents or sessions, increasing the blast radius well beyond the stated use case.

Description-Behavior Mismatch

Low
Confidence
75% confidence
Finding
The top-level description emphasizes using cron, external processes, or another session to inject into a target session so the original conversation continues, especially when a task should report back to the same dialogue. L021-L024 extends this into general-purpose external triggering and monitoring/watchdog alerts that wake agents on anomalies, which goes beyond the narrower callback/session-resume framing in the manifest.

Static analysis

No suspicious patterns detected.