GHSA-797x-p4mc-jwpm - MariaDB Connector/J: Length-encoded integers larger than Integer.MAX_VALUE were truncated before being used as lengths
## 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
MEDIUM
Severity & confidence
Source severitymedium
Platform severitymedium
Confidencehigh
Exploitationunknown
CVSS5.9
Affected
Vendorsorg.mariadb.jdbc:mariadb-java-client
Productsorg.mariadb.jdbc:mariadb-java-client
Reporting sources (2)
GitHub Security Advisories
NIST NVD - National Vulnerability Database
Timeline & provenance
Published2026-10-30T23:00:07
Last updated2026-11-09T09:35:06
Ingested2026-10-30T23:16:10
FreshnessNEAR-REAL-TIME
Threat typeadvisory
Recommended action
Review the advisory and upgrade affected packages to the first patched version.
Next steps
- Identify affected systems in your environment.
- Apply the vendor patch or mitigation guidance.
- Review logs for indicators described in the advisory.
- Follow the affected vendor/product to track updates.
Confidence explanation
Reported by a government or cert-grade source (CISA, NCSC, NVD, ENISA, MSRC).
Source type: vendor ยท Original: GitHub Security Advisories