Skip to content
Heist/ feed
Back to feed
High

snappy-java — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-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`. 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 o

Products
snappy-java
Affected versions
1.0.4.1~dfsg-1, 1.1.1.7-2, 1.1.10.5-1, 1.1.10.5-1build1, 1.1.10.7-1, 1.1.10.8-1, 1.1.2-1, 1.1.2.1-2, 1.1.4-1, 1.1.7.2-1, 1.1.7.3-1, 1.1.7.3-1build1, 1.1.8.3-1
Fixed versions
Not specified
CVEs
CVE-2023-34454
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 01:41 UTC · Revision 1

Source evidence

UBUNTU-CVE-2023-34454

core-osv · Original source

Published 15 Jun 2023, 17:15 UTC

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 o

osv:UBUNTU-CVE-2023-34454

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

snappy-java

Fixed versions: Not specified

Complete source record
{
  "id": "9ae487a710494289d374a13cc4129a5beaa43797b8f088634a9dbd0d694cb258",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2023-34454",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2023-34454",
    "summary": "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 o",
    "evidence": "osv:UBUNTU-CVE-2023-34454",
    "products": [
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.4.1~dfsg-1",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.1.7-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.1.2-1",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.1.2.1-2",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.4-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.7.2-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.1.7.3-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.1.7.3-1build1",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.8.3-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.8.3-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.1.10.5-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.1.10.5-1build1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.10.7-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.10.8-1",
            "evidence": "/affected/7/versions"
          }
        ]
      },
      {
        "name": {
          "value": "snappy-java",
          "evidence": "/affected/8/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.1.10.7-1",
            "evidence": "/affected/8/versions"
          },
          {
            "value": "1.1.10.8-1",
            "evidence": "/affected/8/versions"
          }
        ]
      }
    ],
    "severity": "high",
    "structured": {
      "id": "UBUNTU-CVE-2023-34454",
      "aliases": [
        "UBUNTU-CVE-2023-34454"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=trusty",
            "ecosystem": "Ubuntu:14.04:LTS"
          },
          "versions": [
            "1.0.4.1~dfsg-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.0.4.1~dfsg-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "1.1.1.7-2",
            "1.1.2-1",
            "1.1.2.1-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.2.1-2"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.2.1-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "1.1.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.4-1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "1.1.7.2-1",
            "1.1.7.3-1",
            "1.1.7.3-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.7.3-1build1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.7.3-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "1.1.8.3-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.8.3-1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.8.3-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "1.1.8.3-1",
            "1.1.10.5-1",
            "1.1.10.5-1build1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.10.5-1build1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.10.5-1build1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.1.10.7-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.10.7-1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.10.7-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.1.10.8-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.10.8-1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.10.8-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "snappy-java",
            "purl": "pkg:deb/ubuntu/snappy-java?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "1.1.10.7-1",
            "1.1.10.8-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-34454.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "libsnappy-java",
                "binary_version": "1.1.10.8-1"
              },
              {
                "binary_name": "libsnappy-jni",
                "binary_version": "1.1.10.8-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:57:19.168665329Z",
      "provider": "osv",
      "upstream": [
        "CVE-2023-34454"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2023-34454",
        "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/security/advisories/GHSA-fjpj-2g6w-x25r",
        "https://github.com/xerial/snappy-java/commit/d0042551e4a3509a725038eb9b2ad1f683674d94",
        "https://www.cve.org/CVERecord?id=CVE-2023-34454"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2023-34454",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/1/score"
  },
  "source_id": "core-osv",
  "document_id": 357180,
  "published_at": "2023-06-15T17:15:00+00:00"
}