Feb 27, 2026·5 min read·126 visits
Beszel agents prior to v0.18.4 fail to sanitize container IDs before passing them to the Docker socket. Authenticated users can use '../' sequences to traverse the Docker API and access unauthorized system information.
A path traversal vulnerability exists in the Beszel server monitoring agent, allowing authenticated users to access arbitrary Docker Engine API endpoints. The vulnerability arises from improper sanitization of the 'container' query parameter when constructing requests to the Docker Unix socket. By injecting directory traversal sequences, an attacker with minimum privileges (including Read-Only) can escape the intended container scope and query sensitive host-level information, such as the Docker version, system info, or details of other containers running on the host.
Beszel is a lightweight server monitoring platform consisting of a central Hub and agents deployed on monitored systems. The agent gathers metrics, including Docker container statistics, by communicating with the local Docker engine via a Unix Domain Socket (UDS). To provide container-specific logs and information, the Hub proxies requests to the agent, which then queries the Docker API.
In versions prior to 0.18.4, the Beszel Agent contains a Path Traversal vulnerability (CWE-22). The agent accepts a container identifier from the Hub without sufficient validation. This identifier is used to construct the URL path for requests sent to the Docker daemon. Because the agent does not sanitize this input or strictly enforce an allowlist of valid container ID formats, an attacker can supply directory traversal sequences (../).
This flaw allows an authenticated user to break out of the intended API path (typically /containers/<id>/...) and access the root of the Docker Engine API. Consequently, an attacker can retrieve sensitive information about the host's Docker configuration and other running workloads, bypassing the intended restrictions of the Beszel interface.
The vulnerability is caused by the insecure concatenation of user-supplied input into a path used for a Unix socket connection, combined with specific behaviors of the Go HTTP client.
1. Unsafe String Interpolation:
The Beszel agent constructs the request URL for the Docker socket using fmt.Sprintf. The code takes the container string directly from the incoming request query parameters and injects it into a format string like /containers/%s/json. No prior validation checks if the input is a valid hexadecimal container ID or if it contains control characters.
2. Unix Socket Path Behavior:
When communicating over HTTP/TCP, many libraries and proxies automatically normalize paths, resolving ../ sequences before the request leaves the client. However, when using Go's http.Client to communicate over a Unix Domain Socket (via the http+unix scheme or similar custom transport), path normalization is often less aggressive or non-existent for the path component sent to the socket. The raw path containing ../ is transmitted to the Docker daemon.
3. Docker Daemon Resolution:
The Docker daemon receives the request path (e.g., /containers/../../version). The internal router of the Docker engine resolves the traversal, treating the request as a query for /version. This effectively bypasses the application logic that intended to restrict the user to specific container operations.
The following analysis highlights the vulnerable logic and the remediation applied in version 0.18.4. The fix introduces strict input validation and proper URL encoding.
In the vulnerable version, the agent accepted the container parameter and used it directly. The lack of url.PathEscape allowed special characters to pass through to the socket request.
// Vulnerable Code Pattern (Conceptual)
func getContainerLogs(w http.ResponseWriter, r *http.Request) {
containerID := r.URL.Query().Get("container")
// FLAW: Direct interpolation of user input into the path
targetPath := fmt.Sprintf("/containers/%s/logs", containerID)
// The client sends this path raw to the Unix socket
resp, err := dockerClient.Get("http://unix" + targetPath)
// ...
}The patch introduces two layers of defense: regex validation to ensure the ID is a hex string, and URL escaping as a fallback safety measure.
// Fixed Code Pattern
import (
"net/url"
"regexp"
)
// 1. Strict Validation: Enforce 12-64 char hex string
var containerIDPattern = regexp.MustCompile(`^[a-fA-F0-9]{12,64}$`)
func getContainerLogs(w http.ResponseWriter, r *http.Request) {
containerID := r.URL.Query().Get("container")
// 2. Reject invalid formats immediately
if !containerIDPattern.MatchString(containerID) {
http.Error(w, "Invalid container ID", http.StatusBadRequest)
return
}
// 3. Encode the path component (Defense in Depth)
// Even if the regex failed, this would convert "../" to "%2E%2E%2F"
targetPath := fmt.Sprintf("/containers/%s/logs", url.PathEscape(containerID))
resp, err := dockerClient.Get("http://unix" + targetPath)
// ...
}An attacker can exploit this vulnerability to enumerate the host system's Docker environment. Access to the Beszel Hub is required, but the account can have minimal privileges (e.g., a read-only user).
Prerequisites:
system ID of a target agent (visible in the URL when viewing a system in the dashboard).Attack Steps:
1).version endpoint.Proof of Concept:
GET /api/beszel/containers/info?system=1&container=../../version HTTP/1.1
Host: beszel.internal
Authorization: Bearer <JWT_TOKEN>Result:
The server responds with the JSON output from the Docker Engine's /version endpoint, disclosing the Go version, kernel version, and build details. By changing the payload to ../../info or ../../containers/json, the attacker can list all running containers or inspect swarm details.
The successful exploitation of CVE-2026-27734 results in unauthorized Information Disclosure. While the attack is authenticated, the ability for a low-privilege user to access the underlying infrastructure API represents a significant privilege escalation within the context of the application.
/info, /version, /images/json, and /containers/json. This exposes the internal architecture, list of running services, image names, and potential environment variables if /containers/<id>/json is targeted for arbitrary containers.GET requests (logs/info endpoints). There is no documented path to issue POST or DELETE commands via this specific vector, limiting the ability to modify state.CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N (6.5 Medium). The scope is Unchanged (S:U) because the vulnerable component (Beszel Agent) and the impacted component (Docker Engine) are on the same local system boundary, although the data accessed belongs to the infrastructure layer.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Beszel HenryGD | < 0.18.4 | 0.18.4 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network |
| CVSS | 6.5 (Medium) |
| Impact | Information Disclosure |
| Protocol | HTTP over Unix Socket |
| Exploit Status | Proof of Concept Available |
The software 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 software 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.
NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.
CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.
CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.
CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.
A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.
CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.