T06 · System Persistence
Error
- Location
- SKILL.md:215
- Finding
- Persistent Daily Execution Through Cron and a macOS LaunchAgent<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 215-254 **Vulnerability Type**: Persistent scheduled task and user-level startup service **Risk Level**: High ### Evidence ```bash crontab -e 0 9 * * * /path/to/email_daily_summary.sh >> /path/to/logs/email_summary.log 2>&1 ``` ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.email.dailysummary</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/path/to/email_daily_summary.sh</string> </array> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>9</integer> <key>Minute</key> <integer>0</integer> </dict> <key>StandardOutPath</key> <string>/tmp/email_summary.log</string> <key>StandardErrorPath</key> <string>/tmp/email_summary_error.log</string> </dict> </plist> ``` ```bash launchctl load ~/Library/LaunchAgents/com.email.dailysummary.plist ``` ### Technical Analysis The Skill instructs users to register a cron entry or load a macOS LaunchAgent that invokes a shell script every day. Both mechanisms survive the original Skill invocation and continue executing until explicitly removed. Scheduled execution is consistent with the optional daily-automation feature, but it is not required for the core function of producing an email summary on demand. It therefore exceeds the minimum privileges and lifecycle needed for the basic task. The documentation does not provide an uninstall procedure, verify the integrity or ownership of the referenced script, enforce restrictive file permissions, or require an explicit security confirmation before enabling persistence. Because the scheduler invokes a mutable filesystem path through `/bin/bash`, any party able to replace or modify that script can convert the legi ...[truncated 1192 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove scheduler registration from the default workflow and keep on-demand summary generation as the default. - Present scheduling as a separate, explicit opt-in operation with a clear explanation that it creates cross-session execution. - Invoke a fixed absolute script path located in a user-owned directory that is not writable by other users. - Apply restrictive ownership and permissions to the script, configuration, output directory, and logs. - Avoid executing a mutable script through a general-purpose shell where a narrowly scoped executable or command can be used. - Validate the script's ownership and integrity before every scheduled invocation. - Use a restricted environment with a minimal `PATH` and only the environment variables required for the task. - Avoid writing potentially sensitive mailbox output to shared temporary directories. - Document complete removal procedures, including deletion of the cron entry and execution of `launchctl unload` followed by removal of the property-list file. - Require renewed user consent before enabling access to an authenticated browser profile from an unattended scheduled process. ]]>
