{"id":"CVE-2026-106452","aliases":["GHSA-4v53-57pg-c464"],"url":"https://o3.security/vulnerability/CVE-2026-106452","summary":"yawkat LZ4 Java: LZ4BlockInputStream allocates an unvalidated compressed length from the stream header","details":"### 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.","published":"2026-10-06T19:52:37.818Z","modified":"2026-10-21T09:38:11.337426485Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"Maven","name":"at.yawk.lz4:lz4-java","fixedVersion":"1.11.2"},{"ecosystem":"Maven","name":"org.lz4:lz4-java","fixedVersion":null}],"fix":{"url":"https://github.com/yawkat/lz4-java/commit/bb83dd16163cdb71231af06b0a5651881148a634","label":"yawkat/lz4-java@bb83dd1"},"references":[{"type":"WEB","url":"https://github.com/yawkat/lz4-java/releases/tag/v1.11.2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/106xxx/CVE-2026-106452.json"},{"type":"ADVISORY","url":"https://github.com/yawkat/lz4-java/security/advisories/GHSA-4v53-57pg-c464"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106452"},{"type":"FIX","url":"https://github.com/yawkat/lz4-java/commit/bb83dd16163cdb71231af06b0a5651881148a634"},{"type":"PACKAGE","url":"https://github.com/yawkat/lz4-java"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-21T09:38:11.337426485Z"}}