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-61788

CVE-2026-61788: Read-Only Bypass in DBHub Database Model Context Protocol Server

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 25, 2026·8 min read·2 visits

Executive Summary (TL;DR)

DBHub versions prior to 0.22.6 fail to enforce read-only execution constraints. Attackers can execute arbitrary SQL write operations, modify host files, and run commands by exploiting unauthenticated access to the default /mcp endpoint combined with parser-specific string bypasses.

CVE-2026-61788 identifies a critical vulnerability in DBHub, an open-source database Model Context Protocol (MCP) server designed to manage and interact with database engines including PostgreSQL, MySQL, SQL Server, Oracle, MariaDB, and SQLite. Prior to version 0.22.6, DBHub fails to securely enforce its declared 'readonly' execution mode. Unauthenticated remote attackers can bypass keyword-based filters and transaction controls to execute arbitrary write operations, manipulate database sequences, read or write files on the host operating system, and potentially execute arbitrary system commands.

Vulnerability Overview

DBHub operates as an open-source database Model Context Protocol (MCP) server that exposes database interaction capabilities to network clients. The application facilitates connections to multiple SQL backends, including PostgreSQL, MySQL, MariaDB, and SQLite. To prevent unauthorized data modification, DBHub implements an execute_sql interface exposing a parameter to enforce read-only query execution.

This application-level protection mechanism is bypassed in DBHub versions prior to 0.22.6. The vulnerability allows unauthenticated network actors to submit crafted database queries that circumvent local query validation filters. Consequently, requests labeled as read-only are processed as fully privileged, writable database commands.

The vulnerability is highly critical because DBHub's HTTP transport is unauthenticated by default. Furthermore, the daemon binds to the wildcard network interface (0.0.0.0), exposing the management endpoint to any system capable of routing traffic to the default host port. The combination of unauthorized API access and insecure execution control exposes the underlying databases and hosting infrastructure to complete compromise.

Root Cause Analysis

The vulnerability in DBHub stems from a dual-failure architecture that pairs inactive configuration code with a flawed, string-matching input classifier.

The first failure resides within the connection management component (src/connectors/manager.ts). The codebase contained logic intended to initialize underlying database connectors using read-only connection limits (e.g., activating default_transaction_read_only in PostgreSQL or opening SQLite databases in a read-only mode). However, the property flag config.readonly was mapped to a non-existent configuration key (source.readonly). Because of this logical error, the application consistently evaluated config.readonly as undefined, failing to ever enable connection-level or driver-level read-only protections.

The second failure involves the fallback application-level classifier, isReadOnlySQL. Because database-level write restrictions were inactive, the security of the application depended entirely on checking whether queries started with safety-associated keywords such as SELECT or WITH. Attackers can bypass this classifier through three key engine-specific discrepancies:

  1. PostgreSQL Side-Effects: PostgreSQL permits nested system function executions and schema mutations within a SELECT statement. Queries such as SELECT lo_export(1234, '/path/file') or SELECT setval(...) begin with the permitted SELECT keyword, allowing them to pass the classifier while executing write operations or modifying local system files.

  2. MySQL/MariaDB Comment-Parsing Discrepancies: Under MySQL and MariaDB rules, a double-dash (--) initiates a comment block only when followed by a whitespace character. If followed immediately by a non-whitespace character, the engine interprets it as dual subtraction operators (e.g., 1--1 translates to 1 - (-1)). DBHub's custom pre-parser stripped any query string starting with -- as a comment globally. By submitting a payload such as SELECT 1--1; DROP TABLE users;, the DBHub parser stripped the suffix, saw only SELECT 1, and passed the query. The backend database engine, however, evaluated SELECT 1--1 as the first statement, resolved the statement separator, and proceeded to execute the destructive DROP TABLE command.

  3. SQLite PRAGMA Parenthesized Setters: DBHub restricted PRAGMA state modifications by searching for an equal sign (=) in SQLite queries. SQLite allows an alternative parenthesized setter syntax where PRAGMA user_version(1337) behaves identically to PRAGMA user_version = 1337. This alternative syntax bypassed the regex detection, enabling attackers to alter SQLite session parameters.

Code-Level Analysis and Patch Breakdown

An analysis of the fix commit (872bb338f7d31f6afe517a076ac3e3edafaaaf08) shows a transition from application-side string matching to native, engine-enforced transaction controls. Below is a conceptual breakdown of the remediation changes implemented across different connectors.

In the PostgreSQL connector (src/connectors/postgres/index.ts), DBHub was patched to wrap query executions in an explicit read-only transaction block whenever the read-only flag is set:

// Patched execution block in PostgreSQL connector
if (options.readonly) {
  // Force PostgreSQL engine to enforce read-only transaction constraints
  await client.query('BEGIN READ ONLY');
  try {
    const result = await client.query(sql);
    await client.query('COMMIT');
    return result;
  } catch (error) {
    try { 
      await client.query('ROLLBACK'); 
    } catch (rollbackErr) {
      // Prevent rollback suppression from hiding original query errors
    }
    throw error;
  }
}

For SQLite connectors (src/connectors/sqlite/index.ts), the patch applies structural query-level locks, toggling PRAGMA query_only = ON before executing client commands, and reverting it securely inside a finally block:

// Patched execution block in SQLite connector
if (options.readonly) {
  await db.run('PRAGMA query_only = ON;');
}
try {
  return await db.all(sql);
} finally {
  if (options.readonly) {
    await db.run('PRAGMA query_only = OFF;');
  }
}

To address MySQL implicit commits on Data Definition Language (DDL) operations—where statements like DROP TABLE force a transaction commit and ignore read-only transaction blocks—the parser was supplemented with a hardened scanner. The new scanSingleLineCommentMySQL function correctly mirrors database engine behavior:

// Hardened parser verification for MySQL comment markers
function scanSingleLineCommentMySQL(sql: string, i: number): SQLToken | null {
  if (sql[i] !== "-" || sql[i + 1] !== "-") {
    return null;
  }
  const next = sql[i + 2];
  // MySQL requires whitespace or control characters after -- to treat it as a comment
  if (next !== undefined && next.charCodeAt(0) > 0x20 && next.charCodeAt(0) !== 0x7f) {
    return null; // Evaluated as mathematical operators, not a comment boundary
  }
  // Standard comment processing continues...
}

These modifications ensure that if an attacker attempts to hide stacked DDL commands within a malformed comment block, the database-specific pre-parser fails to strip the text, accurately identifies the presence of multiple statements, and blocks execution before the payload reaches the driver.

Exploitation Methodology

To exploit an unpatched DBHub deployment, an attacker must transmit a crafted JSON-RPC request targeting the /mcp HTTP endpoint. The tool name execute_sql is specified along with the readonly: true parameter, simulating a legitimate analytical tool request.

The diagram below outlines the logical path of an exploitation attempt utilizing the MySQL comment parsing mismatch:

A sample exploit payload targeting an unpatched MySQL connector would be structured as follows:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "execute_sql",
    "arguments": {
      "sql": "SELECT 1--1;INSERT INTO users (username, password) VALUES ('malicious_root', 'hash');",
      "readonly": true
    }
  }
}

When processed by an affected system, the custom parser incorrectly identifies the entire segment starting at --1 as a comment, stripping it and validating the single remaining token SELECT 1. The unstripped, full SQL string is then forwarded to the MySQL connection driver, which executes the database modification without restriction.

Security Impact and Blast Radius

The security impact of CVE-2026-61788 is classified as High, yielding a CVSS score of 7.4. Although DBHub runs locally as a proxy component, its default configuration binds to 0.0.0.0 without access control mechanisms, exposing database resources to remote networks.

The successful exploitation of this flaw breaks the isolation boundary between analytics workflows and administrative controls. An attacker can write arbitrary data to host database tables, alter configuration variables, or corrupt system logging tables. If DBHub is configured to access databases using highly privileged roles (e.g., postgres or root), the impact extends to the hosting server file system.

On PostgreSQL backends, attackers can leverage administrative functions inside nested SELECT queries to achieve remote code execution. For example, executing a query that calls lo_export allows writing arbitrary binary payloads to host directories, while utilizing COPY ... FROM PROGRAM allows executing system-level commands as the database runtime user. This capability bypasses the read-only policy and leads to host-level compromise.

Remediation and Defense-in-Depth

The primary remediation for CVE-2026-61788 is upgrading DBHub to version 0.22.6 or higher. This version implements correct, engine-specific connection read-only flags and includes the updated SQL pre-parser code to safely handle MySQL and SQLite formatting anomalies.

When immediate patching is not possible, security administrators should apply the following defensive workarounds:

  1. Modify Network Bindings: Force the DBHub daemon to bind strictly to the local loopback interface (127.0.0.1) rather than the wildcard interface (0.0.0.0). This restricts access to processes running locally on the system.

  2. Network Filtering: Implement firewall rules (e.g., iptables, security groups) to restrict incoming traffic to the TCP port hosting the /mcp endpoint. Access should be permitted only from trusted clients.

  3. Enforce Database Least Privilege (PoLP): Configure DBHub connection profiles to use low-privileged database roles. If an application profile requires only read-only access, enforce this restriction directly inside the database management system (DBMS) by revoking INSERT, UPDATE, DELETE, and file-access permissions for that user. This prevents code-level bypasses from translating into state modifications.

Official Patches

BytebaseOfficial GitHub Security Advisory for CVE-2026-61788
BytebasePull Request implementing SQL parser hardening and transaction fixes

Fix Analysis (1)

Technical Appendix

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

Affected Systems

DBHub Model Context Protocol (MCP) Server

Affected Versions Detail

Product
Affected Versions
Fixed Version
@bytebase/dbhub
Bytebase
< 0.22.60.22.6
AttributeDetail
CWE IDCWE-184 / CWE-636 / CWE-863
Attack VectorNetwork (AV:N)
CVSS v3.1 Score7.4
Exploit Statuspoc
CISA KEV StatusNo
Affected ComponentDBHub Connection Manager & Query Parser
ImpactIncorrect Authorization (Read-Only Policy Bypass)

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-184
Incomplete List of Disallowed Inputs

The product uses an incomplete list of disallowed inputs, failing to securely enforce execution constraints on database queries.

References & Sources

  • [1]GitHub Security Advisory GHSA-mwwr-p57h-56pf
  • [2]Fix Commit 872bb33
  • [3]NVD Vulnerability Detail - CVE-2026-61788
  • [4]CVE.org Record - CVE-2026-61788

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

•27 minutes ago•CVE-2026-61742
9.3

CVE-2026-61742: DNS Rebinding to Unauthenticated SQL Execution in DBHub

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.

Alon Barad
Alon Barad
2 views•7 min read
•about 2 hours ago•CVE-2026-56742
5.9

CVE-2026-56742: Missing ReferenceGrant Authorization Check in Cilium Gateway API Request Mirroring

Cilium, a cloud-native networking and security solution for Kubernetes, contains a security bypass vulnerability in its translation engine for Gateway API resources. When parsing HTTPRoute and GRPCRoute configurations, the Cilium Operator fails to apply ReferenceGrant authorization checks to RequestMirror filters. This flaw allows a user with restricted namespace-level permissions to mirror and route traffic to services across namespace boundaries without authorization, leading to cross-namespace data leaks.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 3 hours ago•CVE-2026-57231
7.5

CVE-2026-57231: Podman Malformed Image Host Environment Variable Leak

CVE-2026-57231 is a high-severity vulnerability in the Podman container engine. When executing a container from a crafted OCI or Docker image, malformed environment variable entries lacking an equals separator can trigger an unexpected behavior in the spec generation parser. This vulnerability enables a container image to silently exfiltrate host environment variables into the running container workspace, exposing high-privilege credentials and sensitive runtime secrets.

Amit Schendel
Amit Schendel
6 views•8 min read
•about 4 hours ago•CVE-2026-74480
9.8

CVE-2026-74480: Use-After-Free in Linux Kernel Network Bridge Multicast Routing

CVE-2026-74480 is a critical memory safety vulnerability in the Linux kernel's network bridge multicast routing subsystem (net: bridge) resulting from a Use-After-Free (UAF) condition during fast-leave processing of IGMP/MLD multicast groups.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 4 hours ago•CVE-2026-21992
9.8

Oracle Fusion Middleware Security Alert Advisory - CVE-2026-21992

CVE-2026-21992 is a critical, unauthenticated remote code execution (RCE) vulnerability affecting the REST WebServices component of Oracle Identity Manager (OIM) and the Web Services Security component of Oracle Web Services Manager (OWSM). Exploitation occurs over standard network protocols without user interaction, enabling a complete compromise of target system infrastructure.

Alon Barad
Alon Barad
4 views•6 min read
•about 4 hours ago•CVE-2026-61782
7.5

CVE-2026-61782: Sensitive Information Disclosure and Source Code Exfiltration via Insecure HTTP Server Defaults in @rsdoctor/rspack-plugin

An insecure configuration in the diagnostic HTTP server of @rsdoctor/rspack-plugin allowed unauthenticated remote attackers or malicious local websites to retrieve serialized build metadata and full source code modules.

Alon Barad
Alon Barad
5 views•7 min read