An update for snappy-java is now available for openEuler-20.03-LTS-SP1,openEuler-20.03-LTS-SP3,openEuler-22.03-LTS,openEuler-22.03-LTS-SP1 and openEuler-22.03-LTS-SP2 Security Advisory openeuler-security@openeuler.org openEuler security committee openEuler-SA-2023-1398 Final 1.0 1.0 2023-07-08 Initial 2023-07-08 2023-07-08 openEuler SA Tool V1.0 2023-07-08 snappy-java security update An update for snappy-java is now available for openEuler-20.03-LTS-SP1,openEuler-20.03-LTS-SP3,openEuler-22.03-LTS,openEuler-22.03-LTS-SP1 and openEuler-22.03-LTS-SP2. A Java port of the snappy, a fast compresser/decompresser written in C++. Security Fix(es): 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`. 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. The 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. Version 1.1.10.1 contains a patch for this issue.(CVE-2023-34454) 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. 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. Version 1.1.10.1 contains a patch for this issue.(CVE-2023-34455) An update for snappy-java is now available for openEuler-20.03-LTS-SP1,openEuler-20.03-LTS-SP3,openEuler-22.03-LTS,openEuler-22.03-LTS-SP1 and openEuler-22.03-LTS-SP2. openEuler Security has rated this update as having a security impact of high. A Common Vunlnerability Scoring System(CVSS)base score,which gives a detailed severity rating, is available for each vulnerability from the CVElink(s) in the References section. High snappy-java https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1398 https://www.openeuler.org/en/security/cve/detail.html?id=CVE-2023-34454 https://www.openeuler.org/en/security/cve/detail.html?id=CVE-2023-34455 https://nvd.nist.gov/vuln/detail/CVE-2023-34454 https://nvd.nist.gov/vuln/detail/CVE-2023-34455 openEuler-20.03-LTS-SP1 openEuler-20.03-LTS-SP3 openEuler-22.03-LTS openEuler-22.03-LTS-SP1 openEuler-22.03-LTS-SP2 snappy-java-1.1.2.4-2.oe1.aarch64.rpm snappy-java-1.1.2.4-2.oe1.aarch64.rpm snappy-java-1.1.2.4-2.oe2203.aarch64.rpm snappy-java-1.1.2.4-2.oe2203sp1.aarch64.rpm snappy-java-1.1.2.4-2.oe2203sp2.aarch64.rpm snappy-java-javadoc-1.1.2.4-2.oe1.noarch.rpm snappy-java-javadoc-1.1.2.4-2.oe1.noarch.rpm snappy-java-javadoc-1.1.2.4-2.oe2203.noarch.rpm snappy-java-javadoc-1.1.2.4-2.oe2203sp1.noarch.rpm snappy-java-javadoc-1.1.2.4-2.oe2203sp2.noarch.rpm snappy-java-1.1.2.4-2.oe1.src.rpm snappy-java-1.1.2.4-2.oe1.src.rpm snappy-java-1.1.2.4-2.oe2203.src.rpm snappy-java-1.1.2.4-2.oe2203sp1.src.rpm snappy-java-1.1.2.4-2.oe2203sp2.src.rpm snappy-java-1.1.2.4-2.oe1.x86_64.rpm snappy-java-1.1.2.4-2.oe1.x86_64.rpm snappy-java-1.1.2.4-2.oe2203.x86_64.rpm snappy-java-1.1.2.4-2.oe2203sp1.x86_64.rpm snappy-java-1.1.2.4-2.oe2203sp2.x86_64.rpm 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`. 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.The 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.Version 1.1.10.1 contains a patch for this issue. 2023-07-08 CVE-2023-34454 openEuler-20.03-LTS-SP1 openEuler-20.03-LTS-SP3 openEuler-22.03-LTS openEuler-22.03-LTS-SP1 openEuler-22.03-LTS-SP2 High 7.5 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H snappy-java security update 2023-07-08 https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1398 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. 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.Version 1.1.10.1 contains a patch for this issue. 2023-07-08 CVE-2023-34455 openEuler-20.03-LTS-SP1 openEuler-20.03-LTS-SP3 openEuler-22.03-LTS openEuler-22.03-LTS-SP1 openEuler-22.03-LTS-SP2 High 7.5 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H snappy-java security update 2023-07-08 https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1398