T02 · Agent Memory Poisoning
- Location
scripts/migrate.sh:185- Finding
Unauthenticated Backup Restoration Can Poison Persistent Agent State
- Content
View full analysis
/dev/null | head -1) if [ -z "$RESTORE_DIR" ]; then echo "❌ Invalid backup format" rm -rf "$TMPDIR" exit 1 fi # Show manifest if [ -f "$RESTORE_DIR/manifest.json" ]; then echo " 📋 Backup from: $(cat "$RESTORE_DIR/manifest.json")" fi # Restore config if [ -d "$RESTORE_DIR/config" ]; then echo " → Restoring config" cp "$RESTORE_DIR/config/openclaw.json" "$OC_HOME/openclaw.json" 2>/dev/null && echo " ✅ openclaw.json" chmod 600 "$OC_HOME/openclaw.json" if [ -d "$RESTORE_DIR/config/agents" ]; then cp -R "$RESTORE_DIR/config/agents/"* "$OC_HOME/agents/" 2>/dev/null && echo " ✅ agents/" find "$OC_HOME/agents" -name "*.json" -exec chmod 600 {} \; fi fi # Restore workspace if [ -d "$RESTORE_DIR/workspace" ]; then echo " → Restoring workspace" for f in "$RESTORE_DIR/workspace"/*.md; do [ -f "$f" ] && cp "$f" "$OC_WORKSPACE/" && echo " ✅ $(basename $f)" done for dir in memory knowledge .learnings scripts skills; do if [ -d "$RESTORE_DIR/workspace/$dir" ]; then mkdir -p "$OC_WORKSPACE/$dir" cp -R "$RESTORE_DIR/workspace/$dir/"* "$OC_WORKSPACE/$dir/" 2>/dev/null && echo " ✅ $dir/" fi done fi ``` ### Technical Analysis The restore operation accepts a user-supplied archive and installs its contents into the active OpenClaw configuration and workspace wi ...[truncated 2080 chars]- Remediation
View remediation
