{"id":"CVE-2026-119276","aliases":["CVE-2026-119276","GHSA-h599-m3w5-9m7x"],"related":[],"kind":"vulnerability","state":"published","title":"MariaDB Connector/J: Rogue server can drive large heap allocations from server-declared lengths in OK packets","summary":"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.11, when CLIENT_SESSION_TRACK was negotiated, the OkPacket.parse() and OkPacket.parseWithInfo() paths allocated byte arrays using server-declared lengths for the OK packet info field and session-state variable names and values before confirming that the bytes remained in the packet. A malicious or compromised server, or a machine-in-the-middle attacker, could send a small OK packet declaring a much larger length and repeatedly force attacker-controlled heap allocations before the subsequent copy failed. This could create garbage-collection pressure or an OutOfMemoryError in the client application. This issue is fixed in versions 3.3.7, 3.4.5, and 3.5.11.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.11, when CLIENT_SESSION_TRACK was negotiated, the OkPacket.parse() and OkPacket.parseWithInfo() paths allocated byte arrays using server-declared lengths for the OK packet info field and session-state variable names and values before confirming that the bytes remained in the packet. A malicious or compromised server, or a machine-in-the-middle attacker, could send a small OK packet declaring a much larger length and repeatedly force attacker-controlled heap allocations before the subsequent copy failed. This could create garbage-collection pressure or an OutOfMemoryError in the client application. This issue is fixed in versions 3.3.7, 3.4.5, and 3.5.11.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nMariaDB Connector/J sized heap allocations from lengths declared by the server\nin OK packets before checking that those lengths fit in the packet. A rogue or\nMitM server can make the client allocate megabytes from a packet of a few bytes.\n\n## Details\n\nWhen `CLIENT_SESSION_TRACK` is negotiated (the default), an OK packet carries an\ninfo field followed by session-state blocks, each tracked variable being sent as a\nlength-encoded name and value. `OkPacket.parse()` and `parseWithInfo()` allocated\n`new byte[len]` for the info field, the variable name and the value with the\nserver-declared `len`, then copied the packet data into it. The copy failed with an\n`ArrayIndexOutOfBoundsException` when the packet was shorter, but only after the\nallocation had taken place.\n\nA server-declared length of 8 MiB in an 18-byte packet was enough to trigger an\n8 MiB allocation; the integer-range validation of length-encoded values does not\nhelp, since such lengths are valid positive integers.\n\nThe fix validates every server-declared length against the remaining packet bytes\nbefore any allocation (`ReadableByteBuf.checkLength()` and a bounded\n`readBytes(int)`), and stops reading the session state at the first inconsistent\nentry.\n\n## Impact\n\nAvailability only: a malicious or compromised server, or a MitM, can drive\nattacker-controlled heap allocations on every OK packet, creating GC pressure up to\n`OutOfMemoryError` in the client application. Exploitation requires control of the\nserver side of the connection; no authentication bypass, confidentiality or\nintegrity impact.\n\n## Credit\n\nReported by fg0x0","format":"markdown","source":"ghsa"}],"published":"2026-10-29T20:47:32.086Z","modified":"2026-10-30T23:15:06.518Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-130","CWE-789"],"affected":[{"ranges":[{"version":">= 3.0.0, < 3.3.7","status":"affected"},{"version":">= 3.4.0, < 3.4.5","status":"affected"},{"version":">= 3.5.0, < 3.5.11","status":"affected"}],"vendor":"mariadb-corporation","product":"mariadb-connector-j","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.0.0","status":"affected","fixed":"3.3.7"}],"ecosystem":"Maven","package":"org.mariadb.jdbc:mariadb-java-client","purl":"pkg:maven/org.mariadb.jdbc/mariadb-java-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.4.0","status":"affected","fixed":"3.4.5"}],"ecosystem":"Maven","package":"org.mariadb.jdbc:mariadb-java-client","purl":"pkg:maven/org.mariadb.jdbc/mariadb-java-client","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.5.0","status":"affected","fixed":"3.5.11"}],"ecosystem":"Maven","package":"org.mariadb.jdbc:mariadb-java-client","purl":"pkg:maven/org.mariadb.jdbc/mariadb-java-client","source":"ghsa"}],"references":[{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/security/advisories/GHSA-h599-m3w5-9m7x","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/commit/b9e1ee8d9b4d820d70719504cdfd5c97f1aede5f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/commit/beb445fcf9294113878fc05ac77f0efdf0596ac6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/commit/ea8c7b6537e50053444188a9a3fd9cae99550f56","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/releases/tag/3.3.7","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/releases/tag/3.4.5","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j/releases/tag/3.5.11","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119276","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mariadb-corporation/mariadb-connector-j","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-30T17:11:37.642Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-119276","url":"https://www.cve.org/CVERecord?id=CVE-2026-119276","licence":"CVE Terms of Use","modified":"2026-10-30T17:11:51.081Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h599-m3w5-9m7x","url":"https://github.com/advisories/GHSA-h599-m3w5-9m7x","licence":"CC-BY-4.0","modified":"2026-10-30T23:15:06.518Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-119276","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-119276","licence":"Public domain","modified":"2026-10-30T17:18:03.880Z"}],"updatedAt":"2026-11-25T22:59:47.839Z","epss":{"score":0.00482,"percentile":0.43201,"date":"2026-12-01T12:00:22.000Z"}}