T06 · System Persistence
- Location
SKILL.md:131- Finding
Persistent Scheduled Execution Through Agent Cron
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 131–137
Vulnerability Type: Persistent scheduled task
Risk Level: HighComplete Code Snippet
bash skill-platform cron add \ --name "calendar-daily-scan" \ --cron "0 22 * * *" \ --tz "Asia/Shanghai" \ --session main \ --system-event "CALENDAR_SCAN: 请立即运行 python3 ~/.skill-platform/workspace/skills/calendar-reminder/calendar_reminder.py 并等待完成" \ --description "每晚22:00扫描明天日历并设置提醒"Technical Analysis
The Skill instructs the user or Agent to register a daily scheduled event that persists beyond the initial Skill run. At 22:00 each day, the event is delivered to the main Agent session and directs it to execute:
bash python3 ~/.skill-platform/workspace/skills/calendar-reminder/calendar_reminder.pyThis creates a persistent execution mechanism tied to a Python file in a user-writable workspace. The referenced
calendar_reminder.pyfile is not included in the audited project, so its behavior, integrity, credential handling, and outbound communications cannot be reviewed. If that path is populated or modified after the schedule is registered, the new content may receive recurring execution without another review of this Skill.Attack Path
- A user or Agent follows the setup instructions in
SKILL.md. skill-platform cron addregisters the daily task for the main Agent session.- The scheduled task persists after the setup operation completes.
- An attacker, compromised dependency, or another process with write access places or replaces
calendar_reminder.pyat the referenced workspace path. - At the next scheduled invocation, the system event instructs the Agent to execute the unreviewed Python file.
- The substituted script runs with the permissions and accessible credentials of the invoking Agent or user.
- The task continues to trigger daily until explicitly removed.
Impact Assessmen
...[truncated 632 chars]
- A user or Agent follows the setup instructions in
- Remediation
View remediation
Remediation Suggestions
- Do not register recurring tasks automatically; require explicit, informed user approval that identifies the schedule, target command, execution identity, and removal procedure.
- Include the referenced implementation in the Skill package so it can be audited before use.
- Execute only an immutable or integrity-verified artifact. Pin an expected cryptographic hash and refuse execution if verification fails.
- Store the script in an administrator-controlled, non-user-writable location with restrictive ownership and permissions.
- Avoid delivering executable instructions to the main Agent session. Use a narrowly scoped scheduler identity with only the calendar-read and notification permissions required.
- Apply an expiration date or bounded invocation count to the task and provide a clear command to disable and remove it.
- Validate the task target immediately before every run and reject symbolic links, unexpected ownership, writable parent directories, or changed content.
- Keep credentials out of the script and expose only narrowly scoped secrets at runtime.
- Log task creation, modification, execution, integrity failures, and removal, and alert the user when the executable target changes.
- Document and verify cleanup with:
bash skill-platform cron remove --name "calendar-daily-scan"
