GHSA-9q5j-jm53-v7vr: Lz4 sys Lz4-sys Vulnerable To Memory Corruption Vulnerability

CRITICAL
CVSS 9.8
CWE-190 CWE-787
Published
Advisory Summary

GHSA-9q5j-jm53-v7vr is a CRITICAL (CVSS 9.8) lz4-sys vulnerable to memory corruption vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Lz4 sys libraries in the crates.io ecosystem. The issue involves lz4-sys vulnerable to memory corruption via issue in liblz4. Remediation is available by upgrading affected packages to version 1.9.4.

GHSA-9q5j-jm53-v7vr at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-9q5j-jm53-v7vr
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product Lz4 sys
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-9q5j-jm53-v7vr

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

lz4-sys fixed: 1.9.4
Upgrade lz4-sys to 1.9.4
Verify Direct and Transitive Dependencies

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

inspect dependencies for lz4-sys

How to Check if You Are Affected

To determine whether your application is affected by GHSA-9q5j-jm53-v7vr, inspect your project dependencies for Lz4 sys:

inspect dependencies for lz4-sys

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

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Lz4 sys, 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

lz4-sys up to v1.9.3 bundles a version of liblz4 that is vulnerable to [CVE-2021-3520](https://nvd.nist.gov/vuln/detail/CVE-2021-3520). Attackers could craft a payload that triggers an integer overflow upon decompression, causing an out-of-bounds write. The flaw has been corrected in version v1.9.4 of liblz4, which is included in lz4-sys 1.9.4.

GHSA-9q5j-jm53-v7vr Affected Lz4 sys Versions

1 component(s)
Fixed Versions:
1.9.4
Product / Package Ecosystem Affected Versions Fixed Version
lz4-sys
crates.io
< 1.9.4
1.9.4

References

Frequently Asked Questions

What is GHSA-9q5j-jm53-v7vr?
GHSA-9q5j-jm53-v7vr is a security vulnerability in Lz4 sys involving lz4-sys vulnerable to memory corruption via issue in liblz4 under CWE-190: Integer Overflow or Wraparound.
Which Lz4 sys versions are affected?
Affected versions include releases prior to 1.9.4 across affected packages: lz4-sys.
What version fixes GHSA-9q5j-jm53-v7vr?
Upgrading to 1.9.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lz4-sys affected?
Yes, lz4-sys is affected in releases prior to 1.9.4. Upgrade your dependency to 1.9.4 or later.
What is the CVSS score of GHSA-9q5j-jm53-v7vr?
GHSA-9q5j-jm53-v7vr has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-9q5j-jm53-v7vr?
GHSA-9q5j-jm53-v7vr is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check crates.io dependencies for GHSA-9q5j-jm53-v7vr?
Run the dependency tree command: 'inspect dependencies for lz4-sys'. 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-9q5j-jm53-v7vr",
  "modified" : "2022-09-01T22:24:55Z",
  "published" : "2022-09-01T22:24:55Z",
  "aliases" : [ ],
  "summary" : "lz4-sys vulnerable to memory corruption via issue in liblz4",
  "details" : "lz4-sys up to v1.9.3 bundles a version of liblz4 that is vulnerable to\n[CVE-2021-3520](https://nvd.nist.gov/vuln/detail/CVE-2021-3520).\n\nAttackers could craft a payload that triggers an integer overflow upon\ndecompression, causing an out-of-bounds write.\n\nThe flaw has been corrected in version v1.9.4 of liblz4, which is included\nin lz4-sys 1.9.4.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lz4-sys"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.9.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lz4/lz4/pull/972"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0051.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190", "CWE-787" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-01T22:24:55Z",
    "nvd_published_at" : null
  }
}