T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/setup.sh:64- Finding
Root-Persistent Service Executes User-Controlled Skill Code
- Content
View full analysis
"$UNIT_DIR/$SERVICE_NAME.service" systemctl --user daemon-reload systemctl --user enable "$SERVICE_NAME" else UNIT_DIR="/etc/systemd/system" UNIT_FILE="$UNIT_DIR/$SERVICE_NAME.service" if [ -w "$UNIT_DIR" ] || [ "$(id -u)" -eq 0 ]; then echo "$UNIT" > "$UNIT_FILE" systemctl daemon-reload systemctl enable "$SERVICE_NAME" ``` ### Technical Analysis The system-wide unit does not specify `User=` or `Group=`, so systemd runs it as root. Its `ExecStart` points directly to `exit-manager.py` inside the original Skill directory, which is commonly located beneath the invoking user's home directory and may remain writable by that user. The installer therefore crosses two unnecessary privilege boundaries: 1. It establishes cross-session persistence by enabling a system service. 2. It causes code from a potentially user-writable directory to execute as root. The daemon only requires outbound network access and access to user-owned trading state. Root privileges are not necessary for its declared position-monitoring function. Although persistence is disclosed in the documentation, the unsafe privilege model creates a local privilege-escalation path. ### Attack Path 1. A victim runs `sudo ./scripts/setup.sh`. 2. The installer creates and enables `/etc/systemd/system/tradr-exit-manager.s ...[truncated 778 chars]- Remediation
View remediation
