{"id":"CVE-2026-106452","aliases":["CVE-2026-106452","GHSA-4v53-57pg-c464"],"related":[],"kind":"vulnerability","state":"published","title":"yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header","summary":"yawkat LZ4 Java provides LZ4 compression for Java. Prior to 1.11.2, net.jpountz.lz4.LZ4BlockInputStream refill() validates that the compressedLen field in a legacy LZ4Block header is nonnegative but allocates a compressed-input buffer of that attacker-controlled size before reading payload data, allowing a header-only stream to request a near-2 GiB allocation and exhaust the JVM heap. Canonical writers emit raw blocks when compression is not smaller than the original block, but vulnerable readers accept non-canonical oversized compressed blocks. This issue is fixed in version 1.11.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"yawkat LZ4 Java provides LZ4 compression for Java. Prior to 1.11.2, net.jpountz.lz4.LZ4BlockInputStream refill() validates that the compressedLen field in a legacy LZ4Block header is nonnegative but allocates a compressed-input buffer of that attacker-controlled size before reading payload data, allowing a header-only stream to request a near-2 GiB allocation and exhaust the JVM heap. Canonical writers emit raw blocks when compression is not smaller than the original block, but vulnerable readers accept non-canonical oversized compressed blocks. This issue is fixed in version 1.11.2.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`LZ4BlockInputStream` grows its compressed-input buffer to the attacker-controlled `compressedLen` value from the legacy `LZ4Block` stream header before reading any payload bytes. A header-only input can therefore trigger a near-2 GiB allocation and exhaust the JVM heap.\n\n### Details\n\nIn `net.jpountz.lz4.LZ4BlockInputStream`, `refill()` validates that `compressedLen` is nonnegative but does not cap it before allocation:\n\n```java\ncase COMPRESSION_METHOD_LZ4:\n  if (compressedBuffer.length < compressedLen) {\n    compressedBuffer = new byte[Math.max(compressedLen, compressedBuffer.length * 3 / 2)];\n  }\n  readFully(compressedBuffer, compressedLen);\n```\n\nThe paired `LZ4BlockOutputStream` never emits such a block. If compression is not smaller than the original block, it writes the block as RAW:\n\n```java\nif (compressedLength >= o) {\n  compressMethod = COMPRESSION_METHOD_RAW;\n  compressedLength = o;\n} else {\n  compressMethod = COMPRESSION_METHOD_LZ4;\n}\n```\n\nExisting readers generally accept noncanonical LZ4-method blocks where `compressedLen >= originalLen`, but no canonical writer found produces them.\n\n### Impact\n\nApplications that pass attacker-controlled legacy `LZ4Block` streams to `LZ4BlockInputStream` can suffer heap exhaustion from a header-only input. The impact is availability-only and requires no valid compressed payload.\n\n### Patch\n\nAs of lz4-java 1.11.2, lz4-java rejects lz4 blocks where the compressed length is larger than uncompressed. Readers would generally emit these as raw blocks instead. You can use the new `acceptOversizedBlocks` flag to restore the old behavior, but this reintroduces the DoS vector.","format":"markdown","source":"ghsa"}],"published":"2026-10-06T19:52:37.818Z","modified":"2026-10-07T16:30:04.845Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-789"],"affected":[{"ranges":[{"version":"< 1.11.2","status":"affected"}],"vendor":"yawkat","product":"lz4-java","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.11.2"}],"ecosystem":"Maven","package":"at.yawk.lz4:lz4-java","purl":"pkg:maven/at.yawk.lz4/lz4-java","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"1.8.1"}],"ecosystem":"Maven","package":"org.lz4:lz4-java","purl":"pkg:maven/org.lz4/lz4-java","source":"ghsa"}],"references":[{"url":"https://github.com/yawkat/lz4-java/security/advisories/GHSA-4v53-57pg-c464","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/yawkat/lz4-java/commit/bb83dd16163cdb71231af06b0a5651881148a634","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/yawkat/lz4-java/releases/tag/v1.11.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106452","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/yawkat/lz4-java","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-10-07T10:45:08.750Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-106452","url":"https://www.cve.org/CVERecord?id=CVE-2026-106452","licence":"CVE Terms of Use","modified":"2026-10-07T10:45:18.010Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-4v53-57pg-c464","url":"https://github.com/advisories/GHSA-4v53-57pg-c464","licence":"CC-BY-4.0","modified":"2026-10-07T16:30:04.845Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-106452","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106452","licence":"Public domain","modified":"2026-10-07T13:58:29.527Z"}],"updatedAt":"2026-11-25T22:59:42.516Z","epss":{"score":0.00454,"percentile":0.41108,"date":"2026-12-01T12:00:22.000Z"}}