T06 · System Persistence
- Location
SKILL.md:81- Finding
Persistent Recurring Monitoring Through Scheduled Tasks and Agent Heartbeat State
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 81-90
Vulnerability Type: Scheduled-task and cross-session persistence
Risk Level: HighVulnerable Code
bash */15 * * * * /path/to/check.shThe same section also directs the agent to add monitoring instructions to
HEARTBEAT.mdas an alternative persistence mechanism.Technical Analysis
The skill instructs the agent to establish recurring monitoring through a cron entry or persistent heartbeat instructions. Both mechanisms can survive the interaction that initiated the skill and cause monitoring logic to execute in future sessions or at fixed intervals.
No explicit user-consent gate, expiration period, cleanup procedure, integrity validation for
check.sh, or restriction on the commands that the scheduled script may execute is provided. The cron command therefore delegates recurring execution to a replaceable filesystem path. If another user or process can modify the referenced script, future scheduled invocations may execute altered commands under the privileges of the account that owns the cron entry.Editing a crontab or
HEARTBEAT.mdalso changes persistent system or agent state. This contradicts the skill's assertion that all of its commands are read-only.Attack Path
- A user invokes the server-monitoring skill or requests recurring resource checks.
- The agent follows the scheduled-monitoring instructions and adds the displayed cron entry or writes monitoring instructions to
HEARTBEAT.md. - The persistent mechanism remains active after the original interaction ends.
- Cron or the heartbeat system repeatedly invokes the configured monitoring operation.
- If
/path/to/check.shis subsequently replaced or modified, the scheduled task executes the modified content. - When notification integration is configured, collected hostname, process, load, storage, memory, and network telemetry may also be transmitted repeatedly through that channel.
Impa
...[truncated 637 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit, informed user confirmation before creating any cron entry or modifying persistent heartbeat state.
- Display the exact proposed persistent changes, execution frequency, command path, privilege context, and removal procedure before applying them.
- Do not enable scheduled monitoring by default; prefer a one-time, read-only status check.
- Use an absolute, dedicated script path owned by the scheduled-task owner and not writable by untrusted users or groups.
- Validate script ownership and permissions before installation, and reject symbolic links or unexpectedly writable parent directories.
- Run the task under a dedicated least-privileged service account rather than a privileged or administrative account.
- Define a bounded lifetime or expiration mechanism for recurring monitoring.
- Provide explicit cleanup commands for removing the cron entry, monitoring script, and heartbeat instructions.
- Require separate consent before enabling any notification integration, and disclose exactly what telemetry will be transmitted and where.
- Update the documentation to clarify that installing cron entries or modifying
HEARTBEAT.mdis state-changing and is not read-only.
