Aug 29, 2026·6 min read·0 visits
MariaDB Connector/J fails to enforce TLS/SSL when negotiating the PAM 'dialog' authentication plugin. An attacker with on-path network access or running a rogue database server can trigger an authentication switch to 'dialog' and harvest the database password in plaintext.
A transport-security omission in the MariaDB Connector/J driver allows remote on-path adversaries or rogue database servers to capture database credentials in cleartext. Under default configurations (sslMode=DISABLE), the driver fails to enforce encrypted channels when negotiating the Pluggable Authentication Module (PAM) 'dialog' plugin, resulting in cleartext transmission of sensitive passwords.
MariaDB Connector/J is the official Java Database Connectivity (JDBC) driver that enables Java applications to interface with MariaDB and MySQL database systems. The driver manages protocol-level communications, including connection establishment, capability negotiation, and authentication handshakes. Because these early connection phases occur before full application context is established, they present a critical attack surface.
This vulnerability, tracked as CVE-2026-55857, is classified under CWE-319 (Cleartext Transmission of Sensitive Information). The flaw lies in the driver's Pluggable Authentication Module (PAM) handler class, SendPamAuthPacketFactory, which maps to the server-side authentication plugin name dialog. While standard cleartext plugins (such as mysql_clear_password) strictly require an encrypted transport channel, the PAM handler failed to declare this requirement.
If the driver operates under its default configuration where sslMode is set to DISABLE and restrictedAuth is null, it establishes connections over unencrypted plain TCP. An adversary capable of intercepting or terminating these connections can manipulate the authentication sequence to downgrade the security profile, forcing the driver to transmit the user's cleartext password.
The root cause of this vulnerability lies in the design and implementation of the driver's authentication plugin validation framework. In MariaDB Connector/J, client-side authentication mechanisms are defined by classes implementing the AuthenticationPluginFactory interface. To safeguard sensitive data, this interface exposes validation properties that connection dispatchers query before transmitting credentials.
In modern 3.x branches, this is governed by the requireSecure() method, while older 2.x branches rely on the requireSsl() method. Both methods default to returning false unless explicitly overridden by the implementing subclass. The ClearPasswordPluginFactory (which implements mysql_clear_password) correctly overrides this property to return true, blocking unencrypted transmission.
However, the PAM handler subclass—SendPamAuthPacketFactory in 3.x and SendPamAuthPacket in 2.x—omitted this override and inherited the default false value. When a database server issues an AuthSwitchPacket demanding dialog authentication, the client's dispatcher (StandardClient.java) checks if the plugin requires a secure connection. Because the PAM handler's check evaluated to false, the dispatcher authorized the transaction over the unencrypted TCP socket, directly violating transport-layer security requirements for cleartext-transmitting credentials.
To resolve the vulnerability, the developers overridden the security requirements in the PAM plugin classes and strengthened the validation logic in the driver's central connection dispatcher.
In the modern 3.x branch, SendPamAuthPacketFactory.java was patched to override the requireSecure() method:
// Patched in SendPamAuthPacketFactory.java
@Override
public boolean requireSecure() {
return true;
}In the legacy 2.x branch, a similar patch was applied to SendPamAuthPacket.java to enforce secure transports:
// Patched in SendPamAuthPacket.java
@Override
public boolean requireSsl() {
// PAM ("dialog") sends the password to the server in clear text, exactly like
// mysql_clear_password. It must therefore only run over a secure channel (TLS, or a local
// unix socket - handled by the dispatcher).
return true;
}Additionally, the connection dispatcher within StandardClient.java was updated. Previously, the validation routine only checked if SSL capability was present on the client. The updated logic permits secure-required authentication only if TLS/SSL is active or if the connection is established over a local Unix domain socket (represented by UnixDomainSocket class), which is secure from remote network-level sniffing:
// Enforcement implementation in StandardClient.java
if (authPluginFactory.requireSecure()
&& !context.hasClientCapability(SSL)
&& !(socket instanceof UnixDomainSocket)) {
throw context
.getExceptionFactory()
.create(
"Cannot use authentication plugin "
+ authPluginFactory.type()
+ " if SSL is not enabled (a clear-text password plugin requires TLS or a"
+ " local unix socket).",
"08000");
}This two-pronged remediation ensures that any unencrypted TCP connection attempting to negotiate the dialog PAM auth mechanism is aborted immediately before the client can write credential bytes to the socket.
Exploiting CVE-2026-55857 requires the attacker to occupy an Adversary-in-the-Middle (AiTM) network position or redirect client traffic to an attacker-controlled rogue database server. The default parameters of the client application (sslMode=DISABLE and restrictedAuth=null) satisfy the primary exploitation prerequisites.
When the client application attempts to establish a connection, the adversary intercepts the TCP socket. After the initial handshake exchange, the attacker sends an AuthSwitchPacket indicating that the authentication process must switch to the dialog plugin.
Because the unpatched driver does not flag the dialog plugin as requiring a secure transport, the client dispatcher accepts the transition. The PAM plugin then serializes the user's database password and transmits it across the unencrypted TCP session. The attacker captures the cleartext payload, achieving complete credential disclosure.
The impact of a successful credential interception is critical. An attacker who harvests database passwords can gain unauthorized read, write, and administrative access to the backend databases. This can lead to database deletion, unauthorized data extraction, and the modification of records.
The vulnerability is assigned a CVSS v3.1 base score of 5.9 (Medium). Although the payload results in direct plaintext credential leakage (High Confidentiality Impact), successful exploitation requires an on-path network position or the ability to manipulate connection strings (High Attack Complexity).
If the database credentials are recycled across the organization (e.g., matching LDAP or Active Directory service accounts mapped to the database PAM backend), the disclosure of these credentials can serve as a primary vectors for broader lateral movement across the enterprise network.
The primary recommendation is to update the MariaDB Connector/J dependency within your application classpath to a patched release. The fix is backported across all actively maintained versions of the driver:
If an immediate dependency upgrade is not feasible, implement configuration-based mitigations to block the vulnerability. First, enforce strict SSL verification to prevent Adversary-in-the-Middle positioning:
sslMode=verify-full&serverSslCert=/path/to/trusted-ca.pemSecond, restrict the authentication mechanisms permitted by the client. By setting the restrictedAuth connection property, you can explicitly forbid the driver from negotiating the PAM 'dialog' plugin, neutralizing the switch-request attack vector:
restrictedAuth=mysql_native_password,caching_sha2_passwordCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
mariadb-connector-j mariadb-corporation | < 2.7.14 | 2.7.14 |
mariadb-connector-j mariadb-corporation | >= 3.0.0, < 3.3.5 | 3.3.5 |
mariadb-connector-j mariadb-corporation | >= 3.4.0, < 3.4.3 | 3.4.3 |
mariadb-connector-j mariadb-corporation | >= 3.5.0, < 3.5.9 | 3.5.9 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-319: Cleartext Transmission of Sensitive Information |
| Attack Vector | Network (AV:N) |
| Attack Complexity | High (AC:H) |
| CVSS Base Score | 5.9 (Medium) |
| Impact | High Confidentiality Loss (C:H) |
| Exploit Status | poc |
| CISA KEV Status | Not Listed |
The application transmits sensitive data in cleartext, which makes it vulnerable to interception and disclosure.
CVE-2026-55858 describes a critical encoding desynchronization vulnerability in MariaDB Connector/J (the official JDBC driver). The vulnerability stems from a mismatch between the driver's static UTF-8 client-side escaping logic and dynamic character set changes initiated on the database server. When the server character set is switched mid-session to an encoding that permits ASCII-overlapping multibyte characters (such as GBK or Big5), an attacker can supply crafted inputs to swallow escaping backslashes, resulting in SQL injection and unauthorized statement execution.
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.
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.
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.
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.
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.