MariaDB Connector/J CVE-2026-55858
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker controls DB object or intercepts connection
-
DeliveryIssue SET NAMES to non-UTF-8 charset mid-session
-
ExploitDriver/server encoding mismatch silently established
-
ExecutionCraft parameter with multi-byte sequence exploiting charset confusion
-
PersistBypass driver-level SQL escaping
-
ImpactExecute injected SQL on server
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V1 - Encoding and Sanitization Inappropriate encoding method
|
| Exploitation Conditions | Exploitation requires that character_set_client be changed to a non-UTF-8 value mid-session after the JDBC connection is fully initialized. Concrete triggers include: execution of SET NAMES with a non-UTF-8 charset (e.g., SET NAMES big5, SET NAMES gbk, SET NAMES latin1); invocation of a stored routine or trigger that internally alters character_set_client; server-level configuration changes propagated through OK-packet session-state tracking; or a hostile or compromised database server sending a forged OK-packet. The CVSS vector (AV:N/AC:H/PR:N) confirms network reachability but high complexity - the attacker must have a mechanism to influence the server-side charset. Connections that never experience a non-UTF-8 charset change are entirely unaffected. The attack is further limited by the requirement for a non-default multi-byte encoding on the database server, as most modern deployments default to utf8mb4. |
| Impact | The CVSS 3.1 score of 5.9 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N) reflects the high attack complexity: exploitation requires the attacker to influence the server-side character_set_client mid-session, which is a specific and non-trivial precondition. EPSS data was not provided in the input, so exploitation probability cannot be quantified; the absence of a CISA KEV listing confirms no widely observed active exploitation at time of analysis. The real-world risk is strongly context-dependent: applications connecting to fully trusted, hardened database servers with no attacker-controlled database objects face minimal realistic risk, while applications connecting to multi-tenant databases, using third-party stored procedures, or exposed to hostile server scenarios face meaningful SQL injection risk. The CVSS integrity impact of High is appropriate given that successful charset-confusion can fully bypass parameterized-query-style escaping at the driver layer. No public exploit code has been identified, which further reduces near-term mass-exploitation probability; however, the vulnerability class is well understood and the exploit primitive is documented in prior research on GBK/BIG5 SQL injection. |
| Exploit ScenarioDerived | An attacker who controls a database-side object (e.g., a stored procedure or trigger with sufficient privileges) or who can intercept an unencrypted database connection issues SET NAMES big5 or an equivalent non-UTF-8 charset command mid-session. The driver, now operating under an encoding mismatch, encodes a crafted string parameter containing a multi-byte sequence whose trailing byte is 0x27 (apostrophe) or 0x5C (backslash) in UTF-8 but is consumed as a continuation byte by the server's BIG5/GBK parser, escaping the quoting boundary and injecting arbitrary SQL. No public exploit code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 28, 2026
Charset-confusion in MariaDB Connector/J (all branches prior to 2.7.14, 3.3.5, 3.4.3, and 3.5.9) allows a server-side character set change mid-session to silently decouple the driver's UTF-8 encoding assumption from the server's active encoding. Because the driver continues escaping SQL string literals as UTF-8 while the server parses incoming bytes under a different multi-byte encoding (e.g., GBK or BIG5), the mismatch can defeat byte-wise SQL quoting and enable SQL injection - a well-documented attack class for charset-confusion primitives. No public exploit has been identified and this CVE is not listed in CISA KEV at time of analysis.
RemediationAI
Upgrade to the patched release on your branch: 3.5.x users should upgrade to 3.5.9, 3.4.x users to 3.4.3, 3.0.x through 3.3.x users to 3.3.5, and 2.x users to 2.7.14. All fixed releases are available at https://github.com/mariadb-corporation/mariadb-connector-j/releases. The vendor explicitly states there is no reliable application-level workaround. As a partial compensating control only while patching is scheduled, operators can restrict database user grants to prevent creation or modification of stored routines and triggers that could alter character_set_client, and can enforce TLS on the database connection to eliminate hostile-server man-in-the-middle scenarios - note neither control addresses a compromised database server or a trusted but misconfigured one. These measures reduce but do not eliminate risk and should not substitute for upgrading.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in maven
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
MariaDB Connector/J (Maven artifact org.mariadb.jdbc:mariadb-java-client; CPE cpe:2.3:a:mariadb-corporation:mariadb-connector-j) is the official JDBC driver for Java applications connecting to MariaDB and MySQL. The root cause is CWE-838 (Inappropriate Encoding for Output Context): the driver hardcodes the assumption that character_set_client is always UTF-8, but the MariaDB/MySQL wire protocol allows the server to advertise a mid-session charset change through OK-packet session-state tracking. Triggers include SET NAMES, stored routines, triggers, and server-level configuration. Multi-byte encodings such as GBK, BIG5, and SJIS contain byte sequences that, when interpreted as UTF-8, can cause a trailing backslash or quote character to be consumed as a continuation byte, undermining the escaping that prevents SQL injection - a primitive historically exploited before databases standardized on UTF-8. The fix, visible in commit 300716bef1e1, adds character_set_client to tracked session variables and raises SQLNonTransientConnectionException (SQLState 08000) if the server reports any value other than utf8, utf8mb3, or utf8mb4, closing the connection rather than continuing under mismatched encoding.
Know when Java gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Network vector confirmed by hostile-server scenario; AC:H for required mid-session charset manipulation; PR:N as no client-side privileges needed; I:H for SQL injection potential via encoding bypass.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
MariaDB Connector/J is used to connect applications developed in Java to MariaDB and MySQL databases. Prior to 2.7.14, 3.3.5, 3.4.3, and 3.5.9, the connector encodes and decodes protocol text and performs client-side escaping under the assumption that the connection character set is UTF-8. The server can report a mid-session change to character_set_client through OK-packet session-state tracking, including a change caused by SET NAMES, a stored routine or trigger, server configuration, or a hostile server. If character_set_client changes to a non-UTF-8 value, the driver continues to read and write UTF-8 while the server interprets the same bytes under another encoding, causing silent data corruption and a client/server charset-confusion mismatch that can defeat byte-wise quoting or escaping. The fix accepts only utf8, utf8mb3, or utf8mb4 after initialization; any other value causes SQLException with SQLState 08000 and closes the connection. This issue is fixed in versions 2.7.14, 3.3.5, 3.4.3, and 3.5.9.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m
Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti
Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent
Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug
JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up
Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up
The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers
Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow
Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla
The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during
GHSA-xvr9-35cr-46v9
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB