org.xerial.snappy:snappy-java@1.1.10.7

  • latest version

    1.1.10.12

  • latest non vulnerable version

  • first published

    15 years ago

  • latest version published

    1 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.xerial.snappy:snappy-java package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Improper Validation of Array Index

    Affected versions of this package are vulnerable to Improper Validation of Array Index via the Snappy.arrayCopy and SnappyOutputStream.rawWrite functions. An attacker can cause the JVM to crash or trigger out-of-bounds memory access by supplying negative or oversized values for parameters, leading to reading or writing outside array bounds.

    How to fix Improper Validation of Array Index?

    Upgrade org.xerial.snappy:snappy-java to version 1.1.10.9 or higher.

    [,1.1.10.9)
    • M
    Double Free

    Affected 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.

    [,1.1.10.10)
    • H
    Memory Allocation with Excessive Size Value

    Affected versions of this package are vulnerable to Memory Allocation with Excessive Size Value through the Snappy.uncompressedLength and decompression paths in Snappy.java and SnappyFramedInputStream. An attacker can exhaust JVM memory by supplying a crafted compressed payload that advertises a huge uncompressed size, causing Snappy.uncompress, Snappy.uncompressString, array decompression helpers, or framed stream decompression to allocate an oversized output buffer before validating the length. This can trigger OutOfMemoryError or a NegativeArraySizeException from only a few bytes of attacker-controlled input. The result is denial of service for applications that accept untrusted Snappy-compressed data.

    Workarounds

    • Before decompressing untrusted data, call Snappy.uncompressedLength(input) and reject inputs whose declared uncompressed length exceeds an application-specific maximum; this prevents attacker-supplied payloads from forcing oversized JVM allocations during Snappy decompression.

    How to fix Memory Allocation with Excessive Size Value?

    Upgrade org.xerial.snappy:snappy-java to version 1.1.10.9 or higher.

    [,1.1.10.9)
    • H
    Out-of-bounds Write

    Affected versions of this package are vulnerable to Out-of-bounds Write via the Snappy.compress function. An attacker can cause memory corruption and force the Java Virtual Machine to terminate by providing incompressible data that exceeds the remaining capacity of the destination buffer.

    How to fix Out-of-bounds Write?

    Upgrade org.xerial.snappy:snappy-java to version 1.1.10.9 or higher.

    [0,1.1.10.9)
    • M
    Out-of-bounds Write

    Affected versions of this package are vulnerable to Out-of-bounds Write through the Snappy.uncompress*Array methods. An attacker can corrupt heap memory and potentially cause application crashes or unexpected behavior by supplying specially crafted compressed input that results in misaligned length values, leading to writes past array bounds.

    How to fix Out-of-bounds Write?

    Upgrade org.xerial.snappy:snappy-java to version 1.1.10.9 or higher.

    [0,1.1.10.9)
    • H
    Out-of-bounds Write

    Affected 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.

    [0,1.1.10.10)