T06 · System Persistence
Error
- Location
- references/setup-guide.md:45
- Finding
- Persistent Unattended Vault Synchronization Through Scheduled Tasks## Vulnerability Details **File Locations**: - `SKILL.md:34-42` - `SKILL.md:125-168` - `references/setup-guide.md:45-66` **Vulnerability Type**: Scheduled task and user-service persistence **Risk Level**: High ### Vulnerable Code `references/setup-guide.md:45-66`: ```bash ### 使用 Cron (Linux/Mac) ```bash # 编辑 crontab crontab -e # 每天凌晨3点同步 0 3 * * * /path/to/obsidian-github-sync/scripts/obsidian-sync.sh # 每天早上9点检查冲突 0 9 * * * /path/to/obsidian-github-sync/scripts/check-conflict.sh ``` ### 使用 OpenClaw Cron ```bash openclaw cron add --name "obsidian-sync" \ --cron "0 3 * * *" \ --command "/path/to/obsidian-github-sync/scripts/obsidian-sync.sh" openclaw cron add --name "obsidian-check" \ --cron "0 9 * * *" \ --command "/path/to/obsidian-github-sync/scripts/check-conflict.sh" ``` ``` `SKILL.md:125-168`: ```bash ### With OpenClaw ```bash # Add sync cron job openclaw cron add --name "obsidian-sync" \ --cron "0 3 * * *" \ --command "/path/to/obsidian-sync.sh" # Add conflict check openclaw cron add --name "obsidian-check" \ --cron "0 9 * * *" \ --command "/path/to/check-conflict.sh" ``` ### With Systemd (Linux) Create `~/.config/systemd/user/obsidian-sync.service`: ```ini [Unit] Description=Obsidian Vault Git Sync [Service] Type=oneshot Environment="OBSIDIAN_VAULT_DIR=/path/to/vault" Environment="GITHUB_REMOTE_URL=git@github.com:user/repo.git" ExecStart=/path/to/obsidian-sync.sh ``` Create `~/.config/systemd/user/obsidian-sync.timer`: ```ini [Unit] Description=Run Obsidian sync daily at 3 AM [Timer] OnCalendar=*-*-* 03:00:00 Persistent=true [Install] WantedBy=timers.target ``` Enable: ```bash systemctl --user daemon-reload systemctl --user enable obsidian-sync.timer systemctl --user start obsidian-sync.timer ``` ``` ### Technical Analysis The Skill instructs users to register recurring cron or ...[truncated 3112 chars]
- Remediation
- ## Remediation Suggestions 1. Keep manual synchronization as the default and make scheduled execution explicitly opt-in. 2. Before installation, clearly disclose that the job survives the current session, runs without per-run approval, and may upload all unignored vault content. 3. Require users to verify the repository URL, repository visibility, selected branch, `.gitignore`, and staged files before enabling automatic pushes. 4. Provide removal commands alongside installation instructions: - Remove the relevant entries with `crontab -e`. - Remove OpenClaw jobs using the applicable OpenClaw deletion command. - Disable and remove the systemd timer and service files. 5. Place scheduled scripts in a user-owned directory that is not writable by other users, and use canonical absolute paths. 6. Restrict permissions on the script, service, timer, log, and conflict-marker files. 7. Add integrity validation or deploy a protected immutable copy of the script before scheduling it. 8. Consider separating commit creation from network upload so unattended operation does not push sensitive content without review. 9. Add a dry-run or staging review mode and exclude sensitive Obsidian files through a secure default `.gitignore`. 10. Avoid `Persistent=true` unless catch-up execution is specifically requested and its behavior is clearly explained.
