T06 · System Persistence
- Location
SKILL.md:135- Finding
Persistent Independently Managed Rescue Gateway Service
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 135-163
Vulnerability Type: Persistent startup service
Risk Level: HighVulnerable Code
text ~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plistbash launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.rescue.plist launchctl enable gui/$(id -u)/ai.openclaw.gateway.rescue launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway.rescueThe service is assigned the independent label:
text ai.openclaw.gateway.rescueIts startup arguments and environment are instructed to include:
text --profile rescue gateway --port 19001 OPENCLAW_PROFILE=rescue OPENCLAW_STATE_DIR=~/.openclaw-rescue OPENCLAW_CONFIG_PATH=~/.openclaw-rescue/openclaw.json OPENCLAW_LAUNCHD_LABEL=ai.openclaw.gateway.rescueTechnical Analysis
The Skill instructs the user to create, register, enable, and start a macOS LaunchAgent for a Discord-connected OpenClaw gateway. A LaunchAgent is a cross-session persistence mechanism. The custom label intentionally separates this service from the primary gateway's lifecycle, allowing it to continue operating when the primary gateway is stopped.
Persistence is consistent with the stated rescue-gateway purpose, but it creates a durable remote agent entry point. The risk becomes especially severe when combined with the unrestricted execution and approval-bypass configuration elsewhere in the same file. The documentation also does not make restricted, on-demand execution the default.
Attack Path
- A user follows the Skill and creates the rescue LaunchAgent property list.
- The user registers and enables it through
launchctl bootstrapandlaunchctl enable. - The rescue gateway starts under an independent service label and remains outside the normal primary-gateway stop lifecycle.
- An attacker compromises an authorized Discord identity, rescue bot token, ...[truncated 755 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not register or enable the rescue gateway as a persistent LaunchAgent by default.
- Prefer an explicitly invoked, on-demand emergency service that stops automatically after a short timeout.
- If persistence is operationally required, document that it is a security-sensitive deployment decision and require explicit administrator confirmation.
- Run the gateway under a dedicated, non-administrative account with a restricted home directory and minimal filesystem permissions.
- Apply network and channel access controls, including strict Discord user or role allowlists and independently generated gateway credentials.
- Add monitoring for service registration, startup, authentication events, tool execution, configuration changes, and unexpected restarts.
- Provide complete disablement and removal procedures using
launchctl bootout, deletion of the property list, and revocation of associated tokens. - Combine any persistent deployment with the least-privilege execution controls described in the remediation for the unrestricted-execution finding.
