T06 · System Persistence
- Location
SKILL.md:61- Finding
Persistent background service configured to survive user logout
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 61-88
Vulnerability Type: Cross-session service persistence
Risk Level: HighVulnerable Code
ini # ~/.config/systemd/user/bot-status.service [Unit] Description=Bot Status API After=network.target [Service] Type=simple WorkingDirectory=/path/to/bot-status ExecStart=/usr/bin/node server.js Restart=always RestartSec=5 Environment=PORT=3200 Environment=HOME=/home/youruser Environment=PATH=/usr/local/bin:/usr/bin:/bin [Install] WantedBy=default.targetbash systemctl --user daemon-reload systemctl --user enable --now bot-status loginctl enable-linger $USER # survive logoutTechnical Analysis
The setup instructs users to install and enable a systemd user service with
Restart=always. It also enables user lingering throughloginctl enable-linger, explicitly allowing the service to continue running after the user logs out.A persistent service may be appropriate for an intentionally deployed monitoring server, but this configuration exceeds the privileges required merely to run or evaluate the Skill. It creates a long-lived execution mechanism without presenting persistence as a separate, security-sensitive opt-in. The service will repeatedly execute
server.jsfrom a writable deployment directory. If that file or directory is subsequently compromised, attacker-controlled code can execute persistently under the affected user's account.The package does not include the referenced
server.js, collectors, or package manifest, so the behavior of the program installed through this persistent mechanism cannot be independently verified from the audited artifact.Attack Path
- A user follows the documented installation procedure.
- The user service is enabled and immediately started with
systemctl --user enable --now. - User lingering is enabled, allowing the service to run without an active logi ...[truncated 1055 chars]
- Remediation
View remediation
Remediation Suggestions
- Make foreground execution the default and document persistence as a separate, explicit opt-in.
- Do not enable user lingering by default. Require administrators to assess whether operation after logout is genuinely necessary.
- Replace
Restart=alwayswith a more restrictive policy such asRestart=on-failure, with rate limits configured throughStartLimitIntervalSecandStartLimitBurst. - Protect the service directory and executable files from unauthorized modification. The service account should own only the files it needs and should not use a broadly writable working directory.
- Run the service under a dedicated, minimally privileged account with no interactive login and narrowly scoped access to OpenClaw data.
- Add systemd hardening directives where compatible, including
NoNewPrivileges=true,PrivateTmp=true,ProtectSystem=strict,ProtectHome=true, and narrowly scopedReadOnlyPathsorReadWritePaths. - Provide complete removal instructions covering service shutdown, disabling the unit, removal of the unit file, daemon reload, and disabling lingering when it is no longer required.
- Include the referenced implementation files in the audited package so the executable installed through the persistence mechanism can be reviewed.
