Back to skill

Security audit

Cron Doctor by Clawra

Security checks for vulnerabilities and agentic risk

Overview

Cron Doctor is a coherent cron troubleshooting skill, but its default workflow asks the agent to inspect system-wide cron files and logs with elevated access before clear user approval.

Review this skill before installing. If used, keep diagnostics user-scoped first with `crontab -l`, do not grant sudo or broad log access unless you specifically need a system-wide cron audit, and review or redact sensitive paths, usernames, command arguments, and secrets before saving the generated report.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:26
Finding
Default Diagnostic Workflow Requests Excessive Privileged System Access<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:26-50` **Vulnerability Type**: Excessive privileged access during cron diagnostics **Risk Level**: Medium ### Vulnerable Code ```bash ### 1. List All Jobs ```bash # List user's crontab crontab -l # List system crontabs sudo cat /etc/crontab ls -la /etc/cron.d/ ``` ### 2. Check Recent Execution ```bash # Check cron logs (location varies by system) # Debian/Ubuntu: grep CRON /var/log/syslog | tail -50 # RHEL/CentOS: tail -50 /var/log/cron # macOS: log show --predicate 'process == "cron"' --last 1h # Check for specific job output grep "your_job_name" /var/log/syslog | tail -20 ``` ``` ### Technical Analysis The Skill instructs an agent to enumerate system-wide cron configuration and inspect operating-system logs as part of its default diagnostic workflow. In particular, `sudo cat /etc/crontab` explicitly requests elevated access. This exceeds least privilege when the user only needs diagnosis of their own crontab or a specific scheduled job. System cron definitions and logs may reveal usernames, internal filesystem paths, command arguments, execution schedules, infrastructure details, and potentially secrets that operators have improperly embedded in command lines. The later instruction to write a health report can propagate this information into `~/workspace/reports/cron-health-YYYY-MM-DD.md`. The behavior is related to cron administration but does not install persistence. The pre-scan persistence warning is therefore a false positive: the Skill lists existing scheduled tasks and does not create or modify crontabs, services, startup hooks, or scheduled jobs. ### Attack Path 1. A user requests a routine health check for a personal or specific cron job. 2. The agent follows the unconditional “List All Jobs” workflow. 3. The agent executes `crontab -l`, then requests or uses `sudo` to read `/etc/crontab` and attempts to inspect `/etc/cron.d/`. 4. The agent reads broad system cron logs rat ...[truncated 1233 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Default to user-scoped inspection with `crontab -l`. 2. Ask for explicit confirmation before reading system-wide cron definitions or invoking `sudo`. 3. Explain which files and logs will be accessed and why elevated access is necessary. 4. Only escalate after user-level inspection is insufficient or when the user explicitly requests a system-wide audit. 5. Restrict log searches to the named job, relevant user, and narrowest practical time range. 6. Avoid reading complete system cron files when targeted metadata or user-supplied configuration is sufficient. 7. Redact credentials, tokens, command arguments, usernames, and sensitive paths before placing findings in agent context or reports. 8. Warn the user before writing privileged operational information to `~/workspace/reports/`. 9. Replace the default workflow with a staged approach such as: ```bash # Stage 1: user-scoped inspection crontab -l # Stage 2: run only after explicit approval and demonstrated need sudo cat /etc/crontab ls -la /etc/cron.d/ ``` 10. Document clearly that system-level inspection is optional and may expose information about unrelated users and services. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger list includes broad natural-language phrases such as 'job not running' and 'backup failed', which can cause the skill to activate in contexts broader than intended. Overbroad activation increases the chance the agent will run diagnostic commands or recommend actions on the wrong task or host context without clear user intent.

Session Persistence

Medium
Category
Rogue Agent
Content
```bash
# List user's crontab
crontab -l

# List system crontabs
sudo cat /etc/crontab
Confidence
85% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
crontab -l

# List system crontabs
sudo cat /etc/crontab
ls -la /etc/cron.d/
```
Confidence
91% confidence
Finding
The skill explicitly instructs use of 'sudo cat /etc/crontab', which encourages privileged command execution. In an agent setting, unnecessary escalation expands the blast radius of mistakes and can normalize prompting for or using elevated access even when user-level diagnostics would suffice.

Missing User Warnings

Low
Confidence
93% confidence
Finding
The skill instructs the agent to write a report to ~/workspace/reports/cron-health-YYYY-MM-DD.md without warning the user that local files will be created or modified. Even though the write target is limited, silent filesystem modification violates least surprise and can overwrite or create artifacts the user did not explicitly authorize.

Static analysis

No suspicious patterns detected.