`CHECK` fail in `TensorListFromTensor` in TensorFlow
Description
TensorFlow is an open source platform for machine learning. When TensorListFromTensor receives an element_shape of a rank greater than one, it gives a CHECK fail that can trigger a denial of service attack. We have patched the issue in GitHub commit 3db59a042a38f4338aa207922fa2f476e000a6ee. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | < 2.7.2 | 2.7.2 |
tensorflowPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflowPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-cpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-cpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-cpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-gpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-gpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-gpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
Affected products
1- Range: < 2.7.2
Patches
13db59a042a38Check for element_shape in TensorListFromTensor
2 files changed · +16 −0
tensorflow/core/kernels/list_kernels.h+5 −0 modified@@ -769,6 +769,11 @@ class TensorListFromTensor : public OpKernel { attr.set_on_host(true); OP_REQUIRES_OK(c, c->allocate_output(0, {}, &output_tensor, attr)); PartialTensorShape element_shape; + OP_REQUIRES( + c, !TensorShapeUtils::IsMatrixOrHigher(c->input(1).shape()), + errors::InvalidArgument( + "TensorListFromTensor: element_shape must be at most rank 1 but ", + "has the shape of ", c->input(1).shape().DebugString())); OP_REQUIRES_OK(c, TensorShapeFromTensor(c->input(1), &element_shape)); TensorList output_list; const Tensor& t = c->input(0);
tensorflow/python/kernel_tests/data_structures/list_ops_test.py+11 −0 modified@@ -584,6 +584,17 @@ def testTensorListFromTensor(self): self.assertAllEqual(e, 1.0) self.assertAllEqual(list_ops.tensor_list_length(l), 0) + def testTensorListFromTensorFailsWhenElementShapeIsNotVector(self): + t = constant_op.constant([1.0, 2.0]) + # In Eager mode, InvalidArgumentError is generated by the Compute function. + # In graph mode, ValueError is generated by the shape function. + with self.assertRaisesRegex( + (errors.InvalidArgumentError, ValueError), + "must be at most rank 1"): + # Wrong element_shape. Should be at most rank 1. + l = list_ops.tensor_list_from_tensor(t, element_shape=[[1]]) + self.evaluate(l) + @test_util.run_gpu_only def testFromTensorGPU(self): with context.device("gpu:0"):
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
5- github.com/advisories/GHSA-9v8w-xmr4-wgxpghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-35992ghsaADVISORY
- github.com/tensorflow/tensorflow/commit/3db59a042a38f4338aa207922fa2f476e000a6eeghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.10.0ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-9v8w-xmr4-wgxpghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.