Double FreeAffected versions of this package are vulnerable to Double Free via SnappyFramedInputStream in src/main/java/org/xerial/snappy/SnappyFramedInputStream.java. An attacker can make two SnappyFramedInputStream instances share the same backing array by supplying framed data with a large declared chunk length that triggers an allocation failure during buffer growth. When the stream returns its current direct and array buffers to the pool and the replacement allocation fails, close() can release the same buffers again. In deployments using the default caching buffer pool, a later stream may receive that reused buffer and read or overwrite another stream’s decompressed data.
Workarounds
- Discard the buffer pool after an
OutOfMemoryError during decompression, so the same released buffers are not reused by later SnappyFramedInputStream instances.
- Pass a non-caching
BufferPool to SnappyFramedInputStream, so buffers are not retained and handed out again to another stream after a failed allocation.
How to fix Double Free? Upgrade org.xerial.snappy:snappy-java to version 1.1.10.10 or higher.
| |
Out-of-bounds WriteAffected versions of this package are vulnerable to Out-of-bounds Write via the Snappy.uncompress(ByteBuffer, ByteBuffer) method in org/xerial/snappy/Snappy.java. An attacker can trigger JVM termination by supplying valid compressed input that expands beyond the destination ByteBuffer capacity. The vulnerable code does not validate the output buffer size against the decompressed size, so writes past the buffer boundary occur during decompression, crashing applications that process attacker-controlled Snappy data.
How to fix Out-of-bounds Write? Upgrade org.xerial.snappy:snappy-java to version 1.1.10.10 or higher.
| |