HIGH: Arbitrary host path mount via volume add — no path validation #20

Closed
opened 2026-02-16 05:47:10 +01:00 by clawbot · 1 comment
Collaborator

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:

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
## 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
Owner

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.

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.
sneak closed this issue 2026-02-16 05:48:18 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
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: sneak/upaas#20
No description provided.