GHSA-h599-m3w5-9m7x

Suggest an improvement
Source
https://github.com/advisories/GHSA-h599-m3w5-9m7x
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h599-m3w5-9m7x/GHSA-h599-m3w5-9m7x.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-h599-m3w5-9m7x
Aliases
Published
2026-10-30T23:00:12Z
Modified
2026-10-30T23:15:06Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
MariaDB Connector/J: Rogue server can drive large heap allocations from server-declared lengths in OK packets
Details

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

Database specific
{
    "cwe_ids":  [
        "CWE-130",
        "CWE-789"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-10-30T23:00:12Z",
    "nvd_published_at":  "2026-10-29T21:17:20Z",
    "severity":  "MODERATE"
}
References

Affected packages

Maven
org.mariadb.jdbc:mariadb-java-client

Package

Name
org.mariadb.jdbc:mariadb-java-client
View open source insights on deps.dev
Purl
pkg:maven/org.mariadb.jdbc/mariadb-java-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.0.0
Fixed
3.3.7

Affected versions

3.*
3.0.1-beta
3.0.2-rc
3.0.3
3.0.4
3.0.5
3.0.6
3.0.7
3.0.8
3.0.9
3.0.10
3.0.11
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.2.0
3.3.0
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.3.6

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h599-m3w5-9m7x/GHSA-h599-m3w5-9m7x.json"
org.mariadb.jdbc:mariadb-java-client

Package

Name
org.mariadb.jdbc:mariadb-java-client
View open source insights on deps.dev
Purl
pkg:maven/org.mariadb.jdbc/mariadb-java-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.4.0
Fixed
3.4.5

Affected versions

3.*
3.4.0
3.4.1
3.4.2
3.4.3
3.4.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h599-m3w5-9m7x/GHSA-h599-m3w5-9m7x.json"
org.mariadb.jdbc:mariadb-java-client

Package

Name
org.mariadb.jdbc:mariadb-java-client
View open source insights on deps.dev
Purl
pkg:maven/org.mariadb.jdbc/mariadb-java-client

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.5.0
Fixed
3.5.11

Affected versions

3.*
3.5.0
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.5.8
3.5.9
3.5.10

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-h599-m3w5-9m7x/GHSA-h599-m3w5-9m7x.json"