NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Maven

CVE-2026-119276: MariaDB Connector/J: Rogue server can drive large heap allocations from server-declared lengths in OK packets

mediumCVSS 3.1 5.9GHSA-h599-m3w5-9m7x

MariaDB Connector/J (org.mariadb.jdbc:mariadb-java-client) allocates heap memory from lengths a server declares in OK packets before checking they fit in the packet. A rogue or man-in-the-middle server can make a client allocate megabytes from a packet of a few bytes, up to OutOfMemoryError. Upgrade to 3.3.7, 3.4.5 or 3.5.11.

Published Oct 30, 2026 · Analysis Oct 31, 2026

What an attacker can do

With CLIENT_SESSION_TRACK negotiated (the default), each OK packet carries an info field and session-state blocks. Every tracked variable is sent as a length-encoded name and value. OkPacket.parse() and parseWithInfo() ran new byte[len] for the info field, the variable name and the value, using the length the server declared, and only then copied packet data into it. If the packet was shorter, the copy threw ArrayIndexOutOfBoundsException, but the allocation had already happened.

The advisory's example is a declared length of 8 MiB inside an 18-byte packet. The existing range check on length-encoded integers does not stop this, because such lengths are valid positive numbers.

The attacker must control the server side of the connection or sit on the network path. The server can repeat this on every OK packet, which builds garbage-collection pressure and can end in OutOfMemoryError in the client application. The impact is availability only. There is no authentication bypass, data exposure or tampering.

Who is affected

Affected: 3.0.0 up to but not including 3.3.7, 3.4.0 up to 3.4.5, and 3.5.0 up to 3.5.11. Because CLIENT_SESSION_TRACK is on by default, default configurations are exposed. Applications that connect only to trusted servers over verified TLS have little practical exposure.

Check the resolved version:

mvn dependency:tree -Dincludes=org.mariadb.jdbc:mariadb-java-client

For Gradle, run gradle dependencies --configuration runtimeClasspath. Also inspect fat JARs and application server library folders.

org.mariadb.jdbc:mariadb-java-client

Ecosystem
Maven
Affected
>= 3.0.0, < 3.3.7
Fixed in
3.3.7
Check
mvn dependency:tree -Dincludes=org.mariadb.jdbc:mariadb-java-client

org.mariadb.jdbc:mariadb-java-client

Ecosystem
Maven
Affected
>= 3.4.0, < 3.4.5
Fixed in
3.4.5
Check
mvn dependency:tree -Dincludes=org.mariadb.jdbc:mariadb-java-client

org.mariadb.jdbc:mariadb-java-client

Ecosystem
Maven
Affected
>= 3.5.0, < 3.5.11
Fixed in
3.5.11
Check
mvn dependency:tree -Dincludes=org.mariadb.jdbc:mariadb-java-client

How to fix it

Upgrade org.mariadb.jdbc:mariadb-java-client to 3.3.7, 3.4.5 or 3.5.11, whichever matches your minor line. The fix checks every server-declared length against the remaining packet bytes before allocating, through ReadableByteBuf.checkLength() and a bounded readBytes(int). It also stops reading session state at the first inconsistent entry.

The advisory lists no workaround. Connecting over TLS with certificate verification limits the man-in-the-middle case.

How to tell if you were hit

Look for client JVMs with sudden heap growth, long GC pauses or OutOfMemoryError that follow database responses, particularly when the connector talks to an unfamiliar or recently changed database endpoint. Heap dumps will show large short-lived byte[] arrays allocated under OkPacket.parse. Stack traces with ArrayIndexOutOfBoundsException from OkPacket parsing are a sign of malformed OK packets. Confirm that database hostnames resolve to the servers you expect and that traffic is encrypted.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

MariaDB Connector/J sized heap allocations from lengths declared by the server in OK packets before checking that those lengths fit in the packet. A rogue or MitM server can make the client allocate megabytes from a packet of a few bytes.

Details

When CLIENT_SESSION_TRACK is negotiated (the default), an OK packet carries an info field followed by session-state blocks, each tracked variable being sent as a length-encoded name and value. OkPacket.parse() and parseWithInfo() allocated new byte[len] for the info field, the variable name and the value with the server-declared len, then copied the packet data into it. The copy failed with an ArrayIndexOutOfBoundsException when the packet was shorter, but only after the allocation had taken place.

A server-declared length of 8 MiB in an 18-byte packet was enough to trigger an 8 MiB allocation; the integer-range validation of length-encoded values does not help, since such lengths are valid positive integers.

The fix validates every server-declared length against the remaining packet bytes before any allocation (ReadableByteBuf.checkLength() and a bounded readBytes(int)), and stops reading the session state at the first inconsistent entry.

Impact

Availability only: a malicious or compromised server, or a MitM, can drive attacker-controlled heap allocations on every OK packet, creating GC pressure up to OutOfMemoryError in the client application. Exploitation requires control of the server side of the connection; no authentication bypass, confidentiality or integrity impact.

Credit

Reported by fg0x0

Credited to fg0x0.

Questions

Does CVE-2026-119276 allow data theft or code execution?

No. The advisory describes availability impact only: attacker-driven heap allocations that can lead to OutOfMemoryError. It lists no confidentiality or integrity impact.

What does an attacker need?

Control of the server side of the connection, either a rogue or compromised database server or a man-in-the-middle on the network path. No credentials on the client are needed beyond the connection being made.

Which version fixes it?

3.3.7 for the 3.0 to 3.3 line, 3.4.5 for 3.4, and 3.5.11 for 3.5.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Maven vulnerabilities

All Maven entries