T09 · Insecure Skill Coding Practices
- Location
autoclaw.py:105- Finding
Unconditional Plaintext Backup of Sensitive Agent Workspace Data
- Content
View full analysis
Vulnerability Details
File Location:
autoclaw.py:105-110andautoclaw.py:195-197
Vulnerability Type: Sensitive data copied outside its minimum required scope using a hard-coded workspace path
Risk Level: MediumVulnerable Code
python files_to_backup = [ 'config.json', 'MEMORY.md', 'docs/lessons-learned.md', 'memory_data/ai_memory.db', ]python if __name__ == '__main__': workspace = "C:\\Users\\Administrator\\.openclaw\\workspace" autoclaw = AutoClaw(workspace) autoclaw.run()Technical Analysis
The documented execution path unconditionally selects a hard-coded Administrator OpenClaw workspace and copies configuration, long-term memory, learned information, and the memory database into the workspace's
backupsdirectory.These files can contain credentials, private operational context, user information, agent state, or other sensitive data. The backups are ordinary filesystem copies created through
shutil.copy2; the implementation does not encrypt them, restrict backup permissions explicitly, verify workspace ownership, or require per-file user approval.Although the README describes an
autoclaw_config.jsonconfiguration mechanism, the implementation does not load that file. Consequently, users cannot select the workspace or opt out of sensitive memory backups through the advertised configuration interface.This issue does not itself bypass operating-system permissions or transmit data over a network. Exploitation requires the process to have read access to the source workspace and an attacker or another local process to obtain access to the resulting backup files.
Attack Path
- A user executes the documented command:
python autoclaw.py. - The program selects
C:\Users\Administrator\.openclaw\workspacewithout validating that it belongs to the invoking user or was explicitly authorized. auto_backup()searches that ...[truncated 1153 chars]
- A user executes the documented command:
- Remediation
View remediation
Remediation Suggestions
- Remove the hard-coded Administrator workspace and require an explicit workspace argument or a validated configuration file.
- Resolve the workspace to a canonical path and verify that it exists, is expected, and is owned by or explicitly authorized for the invoking user.
- Require explicit opt-in before backing up
MEMORY.md, memory databases, configuration files, or other potentially sensitive data. - Support a configurable allowlist and denylist so users can precisely control backup contents.
- Create backup directories and files with restrictive permissions accessible only to the intended account.
- Encrypt sensitive backups at rest using a user-controlled key and avoid storing the key alongside the backups.
- Warn users when a backup target is synchronized, shared, or accessible by other accounts.
- Document retention and secure deletion behavior, and provide a command to remove existing sensitive backups.
- Implement the configuration interface described in the README and fail safely when the workspace has not been explicitly configured.
- Add tests confirming that the application refuses unexpected, privileged, shared, or unowned workspace paths.
