Skip to main content

MariaDB Connector/J CVE-2026-55858

MEDIUM
Inappropriate Encoding for Output Context (CWE-838)
2026-08-28 GitHub_M GHSA-xvr9-35cr-46v9
5.9
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker controls DB object or intercepts connection
  2. Delivery
    Issue SET NAMES to non-UTF-8 charset mid-session
  3. Exploit
    Driver/server encoding mismatch silently established
  4. Execution
    Craft parameter with multi-byte sequence exploiting charset confusion
  5. Persist
    Bypass driver-level SQL escaping
  6. Impact
    Execute 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

maven org.mariadb.jdbc:mariadb-java-client fix: 2.7.14, 3.3.5, 3.4.3, 3.5.9

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

Vendor (GitHub_M) PRIMARY 5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 5.9 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 5.9 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

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

EPSS Score
0.3%
Top 73% exploitable
Prevalence
High
widely used Java JDBC driver for MariaDB and MySQL
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

50
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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

cpe:2.3:a:mariadb-corporation:mariadb-connector-j:*:*:*:*:*:*:*:*

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

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

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Severity: Moderate

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy