GHSA-h6gw-r52c-724r: Tensorflow NULL Pointer Dereference And Access Vulnerability

CRITICAL
CVSS 9.3
CWE-824 CWE-476
Published
Advisory Summary

GHSA-h6gw-r52c-724r is a CRITICAL (CVSS 9.3) null pointer dereference and access vulnerability (CWE-824: Access of Uninitialized Pointer) affecting Tensorflow libraries in the PyPI ecosystem. The issue involves null pointer dereference and access of uninitialized pointer in tensorflow. Remediation is available by upgrading affected packages to version 2.5.3, 2.6.3, 2.7.1.

GHSA-h6gw-r52c-724r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h6gw-r52c-724r
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-824: Access of Uninitialized Pointer
Affected Product Tensorflow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.3

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

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-h6gw-r52c-724r

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

tensorflow fixed: 2.5.3
pip install tensorflow>=2.5.3
tensorflow fixed: 2.6.3
pip install tensorflow>=2.6.3
tensorflow fixed: 2.7.1
pip install tensorflow>=2.7.1
tensorflow-cpu fixed: 2.5.3
pip install tensorflow-cpu>=2.5.3
tensorflow-cpu fixed: 2.6.3
pip install tensorflow-cpu>=2.6.3
tensorflow-cpu fixed: 2.7.1
pip install tensorflow-cpu>=2.7.1
tensorflow-gpu fixed: 2.5.3
pip install tensorflow-gpu>=2.5.3
tensorflow-gpu fixed: 2.6.3
pip install tensorflow-gpu>=2.6.3
tensorflow-gpu fixed: 2.7.1
pip install tensorflow-gpu>=2.7.1
Verify Direct and Transitive Dependencies

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

pip show tensorflow

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-h6gw-r52c-724r, inspect your installed packages using pip:

pip show tensorflow

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

Note: The pip show tensorflow command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-824: Access of Uninitialized Pointer, where the product accesses or uses a pointer that has not been initialized. In Tensorflow, 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

### Impact The [code for boosted trees in TensorFlow](https://github.com/tensorflow/tensorflow/blob/e0b6e58c328059829c3eb968136f17aa72b6c876/tensorflow/core/kernels/boosted_trees/stats_ops.cc) is still missing validation. This allows malicious users to read and write outside of bounds of heap allocated data as well as trigger denial of service (via dereferencing `nullptr`s or via `CHECK`-failures). This follows after CVE-2021-41208 where these APIs were still vulnerable to multiple security issues. **Note**: Given that the boosted trees implementation in TensorFlow is unmaintained, it is recommend to no longer use these APIs. Instead, please use the downstream [TensorFlow Decision Forests](https://github.com/tensorflow/decision-forests) project which is newer and supports more features. These APIs are now deprecated in TensorFlow 2.8. We will remove TensorFlow's boosted trees APIs in subsequent releases. ### Patches We have patched the known issues in multiple GitHub commits. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range. This should allow users to use existing boosted trees APIs for a while until they migrate to [TensorFlow Decision Forests](https://github.com/tensorflow/decision-forests), while guaranteeing that known vulnerabilities are fixed. ### For more information Please consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions. ### Attribution These vulnerabilities have been reported by Yu Tian of Qihoo 360 AIVul Team and Faysal Hossain Shezan from University of Virginia. Some of the issues have been discovered internally after a careful audit of the APIs.

GHSA-h6gw-r52c-724r Affected Tensorflow Versions

9 component(s)
Fixed Versions:
2.5.32.6.32.7.1
Product / Package Ecosystem Affected Versions Fixed Version
tensorflow
PyPI
< 2.5.3
2.5.3
tensorflow
PyPI
≥ 2.6.0
< 2.6.3
2.6.3
tensorflow
PyPI
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
2.7.1
tensorflow-cpu
PyPI
< 2.5.3
2.5.3
tensorflow-cpu
PyPI
≥ 2.6.0
< 2.6.3
2.6.3
tensorflow-cpu
PyPI
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
2.7.1
tensorflow-gpu
PyPI
< 2.5.3
2.5.3
tensorflow-gpu
PyPI
≥ 2.6.0
< 2.6.3
2.6.3
tensorflow-gpu
PyPI
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
2.7.1

References

Frequently Asked Questions

What is GHSA-h6gw-r52c-724r?
GHSA-h6gw-r52c-724r is a security vulnerability in Tensorflow involving NULL Pointer Dereference and Access of Uninitialized Pointer in TensorFlow under CWE-824: Access of Uninitialized Pointer.
Which Tensorflow versions are affected?
Affected versions include releases prior to 2.5.3, 2.6.3, 2.7.1 across affected packages: tensorflow, tensorflow-cpu, tensorflow-gpu.
What version fixes GHSA-h6gw-r52c-724r?
Upgrading to 2.5.3, 2.6.3, 2.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tensorflow affected?
Yes, tensorflow is affected in releases prior to 2.5.3, 2.6.3, 2.7.1. Upgrade your dependency to 2.5.3, 2.6.3, 2.7.1 or later.
Is tensorflow-cpu affected?
Yes, tensorflow-cpu is affected in releases prior to 2.5.3, 2.6.3, 2.7.1. Upgrade your dependency to 2.5.3, 2.6.3, 2.7.1 or later.
What is the CVSS score of GHSA-h6gw-r52c-724r?
GHSA-h6gw-r52c-724r has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-h6gw-r52c-724r?
GHSA-h6gw-r52c-724r is classified under CWE-824: Access of Uninitialized Pointer (The product accesses or uses a pointer that has not been initialized.).
How can I check PyPI dependencies for GHSA-h6gw-r52c-724r?
Run the dependency tree command: 'pip show tensorflow'. 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-h6gw-r52c-724r",
  "modified" : "2022-02-03T23:09:44Z",
  "published" : "2022-02-09T23:38:36Z",
  "aliases" : [ ],
  "summary" : "NULL Pointer Dereference and Access of Uninitialized Pointer in TensorFlow",
  "details" : "### Impact \nThe [code for boosted trees in TensorFlow](https://github.com/tensorflow/tensorflow/blob/e0b6e58c328059829c3eb968136f17aa72b6c876/tensorflow/core/kernels/boosted_trees/stats_ops.cc) is still missing validation. This allows malicious users to read and write outside of bounds of heap allocated data as well as trigger denial of service (via dereferencing `nullptr`s or via `CHECK`-failures).\n\nThis follows after CVE-2021-41208 where these APIs were still vulnerable to multiple security issues.\n\n**Note**: Given that the boosted trees implementation in TensorFlow is unmaintained, it is recommend to no longer use these APIs.  Instead, please use the downstream [TensorFlow Decision Forests](https://github.com/tensorflow/decision-forests) project which is newer and supports more features. \n  \nThese APIs are now deprecated in TensorFlow 2.8. We will remove TensorFlow's boosted trees APIs in subsequent releases.\n  \n### Patches\nWe have patched the known issues in multiple GitHub commits.\n  \nThe fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.\n\nThis should allow users to use existing boosted trees APIs for a while until they migrate to [TensorFlow Decision Forests](https://github.com/tensorflow/decision-forests), while guaranteeing that known vulnerabilities are fixed.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.\n\n### Attribution\nThese vulnerabilities have been reported by Yu Tian of Qihoo 360 AIVul Team and Faysal Hossain Shezan from University of Virginia. Some of the issues have been discovered internally after a careful audit of the APIs.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ],
    "versions" : [ "2.7.0" ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-cpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-cpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-cpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ],
    "versions" : [ "2.7.0" ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-gpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-gpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.6.0"
      }, {
        "fixed" : "2.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-gpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.7.0"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ],
    "versions" : [ "2.7.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-57wx-m983-2f88"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-h6gw-r52c-724r"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tensorflow/tensorflow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/blob/e0b6e58c328059829c3eb968136f17aa72b6c876/tensorflow/core/kernels/boosted_trees/stats_ops.cc"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476", "CWE-824" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-03T23:09:44Z",
    "nvd_published_at" : null
  }
}