T06 · System Persistence
Error
- Location
- SKILL.md:127
- Finding
- Persistent LaunchAgent and Daily Scheduled Agent Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:127-155`, `SKILL.md:158-202` **Vulnerability Type**: Cross-session service and scheduled-task persistence **Risk Level**: High ### Vulnerable Code ```xml LaunchAgent plist template: <?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>ai.openclaw.briefed</string> <key>ProgramArguments</key><array> <string>/usr/local/bin/node</string> <string>/Users/YOUR_USER/.openclaw/workspace/briefed/server.js</string> </array> <key>EnvironmentVariables</key><dict> <key>BRIEFED_GMAIL_CLIENT_SECRET</key><string>/Users/YOUR_USER/client_secret.json</string> <key>BRIEFED_GMAIL_TOKEN_FILE</key><string>/Users/YOUR_USER/.openclaw/workspace/briefed-gmail-token.json</string> </dict> <key>RunAtLoad</key><true/> <key>KeepAlive</key><true/> <key>WorkingDirectory</key><string>/Users/YOUR_USER/.openclaw/workspace/briefed</string> <key>StandardOutPath</key><string>/tmp/briefed.log</string> <key>StandardErrorPath</key><string>/tmp/briefed.log</string> </dict></plist> ``` ```bash launchctl load ~/Library/LaunchAgents/ai.openclaw.briefed.plist ``` ```text Cron schedule: `0 7 * * *` (7am daily), model: `anthropic/claude-haiku-4-5`, delivery: `announce`. ``` ### Technical Analysis The documented setup establishes two cross-session execution mechanisms: 1. A macOS LaunchAgent starts the Node.js reader when the user logs in. 2. `KeepAlive` causes launchd to restart the process after it terminates. 3. A daily OpenClaw cron agent invokes the Gmail retrieval and body-fetching scripts. 4. The persistent service configuration receives paths associated with Gmail OAuth credentials. The behavior is disclosed and supports automatic digest delivery, rather than being hidden. However, persistence is not required for the core functionality because the reader and ...[truncated 1322 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Make manual execution the default installation mode. - Do not create or load a LaunchAgent without separate, explicit user consent. - Avoid `KeepAlive`; if automatic startup is needed, use a narrowly scoped scheduled invocation. - Provide complete removal instructions: ```bash launchctl unload ~/Library/LaunchAgents/ai.openclaw.briefed.plist rm ~/Library/LaunchAgents/ai.openclaw.briefed.plist ``` - Provide corresponding instructions for listing, disabling, and deleting the OpenClaw cron task. - Do not place credential values in service files. Pass only a protected token path when strictly necessary. - Ensure the referenced workspace and scripts are owned by the user and are not writable by other accounts. - Clearly state the execution frequency, files accessed, network services contacted, and credential scope before enabling persistence. ]]>
