Back to skill

Security audit

OpenClaw Subagent Session Cleanup

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed OpenClaw session cleanup helper, but it tells agents to run an unbundled local cleanup script that can change or delete persistent session data.

Install only if you understand which OpenClaw sessions will be removed. Before running it, inspect the actual cleanup.ps1 script from your environment, run a dry-run first, back up sessions.json and .jsonl history files, and avoid -CleanJsonl unless you intentionally want to delete conversation history.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
---
name: openclaw-session-cleanup
description: >
  Clean up accumulated subagent and cron:run child sessions in OpenClaw to fix slow subagent startup.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill uses broad symptom-based activation cues like 'subagents are slow to start' and 'gateway slow' without requiring validation that session accumulation is actually the cause. This can cause the agent to invoke a maintenance/destructive cleanup workflow in situations where the symptoms stem from unrelated issues, increasing the chance of unnecessary operational changes or data loss if dangerous flags are used.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Chinese guidance makes activation effectively mandatory whenever the user mentions several broad symptoms, but those symptoms are not specific to this root cause. That creates a prompt-selection vulnerability where the agent may over-trigger a cleanup procedure and perform risky maintenance based on weak evidence.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.