This allows an authenticated user to mount any host path into a container, including:
/etc/shadow — credential theft
/var/run/docker.sock — full Docker control (container escape)
/ — full host filesystem access
Suggested Fix
At minimum:
Validate host paths against an allowlist or a restricted base directory (e.g., must be under /data/upaas/volumes/)
Reject paths containing .. components
Reject known sensitive paths (/var/run/docker.sock, /etc, /proc, etc.)
Consider removing the host path feature entirely and using Docker named volumes instead
## Bug
**File:** `internal/handlers/app.go`, `HandleVolumeAdd()`
**Severity:** HIGH — Security / Container escape
### Description
The `HandleVolumeAdd` handler accepts a `host_path` form value and stores it directly without any validation:
```go
hostPath := request.FormValue("host_path")
// ...
volume.HostPath = hostPath
```
This allows an authenticated user to mount any host path into a container, including:
- `/etc/shadow` — credential theft
- `/var/run/docker.sock` — full Docker control (container escape)
- `/` — full host filesystem access
### Suggested Fix
At minimum:
1. Validate host paths against an allowlist or a restricted base directory (e.g., must be under `/data/upaas/volumes/`)
2. Reject paths containing `..` components
3. Reject known sensitive paths (`/var/run/docker.sock`, `/etc`, `/proc`, etc.)
4. Consider removing the host path feature entirely and using Docker named volumes instead
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.
Bug
File:
internal/handlers/app.go,HandleVolumeAdd()Severity: HIGH — Security / Container escape
Description
The
HandleVolumeAddhandler accepts ahost_pathform value and stores it directly without any validation:This allows an authenticated user to mount any host path into a container, including:
/etc/shadow— credential theft/var/run/docker.sock— full Docker control (container escape)/— full host filesystem accessSuggested Fix
At minimum:
/data/upaas/volumes/)..components/var/run/docker.sock,/etc,/proc, etc.)this isn't a bug - this is by design. any admin of upaas is expected to have root on the system on which it's running.