Back to skill

Security audit

Session Archiver

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says by archiving sessions, but it silently persists conversation content, modifies future agent startup instructions, and can delete shared memory files without clear user control.

Install only if you intentionally want automatic, silent archiving of OpenClaw conversations into workspace memory. Review or remove the AGENTS.md self-integration behavior, disable or constrain cleanup, and avoid using it in workspaces where chats may include credentials, private records, confidential code, or sensitive business data.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T02 · Agent Memory Poisoning

Error
Location
scripts/session-auto-archive.js:129
Finding

Untrusted Transcript Content Is Persisted into Agent Memory

Content
View full analysis
p.test(cleanText))) { ins ...[truncated 2110 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/session-auto-archive.js:29
Finding

Automatic Modification of Persistent Agent Startup Instructions

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/session-auto-archive.js:220
Finding

Silent Duplication of Sensitive Main-Agent Conversation Data

Content
View full analysis
f.endsWith('.jsonl.reset.') || (f.includes('.reset.') && f.includes('T'))) .map(f => ({ name: f, path: path.join(SESSION_DIR, f), sessionId: f.split('.')[0], age: getSessionAge(path.join(SESSION_DIR, f)) })) .filter(f => f.sessionId.length > 30) .sort((a, b) => b.age - a.age); return resetFiles[0] || null; } ``` ```javascript console.log('Reading transcript...'); const transcriptContent = fs.readFileSync(latestReset.path, 'utf8'); const messages = parseJsonl(transcriptContent); console.log(`Parsed ${messages.length} messages`); const allTexts = extractAllTexts(messages); console.log(`Found ${allTexts.length} meaningful texts (user + assistant)`); if (allTexts.length === 0) { console.log('No significant content, marking done'); fs.writeFileSync(ARCHIVE_MARKER, latestReset.sessionId); process.exit(0); } ``` ```javascript fs.appendFileSync(MEMORY_FILE, '\n\n---\n\n## Session 自动沉淀\n\n'); fs.appendFileSync(MEMORY_FILE, archiveContent + '\n'); fs.appendFileSync(MEMORY_FILE, `---\n归档时间: ${new Date().toISOString()}\n`); fs.appendFileSync(MEMORY_FILE, `来源 session: ${latestReset.sessionId}\n`); ``` ### Technical Analysis The script accesses the main Agent's session directory and reads both user and assistant messages from the newest reset transcript. It then creates additional copies in workspace memory and potentially in insight-candidate files. The filtering logic is not a security redaction mechanism. `stripConversationMeta()` removes selected metadata patterns but does not detect credentials, API keys, authentication ...[truncated 1411 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/session-auto-archive.js:181
Finding

Cleanup Can Delete Unrelated Date-Named Memory Files

Content
View full analysis
0) { console.log(`Cleaned ${cleaned} old memory file(s) (retention: ${RETENTION_DAYS} days)`); } } ``` ### Technical Analysis The cleanup routine deletes every Markdown file in the shared memory directory whose filename matches `YYYY-MM-DD.md` and whose modification time is older than the retention cutoff. It does not verify that the file was created by this skill. As a result, unrelated daily notes or memory files created by the user, another skill, or the Agent itself fall within the deletion set. Modification time is also an unreliable ownership indicator and may change because of file restoration, migration, or backup operations. The deletion uses `unlinkSync()`, so files are removed immediately without a backup, quarantine directory, confirmation prompt, or recovery manifest. ### Attack Path 1. A user, Agent, or separate skill creates a legitimate file such as `memory/2026-01-01.md`. 2. The file remains unmodified until its modification time is more than 30 days old. 3. The session archiver successfully archives a later session and invokes `cleanupOldMemoryFiles()`. 4. The cleanup routine matches the unrelated file solely by filename and age. 5. `fs.unlinkSync()` permanently removes the file without confirmation or r ...[truncated 410 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a session archiver, but it additionally performs a persistence/integration action by auto-appending startup instructions into AGENTS.md. Self-installing into agent startup flows expands execution reach and persistence beyond the stated archival purpose, making the behavior materially more dangerous in context.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a session archiver, but it additionally performs a persistence/integration action by auto-appending startup instructions into AGENTS.md. Self-installing into agent startup flows expands execution reach and persistence beyond the stated archival purpose, making the behavior materially more dangerous in context.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill is designed to retain user and assistant message content from completed sessions and append it into memory automatically, with silent execution and future reuse. In context, this is dangerous because it creates a secondary long-lived store of conversational data without clear user awareness, increasing exposure of sensitive information and violating data-minimization expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation normalizes silent hourly archival and silent /new-triggered background processing of conversation data without clear user warning or consent. Because the archived data includes user and assistant messages and is stored for later reuse, the lack of disclosure creates a significant privacy and data-governance risk.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The workflow goes beyond archival and analyzes conversations to extract reusable preferences, decisions, lessons, and workflow changes for future sessions. This transforms raw chats into behavioral profiles and persistent memory artifacts, which materially increases privacy risk and the chance of unintended influence or leakage in later interactions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill declares no explicit tool scope or permissions despite describing behavior that reads session transcripts, writes memory files, modifies AGENTS.md, and deletes old files. Missing scope boundaries increases the chance that an agent executes the skill with broader filesystem/environment access than users expect, reducing containment and auditability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The substantive skill instructions and behavior description are written in Chinese, while the surrounding audit context is English and there is no indication that Chinese is required or user-selected. This creates a language/locale constraint without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises automatic cleanup that deletes memory files older than 30 days, but this destructive behavior is not surfaced as a prominent warning with recovery implications. Automatic deletion can cause unintended data loss, especially when users may not realize the skill manages retention autonomously.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly says no manual action is required and that it will automatically detect and append integration content to AGENTS.md, but it does not present this as a user-facing warning or consent boundary. Silent modification of agent control files creates persistence and trust risks because future sessions may invoke behavior the user never knowingly enabled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill automatically archives completed sessions by extracting meaningful user and assistant messages from .reset transcript files and appending them to daily memory. This script instead builds an .insights-candidates-<date>.md report for later manual review, and never appends extracted messages into an existing daily memory archive.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script modifies AGENTS.md on disk to insert new workflow instructions that go beyond simple session archiving. Self-integrating into agent instructions creates an unauthorized persistence and behavior-expansion mechanism: once executed, the skill changes future agent behavior without explicit user approval, which is dangerous in a system that treats AGENTS.md as instruction-bearing state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script automatically deletes memory files older than 30 days without an explicit warning, backup step, or user-configurable retention confirmation. While this is primarily an integrity/availability concern rather than code execution, it can still cause silent loss of records that users may rely on for auditability or recall.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script persists raw user and assistant text from session transcripts into memory files with only minimal metadata stripping and no meaningful sensitive-data detection. In the context of an archiver operating on entire session transcripts, this materially increases the risk of long-term storage of secrets, personal data, internal code, tokens, or other confidential content, making later exposure or misuse more damaging.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script appends meaningful user and assistant transcript content into persistent memory files without any explicit notice or consent at the time of storage. Because it archives free-form conversation text, it can silently retain secrets, personal data, credentials, or sensitive project information beyond the original session lifecycle.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill performs a second function—extracting and storing 'insight candidates'—in addition to the declared archiving role. Even though it avoids subprocesses and says human review is required, it still derives behavioral/profile data from conversations and persists it, broadening data collection and creating a secondary memory artifact that may influence future actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file header states that extracted insights are output to .insights-candidates.md for review in self-improving, implying a destination associated with the self-improving area. However, the actual output path is constructed under WORKSPACE/memory via CANDIDATES_FILE, while SELF_IMPROVING_DIR is defined but unused, so the documentation contradicts runtime behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated report timestamp is hard-coded to use the 'zh-CN' locale and 'Asia/Shanghai' timezone. This is a natural-language/locale policy concern because the skill imposes a specific locale in user-facing output without offering a choice or documenting why this locale is required.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated insights header uses toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' }), forcing a specific language/locale and timezone in output. This can violate language/locale policy when users have not opted into Chinese output and no region-specific justification is documented in the file.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.