T06 · System Persistence
- Location
SKILL.md:96- Finding
Privileged System-Wide Persistence Through a Systemd Service
- Content
View full analysis
/tmp/vitavault-webhook.service << 'EOF' [Unit] Description=VitaVault Webhook Receiver After=network.target [Service] Type=simple User=$USER Environment=VITAVAULT_SYNC_TOKEN= ExecStart=/usr/bin/python3 /path/to/skills/vitavault/scripts/webhook.py --host 127.0.0.1 --port 8787 Restart=on-failure RestartSec=5 [Install] WantedBy=multi-user.target EOF # Adjust paths and token, then: sudo cp /tmp/vitavault-webhook.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now vitavault-webhook ``` ### Technical Analysis The setup instructions direct the Agent to use `sudo` to copy a service definition into `/etc/systemd/system/` and enable it at boot. This creates cross-session, reboot-persistent execution of the Python script. Continuous webhook operation is relevant to automatic health synchronization, but a root-authorized, system-wide service is not the minimum privilege necessary. An on-demand process or per-user service could provide the same functionality without modifying global startup configuration. The configured executable is also a Python script under a potentially mutable Skill installation path. If that script is replaced after service installation, the replacement code will run automatically under the configured service account. The service definition provides no meaningful systemd sandboxing or write restrictions. ### Attack Path 1. A user asks the Agent to configure VitaVault synchronization. 2. The Agent creates the service definition in `/tmp`. 3. The Agent uses `sudo` to install it into the system-wide systemd directory. 4. The service is enabled and starts automatically after subsequent reboots. 5. If the configured script path ...[truncated 585 chars]- Remediation
View remediation
