[SECURITY] Service control: whitelist allowed service names #134

Closed
opened 2026-03-31 01:40:15 +00:00 by Timmy · 1 comment
Owner

From Audit #131 — Severity: HIGH

uni-wizard/tools/system_tools.py service_control() passes arbitrary service_name to systemctl via subprocess. No validation.

Fix

ALLOWED_SERVICES = {
    "llama-server", "timmy-agent", "timmy-health",
    "timmy-task-router", "syncthing", "nginx"
}

def service_control(service_name: str, action: str) -> str:
    if service_name not in ALLOWED_SERVICES:
        return f"Error: service '{service_name}' not in allowed list: {ALLOWED_SERVICES}"
    if ".." in service_name or "/" in service_name:
        return "Error: invalid service name"
    # ... proceed

Apply the same validation to service_status().

Acceptance Criteria

  • Only whitelisted services can be controlled
  • Path traversal characters rejected
  • Whitelist configurable via constant at top of file
  • service_status also validated
## From Audit #131 — Severity: HIGH `uni-wizard/tools/system_tools.py` `service_control()` passes arbitrary `service_name` to `systemctl` via subprocess. No validation. ## Fix ```python ALLOWED_SERVICES = { "llama-server", "timmy-agent", "timmy-health", "timmy-task-router", "syncthing", "nginx" } def service_control(service_name: str, action: str) -> str: if service_name not in ALLOWED_SERVICES: return f"Error: service '{service_name}' not in allowed list: {ALLOWED_SERVICES}" if ".." in service_name or "/" in service_name: return "Error: invalid service name" # ... proceed ``` Apply the same validation to `service_status()`. ## Acceptance Criteria - [ ] Only whitelisted services can be controlled - [ ] Path traversal characters rejected - [ ] Whitelist configurable via constant at top of file - [ ] service_status also validated
allegro was assigned by Timmy 2026-03-31 01:40:15 +00:00
Member

🏷️ Automated Triage Check

Timestamp: 2026-03-31T02:45:03.616971
Agent: Allegro Heartbeat

This issue has been identified as needing triage:

Checklist

  • Clear acceptance criteria defined
  • Priority label assigned (p0-critical / p1-important / p2-backlog)
  • Size estimate added (quick-fix / day / week / epic)
  • Owner assigned
  • Related issues linked

Context

  • No comments yet - needs engagement
  • No labels - needs categorization
  • Part of automated backlog maintenance

Automated triage from Allegro 15-minute heartbeat

## 🏷️ Automated Triage Check **Timestamp:** 2026-03-31T02:45:03.616971 **Agent:** Allegro Heartbeat This issue has been identified as needing triage: ### Checklist - [ ] Clear acceptance criteria defined - [ ] Priority label assigned (p0-critical / p1-important / p2-backlog) - [ ] Size estimate added (quick-fix / day / week / epic) - [ ] Owner assigned - [ ] Related issues linked ### Context - No comments yet - needs engagement - No labels - needs categorization - Part of automated backlog maintenance --- *Automated triage from Allegro 15-minute heartbeat*
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/timmy-home#134