Back to skill

Security audit

qui-context-manager

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed context-compression workflow, but users should understand it can copy and delete OpenClaw session history.

Install only if you are comfortable with a context manager that can back up full OpenClaw session files, delete the active session JSONL during replacement, and store summaries/backups on disk. Review or provide the referenced `compress.sh` implementation before relying on it, and avoid using it on sessions containing secrets unless backup storage is protected and cleaned up.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
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: Medium

The 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 message

Technical Analysis

The workflow retains the complete session history in memory/compressed/{timestamp}.session-backup.jsonl and 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

  1. Encrypt complete session backups at rest using an authenticated encryption scheme and a key stored separately from the backup directory.
  2. Create the backup directory with owner-only permissions, such as mode 0700, and backup files with mode 0600; explicitly set a restrictive umask before file creation.
  3. Resolve and validate the destination path before writing so backups cannot be redirected through symbolic links or unsafe path components.
  4. Make full-history backups opt-in rather than automatic, and clearly warn users that they may contain secrets.
  5. Prefer a minimized, redacted summary over retaining the entire JSONL history. Remove credentials, tokens, personal data, and other unnecessary sensitive fields before persistence.
  6. Define retention controls, including configurable expiration, maximum backup count, and a command to securely purge obsolete archives.
  7. Avoid producing legacy raw transcripts unless explicitly requested.
  8. Prevent backup and transcript directories from being committed to version control or copied into broadly accessible synchronization and archival systems.
  9. Verify file ownership and permissions after creation and abort the destructive reset if the backup cannot be stored securely.
  10. Document the security properties, storage location, retention period, restore process, and residual-data limitations of the backup workflow.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep