T02 · Agent Memory Poisoning
- Location
scripts/restore.sh:105- Finding
Unverified Backup Archives Can Poison Persistent Agent Instructions and Memory
- Content
View full analysis
/dev/null || true ``` ```bash rclone copy "$ONEDRIVE/$file" $TEMP_DIR/ log "解压..." tar -xzf $TEMP_DIR/$file -C $TEMP_DIR/ ``` ```bash if [ "$MODE" = "core" ] || [ "$MODE" = "all" ]; then if [ -n "$SOURCE" ]; then # 从本地恢复 if [ -n "$DATE" ]; then restore_from_local "$SOURCE/goudan-core-$DATE.tar.gz" "SOUL.md" restore_from_local "$SOURCE/goudan-core-$DATE.tar.gz" "AGENTS.md" restore_from_local "$SOURCE/goudan-core-$DATE.tar.gz" "IDENTITY.md" restore_from_local "$SOURCE/goudan-core-$DATE.tar.gz" "USER.md" restore_from_local "$SOURCE/goudan-core-$DATE.tar.gz" "TOOLS.md" else CORE_FILE=$(ls -t $SOURCE/goudan-core-*.tar.gz 2>/dev/null | head -1) if [ -n "$CORE_FILE" ]; then restore_from_local "$CORE_FILE" "SOUL.md" restore_from_local "$CORE_FILE" "AGENTS.md" restore_from_local "$CORE_FILE" "IDENTITY.md" restore_from_local "$CORE_FILE" "USER.md" restore_from_local "$CORE_FILE" "TOOLS.md" fi fi ``` ```bash if [ "$MODE" = "memory" ] || [ "$MODE" = "all" ]; then if [ -n "$SOURCE" ]; then # 从本地恢复 if [ -n "$DATE" ]; then restore_from_local "$SOURCE/goudan-memory-$DATE.tar.gz" "memory/" else MEMORY_FILE=$(ls -t $SOURCE/goudan-memory-*.tar.gz 2>/dev/null | head -1) if [ -n "$MEMORY_FILE" ]; then restore_from_local "$MEMORY_FILE" "memory/" fi fi ``` ### Technical Analysis The restore process accepts archives from either an arbitrary local ` ...[truncated 2345 chars]- Remediation
View remediation
