Sep 25, 2026·7 min read·24 visits
Unauthenticated remote SQL execution on local DBHub database servers via client-side DNS rebinding.
A critical DNS rebinding vulnerability in DBHub (associated with GHSA-fm8p-53ww-hf6w) allows unauthenticated remote attackers to execute arbitrary SQL queries against local and internal databases. By exploiting a relative origin validation check within the HTTP transport middleware, an attacker can bypass same-origin protections via DNS rebinding. This allows malicious external websites to send JSON-RPC commands to the local DBHub service to read, write, and exfiltrate database contents. The issue affects all versions of DBHub prior to 0.22.5.
DBHub operates as a Model Context Protocol (MCP) server designed to interface artificial intelligence models and external clients with relational databases including PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite. When initialized in the documented HTTP transport mode, DBHub exposes an unauthenticated HTTP service listening on a configured port (such as 8080). This architecture opens up a critical attack surface, as any local or network client can dispatch commands to the /mcp endpoint without verifying credentials.\n\nTo defend against malicious cross-origin interactions in web browsers, the developers implemented a security middleware intended to enforce Same-Origin policies. This middleware verifies whether the HTTP request's Origin header matches the Host header. The core design assumption was that mismatched headers would block unauthorized cross-origin requests originating from external malicious websites.\n\nHowever, this defense mechanism relies on relative comparisons of client-controlled headers rather than absolute host validation. Because the browser sets the Host and Origin headers based on the current domain it believes it is interacting with, a DNS rebinding attack can completely circumvent this verification step. The vulnerability, tracked as CVE-2026-61742, allows unauthenticated remote attackers to execute arbitrary SQL commands against databases connected to the DBHub server.
The root cause of CVE-2026-61742 resides in the origin-to-host relative validation logic within src/server.ts. When a standard browser makes a cross-origin request to a different domain, the browser enforces the Same-Origin Policy (SOP). If a script on http://malicious.com attempts to query http://localhost:8080, the browser automatically sets the Host header to localhost:8080 and the Origin header to http://malicious.com. The server's relative validation detects the mismatch and correctly issues an HTTP 403 Forbidden response.\n\nIn a DNS rebinding scenario, the attacker circumvents this browser mechanism by controlling both the DNS resolution of a domain and the serving infrastructure. The attacker registers a domain, such as rebind.attacker.com, with a low Time-To-Live (TTL) value. When the victim visits the attacker's site, the domain initially resolves to the attacker's malicious web server, which loads a script into the victim's browser context.\n\nOnce the script is running, the attacker's DNS server changes the A record for rebind.attacker.com to point to the loopback address 127.0.0.1. The script then initiates an HTTP POST request to http://rebind.attacker.com:8080/mcp. Because the browser associates the request with the origin http://rebind.attacker.com:8080, it sets both the Host header to rebind.attacker.com:8080 and the Origin header to http://rebind.attacker.com. When the request arrives at the local DBHub server, the middleware checks if rebind.attacker.com matches rebind.attacker.com. Because they are identical, the validation passes, allowing access to the MCP endpoint.\n\nmermaid\ngraph LR\n A["Attacker Site"] -->|"1. Load malicious JS"| B["Victim Browser"]\n A -.->|"2. Rebind DNS to 127.0.0.1"| C["DNS Server"]\n B -->|"3. POST /mcp (Host/Origin: rebind.com)"| D["Local DBHub (127.0.0.1)"]\n D -->|"4. Execute arbitrary SQL"| E["Target Database"]\n
An investigation of the vulnerable codebase in DBHub version 0.21.2 reveals how the validation check was structured in src/server.ts. The implementation extracted the Origin and Host headers and compared them directly after dropping port information. If they matched, the server dynamically reflected the untrusted origin back into the response's Access-Control-Allow-Origin and enabled Access-Control-Allow-Credentials. This dynamic reflection allowed the attacker's client-side script to read the response payload, facilitating data exfiltration.\n\ntypescript\n// Vulnerable logic in src/server.ts (v0.21.2)\nconst origin = req.headers.origin;\nif (origin) {\n const host = (req.headers.host ?? '').split(':')[0].toLowerCase();\n try {\n const originHost = new URL(origin).hostname.toLowerCase();\n if (originHost !== host) {\n return res.status(403).json({\n error: 'Forbidden',\n message: 'Origin does not match Host header (DNS rebinding protection)',\n });\n }\n } catch {\n return res.status(400).json({ error: 'Bad Request', message: 'Malformed Origin header' });\n }\n}\n\nres.header('Access-Control-Allow-Origin', origin || 'http://localhost');\nres.header('Access-Control-Allow-Credentials', 'true');\n\n\nThe patch implemented in version 0.22.5 (commit 5bf5c3242a22e94871dfdf53913c84a5025b7381) completely restructures this validation. Instead of comparing two client-supplied strings for relative equality, the updated code maintains a strict allowlist of authorized hostnames. The server now validates both the Host header and the Origin header against an absolute set of allowed hosts (allowedHosts), which defaults to loopback addresses like localhost and 127.0.0.1 unless explicitly overridden using --allowed-hosts. This ensures that an arbitrary external domain name, even if consistent across both headers, will be rejected immediately.\n\nThis patch is complete as it eliminates the reliance on relative comparisons and moves to an explicit allowlist design. Even if an attacker successfully rebinds a domain name to 127.0.0.1, the server will reject the incoming request because the Host header will contain the rebound domain name, which is not present in the default loopback allowlist.
Exploitation of CVE-2026-61742 requires three core prerequisites: the DBHub instance must be running in HTTP transport mode, the attacker must have a vector to execute JavaScript in the victim's browser (such as a malicious webpage or compromised ad), and the victim's browser must be able to reach the DBHub service on the local network or loopback interface. No prior authentication, API keys, or active sessions are needed to interact with the target /mcp endpoint.\n\nWhen the victim visits the malicious site, the script executes a classic DNS rebinding sequence, waiting for the DNS cache of the browser or OS to expire so that the domain points to 127.0.0.1. Once the rebinding is successful, the script sends an HTTP POST request containing a standard JSON-RPC payload to /mcp. This request requests DBHub to list its connected databases or run arbitrary SQL commands.\n\nBecause DBHub's vulnerable middleware validates the match and returns the Access-Control-Allow-Origin header matching the rebound domain, the browser permits the script to read the database response. This allows the attacker to systematically exfiltrate database schemas, execute read queries to extract data, or run write queries to manipulate the database. The entire process occurs silently in the background without any visible indications to the user.
The security impact of CVE-2026-61742 is exceptionally high, as reflected by its CVSS v4.0 score of 9.3. An attacker who successfully exploits this vulnerability gains full, unauthenticated control over any database connected to the compromised DBHub server. This includes the ability to execute arbitrary SQL statements under the privileges of the configured database user, allowing for read, write, and administrative actions.\n\nIn development environments, DBHub is frequently configured with elevated database privileges to allow developers to run migrations and view system schemas. Exploitation under these circumstances can lead to the deletion of tables, modification of critical application records, or the exfiltration of sensitive production data mirrors. Additionally, if the database engine supports functions that interact with the host system (such as PostgreSQL's PROGRAM COPY command or SQLite's loadable extensions), this vulnerability could be chained to achieve arbitrary remote code execution (RCE) on the developer's workstation.\n\nFurthermore, because DBHub acts as an MCP server, compromise of this service breaks the integrity of AI-assisted development systems. Malicious actors could inject manipulated database schemas or poisoned data into the context window of local LLMs, potentially leading to the generation of insecure code or backdoored database migrations.
Remediating CVE-2026-61742 requires upgrading the @bytebase/dbhub dependency to version 0.22.5 or later. The update implements robust host-header validation that enforces a default allowlist of loopback addresses, preventing rebinding attacks. If immediate upgrading is not feasible, operators must implement strict mitigation strategies to secure the endpoint.\n\nOne effective workaround is to restrict the DBHub service binding. Instead of binding to all interfaces (0.0.0.0), ensure the server binds strictly to the loopback interface (127.0.0.1). While this does not prevent local DNS rebinding from a browser on the same host, it reduces the network-level attack surface. Additionally, developers can configure local firewall rules to block unauthorized cross-origin requests or run DBHub inside a containerized environment with isolated network namespaces.\n\nFor enterprise deployments where DBHub must be accessed over a network, it should never be exposed directly to the internet in HTTP mode. Administrators should deploy a reverse proxy, such as Nginx or Caddy, to handle SSL termination and enforce strong access controls, including Basic Authentication, IP white-listing, or Client Certificate authentication (mTLS). The proxy should also explicitly validate the incoming Host header and discard any requests bearing unexpected hostnames.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@bytebase/dbhub Bytebase | < 0.22.5 | 0.22.5 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-346 |
| Attack Vector | Network |
| CVSS v4.0 Score | 9.3 |
| EPSS Score | N/A (Published 2026) |
| Impact | Unauthenticated arbitrary SQL Execution / Information Disclosure |
| Exploit Status | Proof-of-Concept |
| KEV Status | Not Listed |
The software does not properly control or validate the origin of a request, allowing attackers to bypass same-origin protections.
CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.
An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.
A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.
A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.
CVE-2026-12411 is a broken access control vulnerability in the DevLXD interface of Canonical LXD versions 6.6 through 6.8. The flaw resides in the devLXDInstancePatchHandler component, which fails to verify storage volume ownership when an instance attaches a new disk device via the /dev/lxd guest socket. When the security.devlxd.management.volumes configuration option is enabled, an untrusted guest or DevLXD identity can issue a crafted HTTP PATCH request referencing another tenant's custom storage volume. The LXD host daemon subsequently mounts the target volume into the requesting guest, permitting unauthorized cross-tenant read and write operations.
CVE-2026-105769 (GHSA-5q7h-w9jf-cx97, GO-2026-6225) is an origin validation error and credential exfiltration vulnerability affecting Kaniko prior to version 1.25.20. The flaw stems from an unanchored regular expression in the integrated Azure Container Registry (ACR) credential helper (github.com/chrismellard/docker-credential-acr-env). When Kaniko processes a Dockerfile containing an image reference hosted on a lookalike domain containing an ACR suffix as a substring (e.g., x.azurecr.io.attacker.com), the credential helper acquires a Microsoft Entra ID access token for Azure Resource Manager and transmits it via HTTP POST to the attacker-controlled host.