Moderate severityNVD Advisory· Published Feb 4, 2022· Updated Apr 22, 2025
Multiple `CHECK`-fails in `function.cc` in Tensorflow
CVE-2022-23586
Description
Tensorflow is an Open Source Machine Learning Framework. A malicious user can cause a denial of service by altering a SavedModel such that assertions in function.cc would be falsified and crash the Python interpreter. 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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | < 2.5.3 | 2.5.3 |
tensorflowPyPI | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflowPyPI | >= 2.7.0, < 2.7.1 | 2.7.1 |
tensorflow-cpuPyPI | < 2.5.3 | 2.5.3 |
tensorflow-cpuPyPI | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflow-cpuPyPI | >= 2.7.0, < 2.7.1 | 2.7.1 |
tensorflow-gpuPyPI | < 2.5.3 | 2.5.3 |
tensorflow-gpuPyPI | >= 2.6.0, < 2.6.3 | 2.6.3 |
tensorflow-gpuPyPI | >= 2.7.0, < 2.7.1 | 2.7.1 |
Affected products
1- Range: < 2.5.3
Patches
2dcc21c7bc972Eliminate debug `CHECK`-fail from `function.cc`
1 file changed · +5 −1
tensorflow/core/framework/function.cc+5 −1 modified@@ -191,7 +191,11 @@ class FunctionInstantiationHelper { for (size_t i = 0; i < dtypes.size(); ++i) { TF_RETURN_IF_ERROR(AddItem(strings::StrCat(arg_def.name(), ":", i), {true, arg_index, 0, false, {dtypes[i]}})); - DCHECK_EQ(arg_index, result_.nodes.size()); + if (arg_index != result_.nodes.size()) { + return errors::Internal( + "Expected arg_index to be equal to the number of nodes in result.", + " Got ", arg_index, " and ", result_.nodes.size()); + } string name = arg_def.name(); if (dtypes.size() > 1) { strings::StrAppend(&name, "_", i);
3d89911481baEliminate `CHECK`-fail from `function.cc`.
1 file changed · +3 −1
tensorflow/core/framework/function.cc+3 −1 modified@@ -181,7 +181,9 @@ class FunctionInstantiationHelper { DataTypeVector dtypes; TF_RETURN_IF_ERROR( ArgNumType(attr_values, arg_def, &is_type_list, &dtypes)); - CHECK_GE(dtypes.size(), size_t{1}); + if (dtypes.size() < size_t{1}) { + return errors::Internal("Expected a list of at least one dtype"); + } int arg_index = result_.nodes.size(); TF_RETURN_IF_ERROR( AddItem(arg_def.name(), {true, arg_index, 0, is_type_list, dtypes}));
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- github.com/advisories/GHSA-43jf-985q-588jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-23586ghsaADVISORY
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-95.yamlghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-150.yamlghsaWEB
- github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/framework/function.ccghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/commit/3d89911481ba6ebe8c88c1c0b595412121e6c645ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/commit/dcc21c7bc972b10b6fb95c2fb0f4ab5a59680ec2ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-43jf-985q-588jghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.