When adding a volume mount, the host_path form value is accepted without any validation or sanitization. An authenticated user can specify any host path (e.g., /etc/shadow, /var/run/docker.sock, /) and it will be bind-mounted into the container.
While this is a single-user system and the user is already an admin, this is still a defense-in-depth concern:
If the session is hijacked, the attacker gets arbitrary filesystem access via container mounts
There's no allowlist or denylist of paths
No warning to the user about dangerous mounts
Suggested Fix
Add a configurable allowed_volume_prefix (e.g., /data/) that restricts host paths
At minimum, reject paths like /etc, /var/run/docker.sock, /proc, /sys
Validate that paths are absolute and normalized (no .. traversal)
## Severity: HIGH
## File: `internal/handlers/app.go` lines 525-545 (HandleVolumeAdd)
## Description
When adding a volume mount, the `host_path` form value is accepted without any validation or sanitization. An authenticated user can specify any host path (e.g., `/etc/shadow`, `/var/run/docker.sock`, `/`) and it will be bind-mounted into the container.
While this is a single-user system and the user is already an admin, this is still a defense-in-depth concern:
- If the session is hijacked, the attacker gets arbitrary filesystem access via container mounts
- There's no allowlist or denylist of paths
- No warning to the user about dangerous mounts
## Suggested Fix
1. Add a configurable `allowed_volume_prefix` (e.g., `/data/`) that restricts host paths
2. At minimum, reject paths like `/etc`, `/var/run/docker.sock`, `/proc`, `/sys`
3. Validate that paths are absolute and normalized (no `..` traversal)
```go
func isAllowedHostPath(path string) bool {
cleaned := filepath.Clean(path)
if cleaned != path {
return false // path contains .., //, etc.
}
blocked := []string{"/etc", "/proc", "/sys", "/dev", "/var/run/docker.sock"}
for _, b := range blocked {
if strings.HasPrefix(cleaned, b) {
return false
}
}
return true
}
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: HIGH
File:
internal/handlers/app.golines 525-545 (HandleVolumeAdd)Description
When adding a volume mount, the
host_pathform value is accepted without any validation or sanitization. An authenticated user can specify any host path (e.g.,/etc/shadow,/var/run/docker.sock,/) and it will be bind-mounted into the container.While this is a single-user system and the user is already an admin, this is still a defense-in-depth concern:
Suggested Fix
allowed_volume_prefix(e.g.,/data/) that restricts host paths/etc,/var/run/docker.sock,/proc,/sys..traversal)dupe #20