T06 · System Persistence
- Location
scripts/create-rescue-instance.sh:48- Finding
Mandatory Persistent LaunchAgent Registration
- Content
View full analysis
RunAtLoad KeepAlive ThrottleInterval 1 ``` ```bash # 4. 加载并启动服务 launchctl load "$PLIST_FILE" echo "✓ 服务已加载" ``` ### Technical Analysis The script creates and loads a macOS LaunchAgent for every rescue instance. `RunAtLoad` causes the gateway to start whenever the user session loads, while `KeepAlive` causes `launchd` to restart it whenever it exits. The registration therefore survives completion of the Skill invocation and establishes a continuously running background process. LaunchAgent integration is disclosed as a feature in `SKILL.md`, so the behavior is not hidden. However, persistence is mandatory: the script provides no non-persistent mode, consent prompt, expiration mechanism, or separate opt-in switch. Merely creating or temporarily starting a rescue gateway does not inherently require cross-session autostart or continuous automatic restart. The service runs with the privileges of the invoking user and uses a copied OpenClaw configuration. It can therefore retain access to user-level files and any credentials present in that configuration for substantially longer than the initiating task. ### Attack Path 1. A user or agent invokes `create-rescue-instance.sh`. 2. The script writes a plist into `~/Library/LaunchAgents/`. 3. The plist enables both `RunAtLoad` and `KeepAlive`. 4. `launchctl load` immediately registers and starts the service. 5. The gateway remains registered after the Skill invocation finishes. 6. The gateway starts during later login sessions and is restarted after termination until explicitly removed. ### Impact Assessment The persistent process obtains the same user-level privileges as the invoking account. It may c ...[truncated 532 chars]- Remediation
View remediation
