Back to skill

Security audit

subagent-archive

Security checks for vulnerabilities and agentic risk

Overview

This skill is a session cleanup tool with real delete and index-rewrite authority, but its safety and archival behavior are not reliable enough for automatic trust.

Install only if you understand that this is a high-impact maintenance tool. Use dry-run first, prefer soft mode before enforce, specify the workspace explicitly, avoid running it from a live primary session, and review any candidates manually before allowing hard deletion or sessions.json rewrites.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/archive-sessions.ps1:205
Finding

Enforced cleanup executes before validation, backup, safety review, and archival

Content
View full analysis
&1 | Out-String ``` The first script-controlled backup is not created until later: ```powershell $SessionsFile = Join-Path $SessionsDir "sessions.json" if ($Mode -eq "enforce") { $BackupFile = "$SessionsFile.backup-$DateStr-$((Get-Date).ToString('HHmmss'))" Copy-Item $SessionsFile $BackupFile -Force } ``` ### Technical Analysis When `-Enforce` is selected, the script passes `--enforce` to `openclaw sessions cleanup` and executes it immediately. At this point, the script has not: 1. Confirmed that `sessions.json` exists and can be parsed. 2. Created its own backup of `sessions.json`. 3. Established the complete list of protected keys. 4. Examined the target transcripts for sensitive or important content. 5. Produced and verified recoverable archives. This violates the documented save-before-delete design. The external command may mutate the index or remove artifacts before the script reaches its own validation and archival stages. The native command's exit status is also not checked. The script captures combined output but proceeds regardless of `$LASTEXITCODE`, potentially operating on a partially modified state after a failed cleanup. ### Attack Path 1. An operator invokes the Skill with `-Enforce`. 2. The script constructs an OpenClaw cleanup command containing `--enforce`. 3. The nat ...[truncated 823 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/archive-sessions.ps1:602
Finding

Relative transcript paths are misclassified as missing and removed from the session index

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/archive-sessions.ps1:328
Finding

Active direct sessions can be selected for deletion solely because their transcript is smaller than 1 KB

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/archive-sessions.ps1:431
Finding

Generated archives contain only metadata while original session content is deleted

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (18)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The document repeatedly states that dry-run is the default and must not perform physical deletion, but the Step 5 sample deletes files for every mode other than soft, which implicitly includes dry-run. In an operational cleanup skill, this mismatch is dangerous because an operator following the documented safe path could still trigger irreversible session deletion and data loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description field forces a specific language/locale presentation, and the rest of the document likewise instructs users only in Chinese. The policy for this audit flags language or locale constraints when the skill does not explicitly offer the user a choice or document a justified regional limitation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

前文设计说明明确写明 cron 任务“活跃任务不动,只清过期”,属于技能意图的一部分;但后续代码在 L198-L202 与 L416-L417 中对匹配 :cron: 的条目全部 continue,没有任何过期判定逻辑。这会导致实现行为比文档承诺更保守,但仍属意图与代码不一致。

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to extract, summarize, and persist session content into memory archives, including outcomes, purposes, timestamps, and potentially error learnings. Even though Step 2 mentions checking for sensitive data, this workflow still normalizes long-term storage of natural-language session contents, creating a realistic risk of retaining secrets, personal data, or confidential operational details in broadly accessible memory files.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The appended system-management log records workspace paths, protected session keys, and cleanup compatibility parameters, all of which can reveal internal topology, naming conventions, and active session context. In aggregate, this operational metadata can aid lateral discovery or expose sensitive environment details even if no single entry is secret by itself.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file documents an archival operation in "enforce" mode and reports processed files and released space, which implies changes affecting stored data. The file does not include any warning, caution, or disclosure about data retention, reversibility, or possible impact on user/system data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The log text is presented entirely in Chinese, including operational messages and error guidance, with no indication that the user selected this locale or that the skill is region-specific. This can violate a language/locale policy when users are not offered a choice or informed of the constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a standard process for safely archiving/cleaning sub-sessions, but the script exposes -FixDmScope and later passes --fix-dm-scope to openclaw sessions cleanup. Repairing DM scope is a broader session-metadata mutation capability, not an obvious implementation detail of archiving/cleanup itself.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Passing through --fix-dm-scope gives the script a maintenance/repair capability over OpenClaw session scope configuration. That capability is not clearly justified by a skill whose stated purpose is safe archival and cleanup of sub-sessions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file mixes an English heading with predominantly Chinese instructional content, but does not state that the skill is Chinese-only or offer an English alternative. Under the language/locale policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction 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
95% confidence
Finding

This PowerShell file contains natural-language instructions and runtime messages exclusively in Chinese, including usage guidance and failure output. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

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 presents all operational headings and explanatory text in Chinese, and there is no indication that language selection is optional or that the archive is intentionally restricted to a Chinese-speaking or region-specific context. Under the policy criteria, a fixed language without opt-in can constitute a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This plain-text output consistently presents operational status, warnings, and action summaries in Chinese, including key user-facing notices such as dry-run deletions and cleanup summaries. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless the locale constraint is explicitly documented and justified, which is not shown in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

Natural-language content such as headings and operational labels is written in Chinese, but the file does not indicate that the skill is region-specific or that users may opt into another language. This can violate language/locale policy when a specific language is effectively imposed without explanation or user choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest emphasizes archiving/cleaning sub-sessions, but the script also creates and appends files under a workspace memory area and generates separate dashboard archive markdown files. Those persistent knowledge/logging side effects touch broader workspace state beyond the session store being cleaned.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's natural-language comments and user-facing Write-Host messages are written in Chinese throughout, with no indication that the language is configurable or that the skill is intentionally limited to a Chinese-speaking audience. This creates a locale-policy concern because the script effectively enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This PowerShell file contains natural-language comments and usage text in Chinese, and later user-facing status messages are also emitted in Chinese. Under the stated policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This PowerShell file contains user-facing natural language in Chinese, including usage/help-style comments and status messages, but does not indicate that the skill is region-specific or provide any user opt-in for language selection. That can violate a language/locale policy when users are expected to receive instructions in their preferred language.

Content

No source excerpt is available for this finding.