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

CVE-2026-119279: MariaDB Connector/J: Length-encoded integers larger than Integer.MAX_VALUE were truncated before being used as lengths

mediumCVSS 3.1 5.9GHSA-797x-p4mc-jwpm

MariaDB Connector/J (org.mariadb.jdbc:mariadb-java-client) cast 8-byte length-encoded integers from the server to a Java int with no range check. A rogue or man-in-the-middle server can send a huge value that wraps into a negative or arbitrary length, crashing connection handling or forcing oversized allocations. Fixed in 3.3.7, 3.4.5 and 3.5.10.

Published Oct 30, 2026 · Analysis Oct 31, 2026

What an attacker can do

The MariaDB wire protocol encodes lengths as length-encoded integers. In the 8-byte form, the decoder methods readLength() and readIntLengthEncodedNotNull() returned (int) readLong(). Any value above Integer.MAX_VALUE wrapped silently into a negative or unrelated int. The driver then used that number to size allocations and reads. Results were NegativeArraySizeException, out-of-bounds exceptions or very large allocations.

The attacker needs to be the database server or sit between client and server. No credentials are needed on the client side beyond making the connection. Because these are unchecked exceptions in the packet reader, they can break the client's connection handling and take down queries or a connection pool. Oversized allocations add memory pressure.

The advisory rates this as availability only. It reports no authentication bypass, data exposure or tampering. This is the same family as the other length-handling flaws reported by the same researcher in the same release train, but it concerns integer narrowing, not allocation before a bounds check.

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.10. Note that the 3.5 line is fixed one release earlier here (3.5.10) than in the sibling MariaDB advisories (3.5.11).

List the resolved version:

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

For Gradle, run gradle dependencies --configuration runtimeClasspath. Check shaded JARs and application server library folders too.

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.10
Fixed in
3.5.10
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.10, matching your minor line. The patched decoder rejects any length-encoded value that does not fit a non-negative int and raises an explicit error instead of wrapping.

The advisory lists no workaround. Until you upgrade, connect only to servers you control and use TLS with certificate verification, so a network attacker cannot pose as the database.

How to tell if you were hit

Search application logs for NegativeArraySizeException or ArrayIndexOutOfBoundsException with stack frames in the connector's packet reading code, and for OutOfMemoryError right after a database response. Repeated connection failures to a single database host, with no matching errors on the real server, point to a spoofed or intercepted endpoint. Verify that DNS and routing for your database hostnames are unchanged.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

MariaDB Connector/J narrowed 8-byte length-encoded integers received from the server to int without validation. A rogue or MitM server can send a value above Integer.MAX_VALUE whose truncation becomes a negative or arbitrary length.

Details

The protocol encodes lengths as length-encoded integers, whose 8-byte form the decoder (readLength() and readIntLengthEncodedNotNull()) returned as (int) readLong(). A value above Integer.MAX_VALUE therefore wrapped to a negative or unrelated int, used afterwards as a length to size allocations or reads, which ended in NegativeArraySizeException, out-of-bounds exceptions or oversized allocations.

The fix rejects any length-encoded value that does not fit a non-negative int with an explicit error.

Impact

Availability only: a malicious or compromised server, or a MitM, can crash the client's connection handling with unchecked exceptions or drive oversized allocations. 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

Can CVE-2026-119279 be used to run code on the client?

The advisory reports availability impact only: unchecked exceptions or oversized allocations. It lists no confidentiality or integrity impact.

Is the fixed version for the 3.5 line different from the other MariaDB advisories?

Yes. This advisory lists 3.5.10 as patched for the 3.5 line, so 3.5.10 or later contains the fix. The sibling advisories list 3.5.11.

Does the attacker need to be authenticated?

No client credentials are involved. The attacker must control the server end of the connection or be a man-in-the-middle, which is why the attack complexity is rated high.

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