CVE-2023-43642 – Missing upper bound check on chunk length in snappy-java
https://notcve.org/view.php?id=CVE-2023-43642
snappy-java is a Java port of the snappy, a fast C++ compresser/decompresser developed by Google. The SnappyInputStream was found to be vulnerable to Denial of Service (DoS) attacks when decompressing data with a too large chunk size. Due to missing upper bound check on chunk length, an unrecoverable fatal error can occur. All versions of snappy-java including the latest released version 1.1.10.3 are vulnerable to this issue. A fix has been introduced in commit `9f8c3cf74` which will be included in the 1.1.10.4 release. • https://github.com/xerial/snappy-java/commit/9f8c3cf74223ed0a8a834134be9c917b9f10ceb5 https://github.com/xerial/snappy-java/security/advisories/GHSA-55g7-9cwv-5qfv https://access.redhat.com/security/cve/CVE-2023-43642 https://bugzilla.redhat.com/show_bug.cgi?id=2241722 • CWE-770: Allocation of Resources Without Limits or Throttling •
CVE-2023-34455 – snappy-java's unchecked chunk length leads to DoS
https://notcve.org/view.php?id=CVE-2023-34455
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. The 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. In the case that the `compressed` variable is null, a byte array is allocated with the size given by the input data. • https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/SnappyInputStream.java#L388 https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/SnappyInputStream.java https://github.com/xerial/snappy-java/commit/3bf67857fcf70d9eea56eed4af7c925671e8eaea https://github.com/xerial/snappy-java/security/advisories/GHSA-qcwq-55hx-v3vh https://security.netapp.com/advisory/ntap-20230818-0009 https://access.redhat.com/security/cve/CVE-2023-34455 h • CWE-770: Allocation of Resources Without Limits or Throttling CWE-1285: Improper Validation of Specified Index, Position, or Offset in Input •
CVE-2023-34454 – snappy-java's Integer Overflow vulnerability in compress leads to DoS
https://notcve.org/view.php?id=CVE-2023-34454
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. The 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. Since 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. Since 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`. • https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/Snappy.java#L169 https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/Snappy.java#L422 https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/Snappy.java https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94 https://github.com/xerial/snappy-java/security/advisories/GHSA-fjpj-2g6w-x25r http • CWE-190: Integer Overflow or Wraparound •
CVE-2023-34453 – snappy-java's Integer Overflow vulnerability in shuffle leads to DoS
https://notcve.org/view.php?id=CVE-2023-34453
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 a fatal error. The function `shuffle(int[] input)` in the file `BitShuffle.java` receives an array of integers and applies a bit shuffle on it. It does so by multiplying the length by 4 and passing it to the natively compiled shuffle function. Since the length is not tested, the multiplication by four can cause an integer overflow and become a smaller value than the true size, or even zero or negative. In the case of a negative value, a `java.lang.NegativeArraySizeException` exception will raise, which can crash the program. • https://github.com/xerial/snappy-java/blob/05c39b2ca9b5b7b39611529cc302d3d796329611/src/main/java/org/xerial/snappy/BitShuffle.java#L107 https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/BitShuffle.java https://github.com/xerial/snappy-java/commit/820e2e074c58748b41dbd547f4edba9e108ad905 https://github.com/xerial/snappy-java/security/advisories/GHSA-pqr6-cmr2-h8hf https://access.redhat.com/security/cve/CVE-2023-34453 https://bugzilla.redhat.com/show_bug.cgi?id=2215393 • CWE-190: Integer Overflow or Wraparound •