T06 · System Persistence
- Location
scripts/install.sh:20- Finding
Unconditional Login Persistence Through a KeepAlive LaunchAgent
- Content
View full analysis
"$PLIST" << EOF Labelai.openclaw.desktop-pet ProgramArguments $APP_DEST/node_modules/.bin/electron $APP_DEST WorkingDirectory$APP_DEST RunAtLoad KeepAlive StandardOutPath/tmp/desktop-pet.log StandardErrorPath/tmp/desktop-pet.log EnvironmentVariables PATH/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin EOF # Load it launchctl unload "$PLIST" 2>/dev/null || true launchctl load "$PLIST" ``` ### Technical Analysis The installer always creates and loads a user LaunchAgent. `RunAtLoad` starts the Electron application when the user logs in, while `KeepAlive` directs macOS to restart it after termination. Auto-launch is documented in `SKILL.md`, and `scripts/uninstall.sh` removes the LaunchAgent. Therefore, the mechanism is not hidden and is related to an always-available desktop companion. Nevertheless, persistence is not necessary for the pet's core functionality, which can run directly through Electron. Enabling it unconditionally during installation exceeds minimum privilege and lifecycle requirements. The use of `KeepAlive` is particularly intrusive: selecting “Quit” in the application's context menu may not produce a durable shutdown because the service manager can restart the process. ### Attack Path 1. The user runs `scripts/install.sh`. 2. Th ...[truncated 951 chars]- Remediation
View remediation
