GHSA-h6gw-r52c-724r: Tensorflow NULL Pointer Dereference And Access Vulnerability
CRITICALGHSA-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
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).
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.
pip install tensorflow>=2.5.3
pip install tensorflow>=2.6.3
pip install tensorflow>=2.7.1
pip install tensorflow-cpu>=2.5.3
pip install tensorflow-cpu>=2.6.3
pip install tensorflow-cpu>=2.7.1
pip install tensorflow-gpu>=2.5.3
pip install tensorflow-gpu>=2.6.3
pip install tensorflow-gpu>=2.7.1
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
GHSA-h6gw-r52c-724r Affected Tensorflow Versions
9 component(s)| 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?
Which Tensorflow versions are affected?
What version fixes GHSA-h6gw-r52c-724r?
Is tensorflow affected?
Is tensorflow-cpu affected?
What is the CVSS score of GHSA-h6gw-r52c-724r?
What CWE is associated with GHSA-h6gw-r52c-724r?
How can I check PyPI dependencies for GHSA-h6gw-r52c-724r?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}