{"id":"CVE-2023-34455","published":"2023-06-15T17:15:00Z","modified":"2025-02-13T16:55:35Z","title":"snappy-java's unchecked chunk length leads to DoS","vendor":"xerial","product":"snappy-java","tier":"tail","description":{"text":"snappy-java is a fast compressor/decompressor for Java. Due to use of an unchecked chunk length, an unrecoverable fatal error can occur in versions prior to 1.1.10.1.\n\nThe code in the function hasNextChunk in the fileSnappyInputStream.java checks if a given stream has more chunks to read. It does that by attempting to read 4 bytes. If it wasn’t possible to read the 4 bytes, the function returns false. Otherwise, if 4 bytes were available, the code treats them as the length of the next chunk.\n\nIn the case that the `compressed` variable is null, a byte array is allocated with the size given by the input data. Since the code doesn’t test the legality of the `chunkSize` variable, it is possible to pass a negative number (such as 0xFFFFFFFF which is -1), which will cause the code to raise a `java.lang.NegativeArraySizeException` exception. A worse case would happen when passing a huge positive value (such as 0x7FFFFFFF), which would raise the fatal `java.lang.OutOfMemoryError` error.\n\nVersion 1.1.10.1 contains a patch for this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01762,"percentile":0.78479,"provenance":"source"},"cwes":[{"id":"CWE-770","name":"Allocation of Resources Without Limits or Throttling"}],"references":[{"url":"https://github.com/xerial/snappy-java/security/advisories/GHSA-qcwq-55hx-v3vh","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/xerial/snappy-java/commit/3bf67857fcf70d9eea56eed4af7c925671e8eaea","tags":["x_refsource_MISC"]},{"url":"https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/SnappyInputStream.java#L388","tags":["x_refsource_MISC"]},{"url":"https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/SnappyInputStream.java","tags":["x_refsource_MISC"]},{"url":"https://security.netapp.com/advisory/ntap-20230818-0009/","tags":[]}],"priority":{"score":20.9,"factors":[{"name":"EPSS percentile","points":15.7},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"xerial","affectedVersions":[{"vendor":"xerial","product":"snappy-java","versions":["< 1.1.10.1"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2024-12-11T21:14:09.247879Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Maven","package":"org.xerial.snappy:snappy-java","vulnerableRanges":["<1.1.10.1"],"patched":["1.1.10.1"],"from":["GHSA-qcwq-55hx-v3vh"],"provenance":"source"}],"summary":{"text":"The flaw is in the hasNextChunk function of SnappyInputStream.java in xerial's snappy-java, a Java compressor/decompressor library, where the chunk length read from the stream is not validated before use.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T07:12:45Z"},"euvd":{"id":"EUVD-2023-1867","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-xerial-snappy-java-cve-2023-34454","children":[{"from":"CVE-2023-34455","to":"CVE-2023-43642","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/main/java/org/xerial/snappy/SnappyInputStream.java"],"commits":["https://github.com/xerial/snappy-java/commit/3bf67857fcf70d9eea56eed4af7c925671e8eaea","https://github.com/xerial/snappy-java/commit/9f8c3cf74223ed0a8a834134be9c917b9f10ceb5"],"basis":"shared function","functions":["hasNextChunk"]}]},{"from":"CVE-2023-34455","to":"CVE-2026-108104","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/main/java/org/xerial/snappy/SnappyInputStream.java"],"commits":["https://github.com/xerial/snappy-java/commit/3bf67857fcf70d9eea56eed4af7c925671e8eaea","https://github.com/xerial/snappy-java/commit/139a53090a6662298924fd75d21f4769b4a219ea"],"basis":"shared function","functions":["hasNextChunk"]}]}]}}