GHSA-5j8w-r7g8-5472: Arrow2 Arrow2 Allows Double Free Vulnerability

HIGH
CWE-415
Published
Advisory Summary

GHSA-5j8w-r7g8-5472 is a HIGH arrow2 allows double free vulnerability (CWE-415: Double Free) affecting Arrow2 libraries in the crates.io ecosystem. The issue involves arrow2 allows double free in `safe` code. Remediation is available by upgrading affected packages to version 0.7.1, 0.8.2, 0.9.2.

GHSA-5j8w-r7g8-5472 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5j8w-r7g8-5472
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-415: Double Free
Affected Product Arrow2
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-5j8w-r7g8-5472

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

arrow2 fixed: 0.7.1
Upgrade arrow2 to 0.7.1
arrow2 fixed: 0.8.2
Upgrade arrow2 to 0.8.2
arrow2 fixed: 0.9.2
Upgrade arrow2 to 0.9.2
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 arrow2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-5j8w-r7g8-5472, inspect your project dependencies for Arrow2:

inspect dependencies for arrow2

Analyze the terminal output to locate any version of Arrow2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.1), 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-415: Double Free, where the product calls free() twice on the same memory address. In Arrow2, 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

The struct `Ffi_ArrowArray` implements `#derive(Clone)` that is inconsistent with its custom implementation of `Drop`, resulting in a double free when cloned. Cloning this struct in `safe` results in a segmentation fault, which is unsound. This derive was removed from this struct. All users are advised to either: * bump the patch version of this crate (for versions `v0.7,v0.8,v0.9`), or * migrate to a more recent version of the crate (when using `<0.7`). Doing so elimitates this vulnerability (code no longer compiles).

GHSA-5j8w-r7g8-5472 Affected Arrow2 Versions

3 component(s)
Fixed Versions:
0.7.10.8.20.9.2
Product / Package Ecosystem Affected Versions Fixed Version
arrow2
crates.io
< 0.7.1
0.7.1
arrow2
crates.io
≥ 0.8.0
< 0.8.2
0.8.2
arrow2
crates.io
≥ 0.9.0
< 0.9.2
0.9.2

References

Frequently Asked Questions

What is GHSA-5j8w-r7g8-5472?
GHSA-5j8w-r7g8-5472 is a security vulnerability in Arrow2 involving Arrow2 allows double free in `safe` code under CWE-415: Double Free.
Which Arrow2 versions are affected?
Affected versions include releases prior to 0.7.1, 0.8.2, 0.9.2 across affected packages: arrow2.
What version fixes GHSA-5j8w-r7g8-5472?
Upgrading to 0.7.1, 0.8.2, 0.9.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is arrow2 affected?
Yes, arrow2 is affected in releases prior to 0.7.1, 0.8.2, 0.9.2. Upgrade your dependency to 0.7.1, 0.8.2, 0.9.2 or later.
What CWE is associated with GHSA-5j8w-r7g8-5472?
GHSA-5j8w-r7g8-5472 is classified under CWE-415: Double Free (The product calls free() twice on the same memory address.).
How can I check crates.io dependencies for GHSA-5j8w-r7g8-5472?
Run the dependency tree command: 'inspect dependencies for arrow2'. 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-5j8w-r7g8-5472",
  "modified" : "2022-06-16T23:42:08Z",
  "published" : "2022-06-16T23:42:08Z",
  "aliases" : [ ],
  "summary" : "Arrow2 allows double free in `safe` code",
  "details" : "The struct `Ffi_ArrowArray` implements `#derive(Clone)` that is inconsistent with\nits custom implementation of `Drop`, resulting in a double free when cloned.\n\nCloning this struct in `safe` results in a segmentation fault, which is unsound.\n\nThis derive was removed from this struct. All users are advised to either:\n* bump the patch version of this crate (for versions `v0.7,v0.8,v0.9`), or\n* migrate to a more recent version of  the crate (when using `<0.7`).\n\nDoing so elimitates this vulnerability (code no longer compiles).\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "arrow2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "arrow2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.0"
      }, {
        "fixed" : "0.8.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "arrow2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0"
      }, {
        "fixed" : "0.9.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jorgecarleitao/arrow2/issues/880"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jorgecarleitao/arrow2"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2022-0012.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-415" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:42:08Z",
    "nvd_published_at" : null
  }
}