GHSA-797x-p4mc-jwpm: MariaDB Connector/J: Length-encoded integers larger than Integer.MAX_VALUE were truncated before being used as lengths

Published Oct 29, 2026
·
Updated

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.MAXVALUE 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.MAXVALUE 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

Other sources

MariaDB Connector/J is used to connect applications developed in Java to MariaDB and MySQL databases. From 3.0.0 until 3.3.7, 3.4.5, and 3.5.10, the ReadableByteBuf.readLength() and ReadableByteBuf.readIntLengthEncodedNotNull() methods narrowed the protocol's unsigned 8-byte length-encoded integer to a Java int without checking that the value fit a non-negative integer. Values above Integer.MAXVALUE could wrap to a negative or unrelated length that downstream allocation and read paths used. A malicious or compromised server, or a machine-in-the-middle attacker, could trigger NegativeArraySizeException, out-of-bounds failures, or oversized allocation behavior in client connection handling. This issue is fixed in versions 3.3.7, 3.4.5, and 3.5.10.

— OSV

Affected Software

3 affected componentsFixes available
maven/org.mariadb.jdbc:mariadb-java-client>=3.5.0<3.5.10
3.5.10
maven/org.mariadb.jdbc:mariadb-java-client>=3.4.0<3.4.5
3.4.5
maven/org.mariadb.jdbc:mariadb-java-client>=3.0.0<3.3.7
3.3.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.mariadb.jdbc:mariadb-java-client to a version that resolves this vulnerability.

    Fixed in 3.5.10
  2. Upgrade

    Upgrade maven/org.mariadb.jdbc:mariadb-java-client to a version that resolves this vulnerability.

    Fixed in 3.4.5
  3. Upgrade

    Upgrade maven/org.mariadb.jdbc:mariadb-java-client to a version that resolves this vulnerability.

    Fixed in 3.3.7
  4. Upgrade

    Upgrade MariaDB Connector/J to a version that resolves this vulnerability.

    Fixed in 3.3.7
  5. Upgrade

    Upgrade MariaDB Connector/J to a version that resolves this vulnerability.

    Fixed in 3.4.5
  6. Upgrade

    Upgrade MariaDB Connector/J to a version that resolves this vulnerability.

    Fixed in 3.5.10

Event History

Oct 29, 2026
CVE Published
via OSV·08:52 PM
Data Sourced
via OSV·08:52 PM
DescriptionSeverityWeakness
Oct 30, 2026
Advisory Published
via GitHub·11:00 PM
Data Sourced
via GitHub·11:00 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·11:00 PM
Affected Software

Frequently Asked Questions

1

Which deployments are realistically exposed?

Applications using MariaDB Connector/J are exposed only when the database server is malicious or compromised, or when an attacker can act as a man-in-the-middle on the connection. The impact is limited to client-side availability.

2

What does an attacker need to exploit this issue?

The attacker must control the server side of the database connection or be able to modify server responses in transit. No authentication bypass is involved.

3

What failure modes can indicate exploitation?

Affected clients may show NegativeArraySizeException, out-of-bounds exceptions, or unusually large allocation attempts during connection handling. These result from a server-provided length value being truncated to an invalid int.

4

What changes in the fixed behavior?

The corrected decoder rejects length-encoded values that cannot fit in a non-negative int and returns an explicit error instead of using the truncated value as a length.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203