VYPR
Moderate severityNVD Advisory· Published Nov 18, 2022· Updated Apr 22, 2025

`CHECK_EQ` fail in `tf.raw_ops.TensorListResize` in Tensorflow

CVE-2022-41893

Description

TensorFlow is an open source platform for machine learning. If tf.raw_ops.TensorListResize is given a nonscalar value for input size, it results CHECK fail which can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 888e34b49009a4e734c27ab0c43b0b5102682c56. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.8.42.8.4
tensorflowPyPI
>= 2.9.0, < 2.9.32.9.3
tensorflowPyPI
>= 2.10.0, < 2.10.12.10.1
tensorflow-cpuPyPI
< 2.8.42.8.4
tensorflow-gpuPyPI
< 2.8.42.8.4
tensorflow-cpuPyPI
>= 2.9.0, < 2.9.32.9.3
tensorflow-gpuPyPI
>= 2.9.0, < 2.9.32.9.3
tensorflow-cpuPyPI
>= 2.10.0, < 2.10.12.10.1
tensorflow-gpuPyPI
>= 2.10.0, < 2.10.12.10.1

Affected products

1

Patches

1
888e34b49009

Fix tf.raw_ops.TensorListResize vulnerability with non-scalar input.

https://github.com/tensorflow/tensorflowAlan LiuSep 26, 2022via ghsa
2 files changed · +11 0
  • tensorflow/core/kernels/list_kernels.cc+2 0 modified
    @@ -375,6 +375,8 @@ class TensorListResize : public OpKernel {
       void Compute(OpKernelContext* c) override {
         const TensorList* input_list = nullptr;
         OP_REQUIRES_OK(c, GetInputList(c, 0, &input_list));
    +    OP_REQUIRES(c, TensorShapeUtils::IsScalar(c->input(1).shape()),
    +                errors::InvalidArgument("size must be a scalar"));
         int32_t size = c->input(1).scalar<int32>()();
         OP_REQUIRES(
             c, size >= 0,
    
  • tensorflow/python/kernel_tests/data_structures/list_ops_test.py+9 0 modified
    @@ -1658,6 +1658,15 @@ def testResizeWithInvalidSizeFails(self):
           l = list_ops.tensor_list_resize(l, -1)
           self.evaluate(l)
     
    +  @test_util.run_in_graph_and_eager_modes
    +  def testResizeWithNonScalarFails(self):
    +    l = list_ops.tensor_list_from_tensor([3, 4, 5], element_shape=[])
    +    size = np.zeros([0, 2, 3, 3])
    +    with self.assertRaisesRegex((ValueError, errors.InvalidArgumentError),
    +                                r"Shape must be rank 0 but is rank \d+|"
    +                                r"\w+ must be a scalar"):
    +      self.evaluate(gen_list_ops.TensorListResize(input_handle=l, size=size))
    +
       @test_util.run_deprecated_v1
       @test_util.enable_control_flow_v2
       def testSkipEagerResizeGrad(self):
    

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.