CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-27734

Docker API Path Traversal in Beszel Agent via Unsanitized Input

Amit Schendel
Amit Schendel
Senior Security Researcher

Feb 27, 2026·5 min read·126 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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.

Vulnerable Implementation

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)
    // ...
}

Patched Implementation (Commit 311095c)

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)
    // ...
}

Exploitation Methodology

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:

  • Network access to the Beszel Hub.
  • Valid credentials (JWT) for a user account.
  • The system ID of a target agent (visible in the URL when viewing a system in the dashboard).

Attack Steps:

  1. Authenticate: The attacker logs into the Beszel Hub and obtains a Bearer token.
  2. Target Selection: The attacker navigates to the dashboard to find the internal ID of a monitored system (e.g., 1).
  3. Payload Construction: The attacker crafts a GET request to the proxy endpoint. Instead of a valid container ID, they inject a traversal payload targeting the Docker Engine 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.

Impact Assessment

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.

  • Confidentiality (High): Attackers can query endpoints like /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.
  • Integrity (None): The vulnerability affects 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.
  • Availability (None): The vulnerability does not inherently allow for denial of service.

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.

Official Patches

BeszelCommit fixing path traversal via regex validation

Fix Analysis (1)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

Affected Systems

Beszel Agent < 0.18.4Beszel Hub < 0.18.4

Affected Versions Detail

Product
Affected Versions
Fixed Version
Beszel
HenryGD
< 0.18.40.18.4
AttributeDetail
CWE IDCWE-22
Attack VectorNetwork
CVSS6.5 (Medium)
ImpactInformation Disclosure
ProtocolHTTP over Unix Socket
Exploit StatusProof of Concept Available

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

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.

Known Exploits & Detection

GitHub AdvisoryOfficial advisory containing reproduction steps

Vulnerability Timeline

Fix commit 311095c pushed
2026-02-18
Public Disclosure (GHSA)
2026-02-27
CVE-2026-27734 Published
2026-02-27

References & Sources

  • [1]GHSA-phwh-4f42-gwf3
  • [2]NVD - CVE-2026-27734

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

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.

Alon Barad
Alon Barad
11 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

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.

Alon Barad
Alon Barad
16 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

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.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

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.

Amit Schendel
Amit Schendel
16 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

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.

Alon Barad
Alon Barad
19 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

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.

Amit Schendel
Amit Schendel
8 views•9 min read