T06 ยท System Persistence
Error
- Location
- SKILL.md:47
- Finding
- Recurring Scheduled Task Creates Cross-Session Persistence## Vulnerability Details **File Location**: `SKILL.md`, lines 47โ66 **Vulnerability Type**: Scheduled-task persistence **Risk Level**: High ### Vulnerable Code ```markdown ## Quick Start 1. Trigger: After loading this skill, execute manually below. 2. `edit HEARTBEAT.md`: Add refresh task. 3. `cron add`: Daily 6AM refresh (copy command below). ## Workflow (Manual) 1. ๐ `session_status` โ Check context length. 2. **HEARTBEAT.md Edit Example:** ``` - [ ] Refresh: read workspace/{AGENTS.md,IDENTITY.md,SOUL.md,USER.md} โ Chain SOUL/USER/IDENTITY + Summarize MEMORY (rotate: 4h, 9AM/1PM/8PM) ``` 3. **Cron Add Command (copy-paste to exec):** ``` cron action=add job='{"name":"agents-refresh-daily","schedule":{"kind":"cron","expr":"0 6 * * *","tz":"Asia/Tokyo"},"payload":{"kind":"systemEvent","text":"[Daily Refresh๐พ] read workspace/{AGENTS.md,IDENTITY.md,SOUL.md,USER.md}! Reload SOUL/USER/IDENTITY chain โ Keep focus on ToDo/projects! Summarize recent MEMORY/ToDo."},"delivery":{"mode":"announce"},"sessionTarget":"main","task":"refresh_memory"}' ``` 4. Test: `cron action=run jobId=agents-refresh-daily` or wait for heartbeat. ## Rotate Checks (In Heartbeat) - 6AM/9AM, 1PM, 8PM: Reload AGENTSโIDENTITY/SOUL chain + Update MEMORY/ToDo. - Distill recent memory/YYYY-MM-DD.md โ MEMORY.md. ``` The package also declares the recurring task in `manifest.yaml`, lines 9โ13: ```yaml schedules: - cron: "0 6 * * *" task: "refresh_memory" description: "Every morning at 6AM, distill yesterday's logs and update MEMORY.md" timezone: "Asia/Tokyo" ``` ### Technical Analysis The skill explicitly directs the installation of a durable cron job and independently declares the same daily schedule in its manifest. The scheduled payload targets the `main` agent session and injects a `systemEvent` that instructs the agent to reread `AGENTS.md`, `IDENTITY.md`, `SOUL.md`, and `USER.md`, then summarize persistent memory and task data. This behavior survives the o ...[truncated 1904 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the automatic schedule from `manifest.yaml` and remove the `cron action=add` instruction from `SKILL.md`. 2. Implement memory refresh as an explicitly requested, one-shot operation by default. 3. If recurring scheduling is required, obtain informed user confirmation immediately before registration and clearly display: - The exact schedule and timezone. - The target session. - Every file that will be read or modified. - The persistence duration. - Exact commands for disabling and deleting the task. 4. Add a bounded lifetime, maximum execution count, or automatic expiration date. 5. Run scheduled maintenance in an isolated session rather than injecting recurring system events into the main session. 6. Require confirmation before writing distilled content to persistent memory. 7. Treat content from memory logs and user-controlled files as untrusted data. Do not convert embedded instructions into agent directives. 8. Avoid modifying `HEARTBEAT.md` as a second persistence mechanism, or ensure the entry is temporary and automatically removed. 9. Provide uninstall logic that removes both the cron job and all heartbeat entries created by the skill. 10. Record each scheduled execution and memory modification in an auditable log so users can review and reverse changes.
