T06 · System Persistence
- Location
SKILL.md:127- Finding
Persistent Autonomous Heartbeat Executes Mutable Instructions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 127-138
Vulnerability Type: Persistent scheduled execution using mutable task instructions
Risk Level: HighVulnerable Code:
json { "cron": [{ "name": "heartbeat", "schedule": {"kind": "every", "everyMs": 1800000}, "sessionTarget": "main", "payload": {"kind": "systemEvent", "text": "HEARTBEAT: Read HEARTBEAT.md. Execute priority tasks."} }] }Technical Analysis
This configuration creates a recurring task that survives the initial skill setup and executes every 30 minutes. The task injects a
systemEventinto the main agent session and instructs the agent to readHEARTBEAT.mdand execute the tasks defined there.Because
HEARTBEAT.mdis mutable and no validation, integrity check, task allowlist, or approval boundary is specified, modifying that file can change the behavior of every subsequent heartbeat without changing the reviewed skill. Execution in the main session may also expose the scheduled task to the session's existing tools, integrations, credentials, and context.Attack Path
- A user follows the setup instructions and registers the heartbeat cron entry.
- An attacker, compromised skill, or other process obtains write access to
HEARTBEAT.md. - The attacker adds unauthorized instructions to the file.
- At the next scheduled interval, the system event directs the agent to read the modified file.
- The agent may execute the injected tasks using tools and integrations available to the main session.
- The behavior repeats every 30 minutes until the cron job or malicious instructions are removed.
Impact Assessment
Successful exploitation could provide recurring, cross-session influence over agent actions. The obtainable scope depends on the main session's configured capabilities and may include access to connected messaging, email, calendar, files, or other enabled tools. This ...[truncated 132 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not enable the recurring heartbeat by default; make it an explicit opt-in feature.
- Require interactive approval before executing tasks loaded from a mutable file.
- Run scheduled tasks in a restricted, isolated session rather than the main session.
- Replace free-form Markdown instructions with a validated task schema and an explicit allowlist of permitted operations.
- Apply strict file ownership and permissions to
HEARTBEAT.md. - Verify the file's integrity or trusted signature before processing it.
- Restrict scheduled sessions to the minimum required tools and credentials.
- Document how to inspect, pause, and permanently remove the heartbeat cron entry.
- Record each scheduled action in an auditable log without storing sensitive content unnecessarily.
