VYPR
Moderate severityNVD Advisory· Published Sep 16, 2022· Updated Apr 23, 2025

`CHECK` fail in `TensorListFromTensor` in TensorFlow

CVE-2022-35992

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.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflowPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-cpuPyPI
< 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-gpuPyPI
< 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
>= 2.9.0, < 2.9.12.9.1

Affected products

1

Patches

1
3db59a042a38

Check for element_shape in TensorListFromTensor

https://github.com/tensorflow/tensorflowA. Unique TensorFlowerJul 21, 2022via ghsa
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

News mentions

0

No linked articles in our index yet.