Back to skill

Security audit

memory-compression-system

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its memory-compression purpose, but installation can create a recurring OpenClaw agent task that keeps reading and processing local memory without a separate opt-in.

Review this carefully before installing. Only install it if you want recurring background agent execution over your OpenClaw memory. Check whether the installer creates a cron job, verify the exact memory and data directories it will touch, and confirm you can remove any scheduled OpenClaw jobs manually if disable.sh does not clean them up.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (3)

T06 · System Persistence

Error
Location
package.json:6
Finding

Package Installation Automatically Registers a Persistent Scheduled Agent Task

Content
View full analysis
/dev/null; then log "Creating OpenClaw cron job..." # Create cron job via OpenClaw API cron_job=$(cat << 'EOF' { "name": "Memory Compression System", "schedule": { "kind": "every", "everyMs": 21600000 }, "sessionTarget": "isolated", "payload": { "kind": "agentTurn", "message": "Run Memory Compression System: cd /home/node/.openclaw/workspace/skills/memory-compression-system && ./scripts/compress.sh --auto", "timeoutSeconds": 300 }, "delivery": { "mode": "announce" } } EOF ) # Try to create the cron job if openclaw cron add --json "$cron_job" &> /dev/null; then success "OpenClaw cron job created" else warning "Failed to create OpenClaw cron job (may need manual setup)" fi else warning "openclaw command not found, skipping cron setup" log "Manual cron setup required. Add to crontab:" log "0 */6 * * * cd $SKILL_DIR && ./scripts/compress.sh --auto" fi success "Cron setup completed" } ``` ### Technical Analysis The package defines `scripts/install.sh` as its npm `install` lifecycle command. Consequently, an ordinary `npm install` can execute the full installation script. That script invokes `setup_cron_job`, which registers an OpenClaw scheduled task that laun ...[truncated 2481 chars]
Remediation
View remediation

T06 · System Persistence

Warning
Location
scripts/disable.sh:48
Finding

Disable Workflow Can Report Success While Scheduled Tasks Remain Active

Content
View full analysis
/dev/null; then echo "Removing OpenClaw cron job..." # Find and remove cron job local job_id=$(openclaw cron list --json 2>/dev/null | grep -i -B2 -A2 "memory.compression" | grep '"id"' | cut -d'"' -f4 | head -1) if [ -n "$job_id" ]; then if openclaw cron remove --id "$job_id" &> /dev/null; then echo -e "${YELLOW}OpenClaw cron job removed: $job_id${NC}" else echo -e "${RED}Failed to remove OpenClaw cron job${NC}" fi else echo -e "${YELLOW}No OpenClaw cron job found${NC}" fi else echo -e "${YELLOW}openclaw command not found${NC}" echo "Manual cron cleanup required. Remove from crontab:" echo "0 */6 * * * cd $SKILL_DIR && ./scripts/compress.sh --auto" fi } ``` ```bash # Remove enabled marker remove_enabled_marker() { echo "Removing enabled marker..." if [ -f "$SKILL_DIR/.enabled" ]; then local enabled_date=$(cat "$SKILL_DIR/.enabled") rm -f "$SKILL_DIR/.enabled" echo -e "${YELLOW}Disabled (was enabled on: $enabled_date)${NC}" else echo -e "${YELLOW}No enabled marker found${NC}" fi } ``` ```bash remove_cron_job echo "" remove_enabled_marker echo "" create_disabled_marker echo "" show_final_status echo "" echo -e "${YELLOW}=========================================${NC}" echo -e "${YELLOW} MEMORY COMPRESSION SYSTEM DISABLED ${NC}" echo -e "${YELLOW}=========================================${NC}" ``` ### Technical ...[truncated 2441 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/install.sh:399
Finding

Installer Applies File-Only Permissions to Data Directories

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The documented behavior includes broad filesystem modification, backups of existing directories and cron data, and registration of automation jobs, while no permissions are declared. In skill context, this materially increases risk because a user seeking memory compression may unknowingly authorize extensive local persistence and file manipulation beyond the apparent purpose.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/compress.sh --format ultra

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/compress.sh --format ultra

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/compress.sh --format ultra

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/compress.sh --format ultra

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
scripts/compress.sh --format ultra

Instruction Override

High
Category
Prompt Injection
Confidence
70% confidence
Finding

This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.

Content

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

Environment Variables

bash
export MEMORY_COMPRESSION_DEBUG=1  # Enable debug mode
export MEMORY_COMPRESSION_QUIET=0  # Disable quiet mode
export MEMORY_COMPRESSION_TEST=0   # Enable test mode

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
92% confidence
Finding

get_memory_context builds a temp file that genuinely includes snippets from memory files, creating the expectation that the compression result contains that gathered context. In compress_ultra, the input is read into content but never used, so the resulting file contradicts the documented/annotated intent of including memory-file content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description claims context compression, and the script gathers memory context into a temp file, but compress_ultra reads that file into content and never writes the content into the output. Instead it produces a metadata summary with counts, sizes, and config fields, which is semantically different from compressing the memory context itself.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/disable.sh (reported line 79)May include surrounding context.

sh
echo "Removing enabled marker..."
    if [ -f "$SKILL_DIR/.enabled" ]; then
        local enabled_date=$(cat "$SKILL_DIR/.enabled")
        rm -f "$SKILL_DIR/.enabled"
        echo -e "${YELLOW}Disabled (was enabled on: $enabled_date)${NC}"
    else
        echo -e "${YELLOW}No enabled marker found${NC}"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises automatic compression and cleanup that can modify or delete stored memory data, but it does not clearly warn users about the risk of data loss or the need to review retention, schedules, and target paths before enabling automation. In a memory-management skill, destructive automation is contextually plausible, but the lack of prominent caution increases the chance of accidental data loss or unsafe deployment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises numerous shell-driven operations such as install, enable, cleanup, backup, restore, and cron-style automation, but the manifest shown does not declare any explicit tool scope or permissions. In a skill ecosystem, undocumented shell capability expands trust assumptions and can let a seemingly content-management skill perform filesystem and scheduling actions users did not explicitly authorize.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly advertises automatic compression every 6 hours and daily cleanup of old files, but it does not present a strong up-front warning that local data will be modified and deleted on an ongoing basis. In this context, silent automation over memory files, backups, and logs can cause unintended data loss or persistence changes, especially if users enable it casually from the quick-start commands.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest emphasizes integrated memory management and compression, so creating backups can fit that purpose. However, this file also implements persistent backup creation and separate search-index updates, broadening behavior beyond a straightforward 'main compression script' into archival and indexing operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script creates backup archives and later writes compressed outputs, history files, search indexes, and timestamp files to disk, but it does not present any confirmation prompt or explicit user-facing warning before those file modifications occur. While the script logs its actions, the help text and comments do not clearly disclose that running it will create and update persistent files under the skill data directories.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

In auto mode, the script invokes a secondary cleanup script that can perform additional file operations without giving the caller visibility into that behavior. In a memory-management skill that already modifies local state, this hidden chained action increases the risk of unintended deletion or retention-policy side effects, especially when run from cron or other unattended automation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The enable script installs a persistent OpenClaw cron job that causes future autonomous agent execution every 6 hours. That goes beyond a one-time local enablement step and creates ongoing background behavior, which is risky because it can repeatedly invoke other scripts without fresh user review, especially in a skill that manages memory and context automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The installer automatically provisions a recurring OpenClaw cron job that will execute compression every 6 hours, without an explicit opt-in prompt, dry-run, or clear warning before enabling persistence. In an agent-skill context, silently installing scheduled autonomous actions expands the skill’s privileges and can cause ongoing file processing or future command execution after the user believes installation is complete.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install.sh (reported line 404)May include surrounding context.

sh
# Set permissions
    chmod -R 755 "$SKILL_DIR/scripts"
    chmod 644 "$CONFIG_DIR"/*
    chmod 644 "$DATA_DIR"/*
    
    # Create installation marker