{"id":"CVE-2023-34454","published":"2023-06-15T16:27:45Z","modified":"2024-12-12T16:25:36Z","title":"snappy-java's Integer Overflow vulnerability in compress leads to DoS","vendor":"xerial","product":"snappy-java","tier":"tail","description":{"text":"snappy-java is a fast compressor/decompressor for Java. Due to unchecked multiplications, an integer overflow may occur in versions prior to 1.1.10.1, causing an unrecoverable fatal error.\n\nThe function `compress(char[] input)` in the file `Snappy.java` receives an array of characters and compresses it. It does so by multiplying the length by 2 and passing it to the rawCompress` function.\n\nSince the length is not tested, the multiplication by two can cause an integer overflow and become negative. The rawCompress function then uses the received length and passes it to the natively compiled maxCompressedLength function, using the returned value to allocate a byte array.\n\nSince the maxCompressedLength function treats the length as an unsigned integer, it doesn’t care that it is negative, and it returns a valid value, which is casted to a signed integer by the Java engine. If the result is negative, a `java.lang.NegativeArraySizeException` exception will be raised while trying to allocate the array `buf`. On the other side, if the result is positive, the `buf` array will successfully be allocated, but its size might be too small to use for the compression, causing a fatal Access Violation error.\n\nThe same issue exists also when using the `compress` functions that receive double, float, int, long and short, each using a different multiplier that may cause the same issue. The issue most likely won’t occur when using a byte array, since creating a byte array of size 0x80000000 (or any other negative value) is impossible in the first place.\n\nVersion 1.1.10.1 contains a patch for this issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.9,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01704,"percentile":0.77664,"provenance":"source"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"}],"references":[{"url":"https://github.com/xerial/snappy-java/security/advisories/GHSA-fjpj-2g6w-x25r","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94","tags":["x_refsource_MISC"]},{"url":"https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/Snappy.java#L169","tags":["x_refsource_MISC"]},{"url":"https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/Snappy.java#L422","tags":["x_refsource_MISC"]},{"url":"https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/Snappy.java","tags":["x_refsource_MISC"]}],"priority":{"score":19.7,"factors":[{"name":"EPSS percentile","points":15.53},{"name":"CVSS severity","points":4.13}]},"vendorSlug":"xerial","affectedVersions":[{"vendor":"xerial","product":"snappy-java","versions":["< 1.1.10.1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2024-12-12T16:25:27.375881Z","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-fjpj-2g6w-x25r"],"provenance":"source"}],"summary":{"text":"An attacker who can get the affected code to compress a sufficiently large input of these types can trigger an unrecoverable fatal error, causing denial of service; exploitation requires no privileges or user interaction but depends on the attacker being able to reach the vulnerable code path and supply the large input, and the issue is fixed in version 1.1.10.1.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:34:30Z"},"euvd":{"id":"EUVD-2023-1784","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-xerial-snappy-java-cve-2023-34454","children":[{"from":"CVE-2023-34454","to":"CVE-2026-108106","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/main/java/org/xerial/snappy/Snappy.java"],"commits":["https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94","https://github.com/xerial/snappy-java/commit/943c6043a292568575e8347af4507d015e802c75"],"basis":"shared function","functions":["compress"]}]},{"from":"CVE-2023-34454","to":"CVE-2026-116590","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/main/java/org/xerial/snappy/Snappy.java"],"commits":["https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94","https://github.com/xerial/snappy-java/commit/2d7ca71c087a98f1219fb2d51909f3891c3ce77b"],"basis":"shared function","functions":["compress"]}]},{"from":"CVE-2023-34454","to":"CVE-2026-93451","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/main/java/org/xerial/snappy/Snappy.java"],"commits":["https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94","https://github.com/xerial/snappy-java/commit/943c6043a292568575e8347af4507d015e802c75"],"basis":"shared function","functions":["compress"]}]}],"packageHistory":[{"cve":"CVE-2023-34453","published":"2023-06-15","fixed":"1.1.10.1","kev":false},{"cve":"CVE-2023-34454","published":"2023-06-15","fixed":"1.1.10.1","kev":false},{"cve":"CVE-2023-34455","published":"2023-06-15","fixed":"1.1.10.1","kev":false},{"cve":"CVE-2023-43642","published":"2023-09-25","fixed":"1.1.10.4","kev":false,"link":{"from":"CVE-2023-34454","to":"CVE-2023-43642","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Maven:org.xerial.snappy:snappy-java","fromFixed":"1.1.10.1","toFixed":"1.1.10.4","daysApart":102}]}},{"cve":"CVE-2026-108106","published":"2026-10-09","fixed":"1.1.10.9","kev":false}],"package":"Maven:org.xerial.snappy:snappy-java"}}