T06 · System Persistence
- Location
SKILL.md:27- Finding
Recurring Cross-Session Execution Through Scheduled Tasks
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:27-48; equivalent instructions also appear inSKILL.zh.md:27-48
Vulnerability Type: Scheduled task persistence
Risk Level: HighVulnerable Code
bash 0 0 * * * cd /path/to/skill && python scripts/collect_memes.pyjson { "action": "add", "job": { "name": "daily-anime-meme-collect", "schedule": { "kind": "cron", "expr": "0 0 * * *", "tz": "Asia/Shanghai" }, "payload": { "kind": "systemEvent", "command": "python scripts/collect_memes.py" } } }Technical Analysis
The Skill documentation instructs the user or Agent to register either an operating-system cron entry or an OpenClaw cron job. Both mechanisms survive the initial Skill run and invoke
scripts/collect_memes.pyautomatically every day.This creates a persistent execution path whose effective behavior depends on the future contents of the script and its containing directory. The cron example also uses a relative script path after changing into
/path/to/skill, while the OpenClaw example executes a relative path without explicitly defining a trusted working directory. If an attacker can later modify the script, replace a path component, or influence the scheduler's working directory, attacker-controlled Python code could be executed during a subsequent unattended run.The reviewed instructions do not themselves demonstrate privilege escalation or unauthorized script replacement. The risk arises from creating recurring cross-session execution and from the scheduler continuing to trust mutable project content.
Attack Path
- A user or Agent follows the automated-update instructions.
- A persistent cron or OpenClaw scheduled job is registered.
- The job remains active after the original interaction ends.
- The scheduler automatically invokes
collect_memes.pyeach day. - If an attacker subsequently gains writ ...[truncated 769 chars]
- Remediation
View remediation
Remediation Suggestions
- Make one-time manual execution the default behavior.
- Require explicit, informed user approval before creating any recurring job.
- Explain the execution frequency, network destinations, modified files, scheduler identity, and persistence implications before installation.
- Use an absolute, canonical path to a root-owned or otherwise non-writable script rather than relying on the current working directory.
- Run the task under a dedicated, least-privileged account with narrowly scoped filesystem and network access.
- Avoid a privileged OpenClaw
systemEventwhen a restricted job type is available. - Pin or integrity-check the executable script before each run.
- Document commands for listing, disabling, and permanently removing the scheduled job.
- Apply the same corrections to both
SKILL.mdandSKILL.zh.md.
