GHSA-x3f4-45xf-rjm7: Ruzstd `ruzstd` Uninit And Out-of-bounds Memory Vulnerability

MODERATE
CWE-125
Published
Advisory Summary

GHSA-x3f4-45xf-rjm7 is a MODERATE `ruzstd` uninit and out-of-bounds memory vulnerability (CWE-125: Out-of-bounds Read) affecting Ruzstd libraries in the crates.io ecosystem. The issue involves `ruzstd` uninit and out-of-bounds memory reads. Remediation is available by upgrading affected packages to version 0.7.3.

GHSA-x3f4-45xf-rjm7 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-x3f4-45xf-rjm7
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Ruzstd
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-x3f4-45xf-rjm7

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

ruzstd fixed: 0.7.3
Upgrade ruzstd to 0.7.3
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 ruzstd

How to Check if You Are Affected

To determine whether your application is affected by GHSA-x3f4-45xf-rjm7, inspect your project dependencies for Ruzstd:

inspect dependencies for ruzstd

Analyze the terminal output to locate any version of Ruzstd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.3), 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-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Ruzstd, 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

Affected versions of `ruzstd` miscalculate the length of the allocated and init section of its internal `RingBuffer`, leading to uninitialized or out-of-bounds reads in `copy_bytes_overshooting` of up to 15 bytes. This may result in up to 15 bytes of memory contents being written into the decoded data when decompressing a crafted archive. This may occur multiple times per archive.

GHSA-x3f4-45xf-rjm7 Affected Ruzstd Versions

1 component(s)
Fixed Versions:
0.7.3
Product / Package Ecosystem Affected Versions Fixed Version
ruzstd
crates.io
≥ 0.7.0
< 0.7.3
0.7.3

References

Frequently Asked Questions

What is GHSA-x3f4-45xf-rjm7?
GHSA-x3f4-45xf-rjm7 is a security vulnerability in Ruzstd involving `ruzstd` uninit and out-of-bounds memory reads under CWE-125: Out-of-bounds Read.
Which Ruzstd versions are affected?
Affected versions include releases prior to 0.7.3 across affected packages: ruzstd.
What version fixes GHSA-x3f4-45xf-rjm7?
Upgrading to 0.7.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ruzstd affected?
Yes, ruzstd is affected in releases prior to 0.7.3. Upgrade your dependency to 0.7.3 or later.
What CWE is associated with GHSA-x3f4-45xf-rjm7?
GHSA-x3f4-45xf-rjm7 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 crates.io dependencies for GHSA-x3f4-45xf-rjm7?
Run the dependency tree command: 'inspect dependencies for ruzstd'. 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-x3f4-45xf-rjm7",
  "modified" : "2024-12-02T21:34:27Z",
  "published" : "2024-12-02T21:34:27Z",
  "aliases" : [ ],
  "summary" : "`ruzstd` uninit and out-of-bounds memory reads",
  "details" : "Affected versions of `ruzstd` miscalculate the length of the allocated and init section of its internal `RingBuffer`, leading to uninitialized or out-of-bounds reads in `copy_bytes_overshooting` of up to 15 bytes.\n\nThis may result in up to 15 bytes of memory contents being written into the decoded data when decompressing a crafted archive. This may occur multiple times per archive.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "ruzstd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.7.0"
      }, {
        "fixed" : "0.7.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/KillingSpark/zstd-rs/issues/75"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/KillingSpark/zstd-rs/pull/76"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/KillingSpark/zstd-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0400.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-02T21:34:27Z",
    "nvd_published_at" : null
  }
}