T02 · Agent Memory Poisoning
- Location
templates/AGENTS.md:64- Finding
Persistent Self-Modification of Agent Control Files Enables Memory Poisoning
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent local memory skill, but it gives agents and optional automation broad persistent control over behavior files, git history, backups, and cron entries that users should review carefully.
Use this only in an isolated workspace you are comfortable making persistent. Before enabling optional scripts, review them, avoid storing secrets in the workspace, replace whole-workspace auto commits with a narrow allowlist, use HTTPS or encrypted backups only, validate SSH backup paths, and manually review any proposed changes to AGENTS.md, SOUL.md, and TOOLS.md.
templates/AGENTS.md:64Persistent Self-Modification of Agent Control Files Enables Memory Poisoning
scripts/auto_commit.sh:17Hourly Automation Commits the Entire Workspace to Git History
scripts/workspace_backup.sh:81Remote Backup Permits Plaintext Transfer and Unsafe Remote Shell Construction
INSTALL.md:164Uninstall Command Deletes Unrelated OpenClaw Cron Jobs
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
.md` is deleted 4. The memory system runs automatically from here
After installation, check that everything is in place:
cd ~/.openclaw/workspace
# Templates
ls -la AGENTS.md SOUL.md MEMORY.md HEARTBEAT.md BOOTSTRAP.md
# Scripts
ls -la scripts/*.sh
# Strategy registry
cat strategies.json | python3 -m json.tool | head -5
# Memory directory
ls -la memory/
# Cron jobs
crontab -l | grep openclaw
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
rm -f ~/.openclaw/workspace/strategies.json
# Remove cron jobs
crontab -l | grep -v openclaw | crontab -
# Your MEMORY.md, AGENTS.md, SOUL.md etc. are YOUR data — keep them!
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
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).
# Remove scripts (keep your data!)
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
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).
rm -rf ~/.openclaw/workspace/scripts/memory_consolidate.sh
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
rm -f ~/.openclaw/workspace/strategies.json
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).
rm -rf ~/.openclaw/workspace/scripts/memory_search.sh
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
rm -f ~/.openclaw/workspace/strategies.json
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).
rm -rf ~/.openclaw/workspace/scripts/strategy_*.sh
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
rm -f ~/.openclaw/workspace/strategies.json
# Remove cron jobs
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).
rm -rf ~/.openclaw/workspace/scripts/auto_commit.sh
rm -rf ~/.openclaw/workspace/scripts/workspace_backup.sh
rm -rf ~/.openclaw/workspace/scripts/daily_log_init.sh
rm -f ~/.openclaw/workspace/strategies.json
# Remove cron jobs
crontab -l | grep -v openclaw | crontab -
If the skill includes local user-management behavior such as writing state to ~/.mjolnir_current_user and deleting user directories, that is far beyond a simple self-evolving memory system. Writing into a home directory and deleting data introduces persistence and destructive capability that users may not anticipate from the declared description. Misdocumented multi-user isolation logic can therefore lead to privacy issues, data loss, or misuse of local account-like state.
If the skill includes local user-management behavior such as writing state to ~/.mjolnir_current_user and deleting user directories, that is far beyond a simple self-evolving memory system. Writing into a home directory and deleting data introduces persistence and destructive capability that users may not anticipate from the declared description. Misdocumented multi-user isolation logic can therefore lead to privacy issues, data loss, or misuse of local account-like state.
If the skill includes local user-management behavior such as writing state to ~/.mjolnir_current_user and deleting user directories, that is far beyond a simple self-evolving memory system. Writing into a home directory and deleting data introduces persistence and destructive capability that users may not anticipate from the declared description. Misdocumented multi-user isolation logic can therefore lead to privacy issues, data loss, or misuse of local account-like state.
If the skill includes local user-management behavior such as writing state to ~/.mjolnir_current_user and deleting user directories, that is far beyond a simple self-evolving memory system. Writing into a home directory and deleting data introduces persistence and destructive capability that users may not anticipate from the declared description. Misdocumented multi-user isolation logic can therefore lead to privacy issues, data loss, or misuse of local account-like state.
If the skill includes local user-management behavior such as writing state to ~/.mjolnir_current_user and deleting user directories, that is far beyond a simple self-evolving memory system. Writing into a home directory and deleting data introduces persistence and destructive capability that users may not anticipate from the declared description. Misdocumented multi-user isolation logic can therefore lead to privacy issues, data loss, or misuse of local account-like state.
The task message schema includes an action value of execute_command, documenting remote command execution capability in a skill described as a local memory system. Even though this is only a spec, it normalizes an unsafe control channel that could be implemented to let one node trigger arbitrary command execution on another, leading to code execution, data loss, credential theft, or lateral movement across the local network.
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
scripts/user.sh create alice scripts/user.sh switch alice
---
## Scenario 3: Add New Team Member
### Step 1: Create User
```bash
scripts/user.sh create <new_username>
scripts/set_permissions.sh
New user runs:
scripts/user.sh switch <their_username>
Or adds to their shell config:
echo 'export MJOLNIR_USER=<their_username>' >> ~/.bashrc
source ~/.bashrc
mkdir -p templates/memory/shared/projects/<project_name>
Create templates/memory/shared/projects/<project_name>/CONTEXT.md:
# Project: <Project Name>
## Overview
Brief description of the project.
## Key Decisions
- Decision 1
- Decision 2
## Related Files
- Link to relevant files
chmod 755 templates/memory/shared/projects/<project_na
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo ""
echo "示例:"
echo " ./log_work.sh \"Day-1 内容创作\" \"docs/articles/Day-01-为什么选 OpenClaw.md\""
echo " ./log_work.sh \"配置 SSH 免密\" \".ssh/authorized_keys\""
exit 1
fi
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo ""
echo "示例:"
echo " ./log_work.sh \"Day-1 内容创作\" \"docs/articles/Day-01-为什么选 OpenClaw.md\""
echo " ./log_work.sh \"配置 SSH 免密\" \".ssh/authorized_keys\""
exit 1
fi
The remote cleanup command builds a shell pipeline using unquoted, user-configurable input in "$BACKUP_SSH_PATH" inside a command string executed by ssh. Because the remote shell parses that string, a crafted BACKUP_SSH_PATH containing shell metacharacters can inject arbitrary commands on the remote host; additionally, piping ls output into xargs rm is unsafe and can delete unintended files if filenames contain whitespace or special characters.
if scp -q "$ARCHIVE" "$BACKUP_SSH_HOST:$BACKUP_SSH_PATH/" 2>/dev/null; then
log "✅ SSH: uploaded to $BACKUP_SSH_HOST:$BACKUP_SSH_PATH"
# Rotate old backups
ssh "$BACKUP_SSH_HOST" "cd $BACKUP_SSH_PATH && ls -t workspace_*.tar.gz | tail -n +$((KEEP_COUNT+1)) | xargs rm -f 2>/dev/null" || true
else
log "❌ SSH: upload failed"
fi
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
# 🎨 Creative — 创作类分区示例
<!-- Partition: example-creative -->
<!-- Keywords: 创作, 故事, 写作, 角色, IP, creative, story, writing, character -->
<!-- Max Size: 20KB -->
<!-- Description: 存储创作相关的记忆,包括故事线、角色设定、写作风格偏好等 -->
> **这是一个示例分区文件。** 实际使用时,替换为你自己的内容。
> This is an example partition file. Replace with your own content when using.
## 📖 故事线 / Story Arcs
- (示例)第一季主线:英雄觉醒 → 试炼 → 对决
- (示例)支线:伙伴关系发展,伏笔回收
## 🧑🎨 角色设定 / Character Profiles
- (示例)主角:性格特征、成长弧线、口头禅
- (示例)反派:动机、弱点、与主角的镜�
Detected: suspicious.destructive_delete_command