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

CVE-2026-55859: Client-Server Charset Confusion in MariaDB Connector/R2DBC leading to SQL Injection

Alon Barad
Alon Barad
Software Engineer

Aug 29, 2026·5 min read·0 visits

Executive Summary (TL;DR)

A charset desynchronization vulnerability in MariaDB Connector/R2DBC allows attackers to bypass SQL character escaping and execute arbitrary database queries.

An input validation and encoding desynchronization vulnerability exists in MariaDB Connector/R2DBC versions prior to 1.4.1. The driver assumes all communication utilizes the UTF-8 character set, but fails to account for server-driven mid-session changes to the character_set_client variable. When a change to a multi-byte character set such as GBK or Big5 is induced, the server interprets client-escaped single quotes as part of a multi-byte character. This state desynchronization bypasses standard escaping mechanisms and allows remote unauthenticated attackers to execute arbitrary SQL commands.

Vulnerability Overview

The MariaDB Connector/R2DBC is an asynchronous, non-blocking Java driver that relies on the Netty framework for database network exchanges. To maintain performance, the driver serializes query parameters and deserializes database responses under the assumption that the connection character set remains UTF-8.

The MySQL and MariaDB protocol allows dynamic session-level configuration changes. A database server can alter session-level variables such as character_set_client and character_set_connection mid-session. When these variables are modified, the server notifies the client driver using the state-tracking mechanism embedded inside the standard database OkPacket payload.

In versions of the R2DBC driver prior to 1.4.1, the client protocol parser completely ignored these session-state-tracking notifications. This omission creates a mismatch where the client behaves under UTF-8 rules, while the database server operates under a different character set, enabling classic multi-byte charset-confusion attacks.

Root Cause Analysis

The vulnerability stems from an architectural assumption within the unpatched driver's protocol engine. Because the driver assumes character operations are statically encoded using UTF-8, it does not dynamically adapt its escaping behavior to synchronize with the server's state updates.

When a client-side parameter interpolation takes place, the driver escapes control characters like single quotes (0x27) by prepending a backslash (0x5C). If an attacker successfully triggers a character set change to a multi-byte encoding such as GBK or Big5, the escaping mechanism is completely bypassed.

In multi-byte systems like Big5, the backslash byte 0x5C is a valid trailing byte (the low-order byte) of a multi-byte character sequence. By prefixing the single quote with a high-order byte (for example, 0xd5), an attacker forces the server to pair 0xd5 and 0x5c together as a single multi-byte character. This leaves the trailing quote 0x27 unescaped, leading to arbitrary SQL injection.

Code Analysis

The fix introduced in commit 38bad9afebc6c581a853656a42f9ebf403b1b1b7 blocks this state desynchronization vector. The R2DBC context driver is enhanced with state initialization flags and a check inside SimpleContext.java to validate incoming character sets.

// Added in SimpleContext.java
private volatile boolean initialized = false;
 
@Override
public void setCharset(String charset) {
  // If the driver is initialized, reject any character set change to non-utf8 encodings
  if (initialized && charset != null && !charset.startsWith("utf8")) {
    throw new R2dbcNonTransientResourceException(
        String.format(
            "Connection character set was changed to '%s'. Only utf8 / utf8mb3 / utf8mb4 are" 
                + " supported. The connection has been closed.",
            charset),
        "08000");
  }
}
 
@Override
public void setInitialized() {
  this.initialized = true;
}

The protocol parser in OkPacket.java is modified to process state-tracking blocks and call context.setCharset() when the server broadcasts a variable modification:

// Added in OkPacket.java
case "character_set_client":
  context.setCharset(value);
  break;

Additionally, connection factories like MariadbConnectionFactory.java mark the context as fully initialized once the authentication exchange is complete:

// Inside MariadbConnectionFactory.java (post-patch)
.flatMap(
    client -> {
      client.getContext().setInitialized();
      return setSessionVariables(configuration, client).thenReturn(client);
    })

This remediation operates under a fail-fast strategy. Rather than attempting to support dynamic multi-byte translation on the fly, the driver outright rejects any non-UTF-8 transition and terminates the network socket connection immediately.

Exploitation Methodology

Exploitation of CVE-2026-55859 requires the execution of a mid-session character set transition followed by a crafted database payload. An attacker can achieve this transition through multiple distinct avenues.

In the first scenario, the target application executes an unauthenticated routine or stored procedure containing a dynamic charset modification. For example, a procedure executing a SET NAMES 'big5' statement causes the backend database to alter its expected client-side encoding.

In the second scenario, a Man-in-the-Middle actor intercepts an unencrypted connection between the application and the database. By tampering with the server's raw TCP response packets, the adversary injects an OkPacket containing a SESSION_TRACK_SYSTEM_VARIABLES structure that sets character_set_client to big5 or gbk.

Once the desynchronized state is established, the attacker delivers an injection payload containing a high-order byte followed by a quote. The application escaper prepends a backslash, creating a byte sequence that the database parses as a single valid multi-byte character. The unescaped quote breaks out of the intended query structure, granting arbitrary command execution.

Impact Assessment

The impact of this vulnerability is critical for applications processing user input inside dynamically compiled SQL structures. An unauthenticated attacker capable of injecting character set states can routinely bypass standard parameter escaping logic.

This leads directly to unauthenticated remote SQL injection. Depending on the privileges assigned to the database connection pool, the attacker can read, modify, or delete sensitive tables. In some environments, SQL injection allows executing system-level commands or writing malicious files to the filesystem.

The CVSS v3.1 base score is 5.9. The attack complexity is rated as High because triggering the vulnerability requires specific database code paths to alter system variables or an active network position to modify packets. Because it bypasses traditional query isolation layers, this flaw poses a notable risk to multi-tenant or public-facing enterprise services.

Remediation & Mitigation

Detecting vulnerability exposure involves auditing both codebase dependencies and network encryption configurations. Organizations must check build configurations (such as Maven POM files and Gradle build scripts) to identify the presence of org.mariadb:r2dbc-mariadb versions below 1.4.1.

Immediate remediation requires upgrading to version 1.4.1 or higher. This version contains the fail-fast setCharset verification code that drops mismatched connections.

If patching cannot be executed immediately, administrators must enforce TLS with strict verification (sslMode=VERIFY_CA or VERIFY_FULL). This prevents active network-based attackers from injecting malicious charset changes via packet manipulation. Furthermore, database-level privileges must be restricted to prevent user-supplied sessions from executing SET NAMES commands.

Official Patches

MariaDB Corporation AbOfficial GitHub Security Advisory
MariaDB Corporation AbAuthoritative Fix Commit

Fix Analysis (1)

Technical Appendix

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

Affected Systems

MariaDB Connector/R2DBC

Affected Versions Detail

Product
Affected Versions
Fixed Version
MariaDB Connector/R2DBC
mariadb-corporation
< 1.4.11.4.1
AttributeDetail
CWE IDCWE-116, CWE-838
Attack VectorNetwork
ComplexityHigh
CVSS Score5.9
ImpactIntegrity (SQL Injection)
Exploit StatusConceptual / PoC
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-116
Improper Encoding or Escaping of Output

The application fails to properly encode or escape data before placing it in an output context, allowing the structure of the output to be altered.

Vulnerability Timeline

Patch commit authored and checked in.
2026-05-28
Bug closed in MariaDB JIRA under ticket R2DBC-124.
2026-05-28
Official security advisory published on GitHub.
2026-08-28
CVE-2026-55859 published on the NVD.
2026-08-28

References & Sources

  • [1]GitHub Security Advisory GHSA-5rqc-86vf-g8r2
  • [2]MariaDB JIRA Bug Ticket R2DBC-124
  • [3]Official Release Announcement 1.4.1

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

•about 1 hour ago•CVE-2026-55860
5.9

CVE-2026-55860: Cleartext Password Disclosure in MariaDB Connector/R2DBC

A security vulnerability in the MariaDB Connector/R2DBC client driver allows credential theft during the database authentication phase. The client driver does not gate clear-text password authentication plugins on transport encryption, making it possible for on-path attackers or hostile database servers to intercept passwords.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 2 hours ago•CVE-2026-55830
8.3

CVE-2026-55830: Complete Sandbox Escape via Positional-Only Arguments in RestrictedPython

A critical security flaw was identified in RestrictedPython prior to version 8.3 where positional-only arguments introduced in Python 3.8 were not properly validated. This allowed an attacker executing code within the sandbox to shadow critical security guards like `_write_` and `_getattr_`, leading to a complete sandbox escape and arbitrary code execution on the underlying server.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 3 hours ago•CVE-2026-55855
6.5

CVE-2026-55855: SQL Injection in MariaDB Connector/Node.js via Multi-byte Client Character Sets

CVE-2026-55855 is a client-side SQL injection vulnerability in the MariaDB Connector/Node.js library that occurs when using legacy multi-byte character sets. The flaw arises from naive, byte-wise client-side parameter escaping. Attackers can leverage specific multi-byte lead bytes to absorb backslash escape characters on the server side, allowing them to terminate string literals and execute arbitrary SQL commands.

Amit Schendel
Amit Schendel
8 views•7 min read
•about 4 hours ago•CVE-2026-55761
7.1

CVE-2026-55761: Improper Authentication Vulnerability in Portainer Community Edition

An improper authentication vulnerability (CWE-287) in Portainer Community Edition (CE) allows unauthenticated remote attackers to achieve full administrative takeover. During the initial five-minute uninitialized setup window, sensitive endpoints responsible for creating the initial administrator user and restoring database state are publicly accessible without authentication. Attackers can exploit this to create administrative credentials or overwrite the system state with a malicious database configuration.

Alon Barad
Alon Barad
3 views•7 min read
•about 5 hours ago•CVE-2026-55678
6.9

CVE-2026-55678: Unauthenticated Node Registration and Credential Leakage in Arc Enterprise Clustering

CVE-2026-55678 defines a critical security vulnerability in the Enterprise clustering implementation of Arc, an open-source SQL-native time-series database. When clustering is enabled but a shared secret is not defined, the cluster coordinator fails to enforce authentication on cluster join requests and node status updates. Remote, unauthenticated attackers can exploit this behavior to register a rogue node, hijack telemetry routing, and harvest sensitive client authentication headers.

Alon Barad
Alon Barad
10 views•6 min read
•about 7 hours ago•CVE-2026-55247
9.1

CVE-2026-55247: Multiple Vulnerabilities (DoS, SSRF, and Stored XSS) in plone.app.event iCalendar Import

A critical security vulnerability exists in plone.app.event, the event content type package for the Plone CMS. Prior to versions 5.2.4 and 6.0.1, the iCalendar import component lacked proper file size controls, URL scheme validation, and network isolation filters. Authenticated editors could exploit these deficiencies to cause denial of service via memory exhaustion, read local files, perform server-side request forgery, and inject stored cross-site scripting vectors.

Alon Barad
Alon Barad
6 views•6 min read