T06 · System Persistence
Error
- Location
- SKILL.md:14
- Finding
- Persistent Root-Level System Service<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 14, 20, 30–35, and 104–110 **Vulnerability Type**: Persistent privileged service installation **Risk Level**: High ### Evidence English translation of the relevant instructions: ```text 5. System service – Runs in the background, starts automatically at boot, and restarts automatically after a crash. Permission: Root privileges are required to install the system service. - Create working directories (/opt/lobster-agent and /var/log/lobster-agent) - Create the agent's main program - Create a management command (/usr/local/bin/lobster) - Create and start a systemd service ``` The documented service status also shows: ```text Loaded: loaded (/etc/systemd/system/lobster-agent.service; enabled; vendor preset: enabled) Active: active (running) └─12345 /usr/bin/python3 /opt/lobster-agent/main.py ``` ### Technical Analysis The Skill directs the installer to create and enable a systemd service, place executable agent code under `/opt/lobster-agent`, and create a system-wide command under `/usr/local/bin`. The service is intended to survive reboots and restart automatically after failure. This behavior creates cross-session persistence. It is particularly sensitive because installation requires root privileges, while the package does not include the generated agent program or systemd unit for review. Although persistence is consistent with the stated monitoring purpose and is disclosed to the user, compromise or unsafe generation of the installed files would result in durable privileged execution. ### Attack Path 1. A user or agent invokes the documented automatic installation with root privileges. 2. The installation process generates an unreviewed program under `/opt/lobster-agent`. 3. It creates a systemd unit under `/etc/systemd/system`. 4. The unit is enabled and started. 5. The generated code runs continuously and starts again after reboot. 6. If the generated program, its dependencies ...[truncated 529 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Include the complete installer, agent source, management command, and systemd unit in the package so they can be audited. - Require explicit user confirmation before creating or enabling a persistent service. - Run the service as a dedicated, unprivileged account rather than root. - Apply systemd hardening directives such as `NoNewPrivileges=true`, `ProtectSystem=strict`, `ProtectHome=true`, `PrivateTmp=true`, and a restricted `CapabilityBoundingSet`. - Make runtime code and service definitions root-owned and non-writable by the service account. - Limit writable paths to a dedicated state or log directory. - Present all planned filesystem and service changes before installation. - Provide a complete uninstall procedure that removes the service, executable, configuration, and residual state. ]]>
