CVE-2024-36124: Snappy Iq80 Snappy Out-of-bounds Read When Vulnerability

MODERATE
Advisory Identifier: GHSA-8wh2-6qhj-h7j9
CVSS 5.3
CWE-125
Published
Advisory Summary

CVE-2024-36124 is a MODERATE (CVSS 5.3) iq80 snappy out-of-bounds read when vulnerability (CWE-125: Out-of-bounds Read) affecting Snappy libraries in the Maven ecosystem. The issue involves iq80 snappy out-of-bounds read when uncompressing data, leading to jvm crash. Remediation is available by upgrading affected packages to version 0.5.

CVE-2024-36124 at a Glance

CVE Identifier CVE-2024-36124
GHSA Identifier GHSA-8wh2-6qhj-h7j9
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Snappy
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-36124

To remediate this vulnerability, upgrade all affected Snappy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.iq80.snappy:snappy fixed: 0.5
<dependency>
    <groupId>org.iq80.snappy</groupId>
    <artifactId>snappy</artifactId>
    <version>0.5</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.iq80.snappy

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-36124, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.iq80.snappy

Analyze the terminal output to locate any version of Snappy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.iq80.snappy command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Snappy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary iq80 Snappy performs out-of-bounds read access when uncompressing certain data, which can lead to a JVM crash. ### Details When uncompressing certain data, Snappy tries to read outside the bounds of the given byte arrays. Because Snappy uses the JDK class `sun.misc.Unsafe` to speed up memory access, no additional bounds checks are performed and this has similar security consequences as out-of-bounds access in C or C++, namely it can lead to non-deterministic behavior or crash the JVM. iq80 Snappy is not actively maintained anymore. As quick fix users can upgrade to version 0.5, but in the long term users should prefer migrating to the Snappy implementation in https://github.com/airlift/aircompressor (version 0.27 or newer). ### Impact When uncompressing data from untrusted users, this can be exploited for a denial-of-service attack by crashing the JVM.

CVE-2024-36124 Affected Snappy Versions

1 component(s)
Fixed Versions:
0.5
Product / Package Ecosystem Affected Versions Fixed Version
org.iq80.snappy:snappy
Maven
< 0.5
0.5

References

Frequently Asked Questions

What is CVE-2024-36124?
CVE-2024-36124 is a security vulnerability in Snappy involving iq80 Snappy out-of-bounds read when uncompressing data, leading to JVM crash under CWE-125: Out-of-bounds Read.
Which Snappy versions are affected?
Affected versions include releases prior to 0.5 across affected packages: org.iq80.snappy:snappy.
What version fixes CVE-2024-36124?
Upgrading to 0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is snappy affected?
Yes, org.iq80.snappy:snappy is affected in releases prior to 0.5. Upgrade your dependency to 0.5 or later.
What is the CVSS score of CVE-2024-36124?
CVE-2024-36124 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-36124?
CVE-2024-36124 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check Maven dependencies for CVE-2024-36124?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.iq80.snappy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8wh2-6qhj-h7j9",
  "modified" : "2024-06-04T17:38:31Z",
  "published" : "2024-06-04T17:38:31Z",
  "aliases" : [ "CVE-2024-36124" ],
  "summary" : "iq80 Snappy out-of-bounds read when uncompressing data, leading to JVM crash",
  "details" : "### Summary\niq80 Snappy performs out-of-bounds read access when uncompressing certain data, which can lead to a JVM crash.\n\n### Details\nWhen uncompressing certain data, Snappy tries to read outside the bounds of the given byte arrays. Because Snappy uses the JDK class `sun.misc.Unsafe` to speed up memory access, no additional bounds checks are performed and this has similar security consequences as out-of-bounds access in C or C++, namely it can lead to non-deterministic behavior or crash the JVM.\n\niq80 Snappy is not actively maintained anymore. As quick fix users can upgrade to version 0.5, but in the long term users should prefer migrating to the Snappy implementation in https://github.com/airlift/aircompressor (version 0.27 or newer).\n\n### Impact\nWhen uncompressing data from untrusted users, this can be exploited for a denial-of-service attack by crashing the JVM.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.iq80.snappy:snappy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dain/snappy/security/advisories/GHSA-8wh2-6qhj-h7j9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-36124"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dain/snappy"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-04T17:38:31Z",
    "nvd_published_at" : "2024-06-03T15:15:09Z"
  }
}