T09 · Insecure Skill Coding Practices
- Location
SKILL.md:120- Finding
Unencrypted Persistent Backups Expose Complete Session History
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 120-126
Vulnerability Type: Plaintext storage of sensitive session data
Risk Level: MediumThe documented compression workflow creates a persistent copy of the complete original session as a JSONL file:
markdown ## Output Files When compression occurs, these files are created in `memory/compressed/`: | File | Description | |------|-------------| | `{timestamp}.ai-summary.md` | AI-generated session summary | | `{timestamp}.session-backup.jsonl` | Full backup of original session (can restore if needed) | | `{timestamp}.transcript.md` | Raw transcript extraction (legacy) | | `{timestamp}.summary.md` | Grep-based summary (legacy) |The reset procedure also explicitly requires copying the session history into this persistent location before deleting the active session:
markdown 1. Backup JSONL to `memory/compressed/` 2. Delete `~/.openclaw/agents/{agent}/sessions/{sessionId}.jsonl` 3. Send compressed context via `openclaw agent --to main` 4. New session is created automatically with summary as first messageTechnical Analysis
The workflow retains the complete session history in
memory/compressed/{timestamp}.session-backup.jsonland also writes derived summaries and potentially raw transcript files. No encryption, restrictive permission enforcement, retention limit, secure deletion policy, or access-control validation is documented.Session history can contain confidential prompts, model responses, source code, internal paths, personal information, operational data, or credentials supplied during a conversation. Resetting the active session does not remove that information because the workflow first creates another persistent copy. Timestamp-based filenames are predictable enough that an actor with access to the backup directory can enumerate and collect historical sessions.
This is an insecure data-at-rest practice rath ...[truncated 1722 chars]
- Remediation
View remediation
Remediation Suggestions
- Encrypt complete session backups at rest using an authenticated encryption scheme and a key stored separately from the backup directory.
- Create the backup directory with owner-only permissions, such as mode
0700, and backup files with mode0600; explicitly set a restrictiveumaskbefore file creation. - Resolve and validate the destination path before writing so backups cannot be redirected through symbolic links or unsafe path components.
- Make full-history backups opt-in rather than automatic, and clearly warn users that they may contain secrets.
- Prefer a minimized, redacted summary over retaining the entire JSONL history. Remove credentials, tokens, personal data, and other unnecessary sensitive fields before persistence.
- Define retention controls, including configurable expiration, maximum backup count, and a command to securely purge obsolete archives.
- Avoid producing legacy raw transcripts unless explicitly requested.
- Prevent backup and transcript directories from being committed to version control or copied into broadly accessible synchronization and archival systems.
- Verify file ownership and permissions after creation and abort the destructive reset if the backup cannot be stored securely.
- Document the security properties, storage location, retention period, restore process, and residual-data limitations of the backup workflow.
