Validate and sanitize all config-sourced paths #2

Closed
opened 2026-02-02 10:00:56 +01:00 by qwc · 0 comments
Owner

Phase 1: Security Hardening

Device UUID, device Name, SourcePath, TargetPath, ScriptPath are used in exec.Command and path.Join without sanitization.

Tasks

  • Apply filepath.Clean + filepath.Abs, reject path traversal (..), reject symlinks for script paths
  • Validate script files exist, are regular files, and have safe permissions before execution

Files

  • backup.go
  • device.go
  • config.go
## Phase 1: Security Hardening Device UUID, device Name, SourcePath, TargetPath, ScriptPath are used in `exec.Command` and `path.Join` without sanitization. ### Tasks - Apply `filepath.Clean` + `filepath.Abs`, reject path traversal (`..`), reject symlinks for script paths - Validate script files exist, are regular files, and have safe permissions before execution ### Files - `backup.go` - `device.go` - `config.go`
qwc closed this issue 2026-02-02 14:09:19 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
qwc-open/backive#2
No description provided.