T06 · System Persistence
- Location
SKILL.md:72- Finding
Ungated Recurring Heartbeat Task Creates Cross-Session Persistence
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:72-74
Vulnerability Type: Scheduled cross-session execution without an explicit approval gate
Risk Level: HighVulnerable Code
markdown ## Scheduling Add to HEARTBEAT.md: `## ClawSpa Weekly (Sunday 3AM)` — run /spa local, save report, alert on red flags.Technical Analysis
The instruction directs the agent to modify
HEARTBEAT.mdand register a weekly ClawSpa task. This persistent configuration survives the current invocation and can cause/spato run during later heartbeat processing without a new user request.Although
SKILL.md:66generally states that files must not be modified without explicit approval, the scheduling directive does not include an approval requirement and is written as an imperative. This ambiguity can result in the agent applying the persistent change immediately when the Skill is loaded.The persistence is not required for ClawSpa's primary on-demand maintenance functionality. It therefore exceeds the minimum privileges necessary unless the user separately and explicitly opts into recurring execution.
Attack Path
- A user invokes ClawSpa for an on-demand maintenance operation.
- The agent loads and follows
SKILL.md. - The scheduling instruction causes the agent to add the weekly ClawSpa entry to
HEARTBEAT.md. - The modified heartbeat configuration persists after the original Skill invocation ends.
- Future heartbeat processing invokes
/spawithout a new, contemporaneous user request. - Each recurring run may inspect memory, agent instructions, configuration, installed skills, schedules, and usage history, and then write a report.
Impact Assessment
Successful exploitation obtains persistent, recurring execution within the agent's existing heartbeat context. The recurring task can repeatedly exercise the filesystem access already associated with ClawSpa's maintenance procedures, including ...[truncated 411 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the imperative scheduling instruction from the default Skill workflow.
- Describe recurring scans as an optional feature that is disabled by default.
- Before modifying
HEARTBEAT.md, display the exact proposed entry and request explicit user approval specifically for recurring execution. - Separate approval for the current scan from approval for persistent scheduling; approval to run
/spaonce must not authorize future runs. - Validate that an equivalent schedule does not already exist before adding an entry.
- Document how to inspect, disable, and remove the scheduled task.
- Record when and why the schedule was installed so its provenance can be audited.
- Consider requiring confirmation before sensitive scan categories run from an unattended heartbeat.
