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

Overflow in `ImageProjectiveTransformV2` in Tensorflow

CVE-2022-41886

Description

TensorFlow is an open source platform for machine learning. When tf.raw_ops.ImageProjectiveTransformV2 is given a large output shape, it overflows. We have patched the issue in GitHub commit 8faa6ea692985dbe6ce10e1a3168e0bd60a723ba. 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
8faa6ea69298

Fix tf.raw_ops.ImageProjectiveTransformV2 vulnerability with large output_shape.

https://github.com/tensorflow/tensorflowAlan LiuOct 5, 2022via ghsa
2 files changed · +28 4
  • tensorflow/core/kernels/image/image_ops.cc+5 4 modified
    @@ -96,11 +96,12 @@ void DoImageProjectiveTransformOp(OpKernelContext* ctx,
       }
     
       Tensor* output_t;
    +  TensorShape output_shape;
       OP_REQUIRES_OK(
    -      ctx, ctx->allocate_output(0,
    -                                TensorShape({images_t.dim_size(0), out_height,
    -                                             out_width, images_t.dim_size(3)}),
    -                                &output_t));
    +      ctx, TensorShape::BuildTensorShape({images_t.dim_size(0), out_height,
    +                                          out_width, images_t.dim_size(3)},
    +                                         &output_shape));
    +  OP_REQUIRES_OK(ctx, ctx->allocate_output(0, output_shape, &output_t));
       auto output = output_t->tensor<T, 4>();
       auto images = images_t.tensor<T, 4>();
       auto transform = transform_t.matrix<float>();
    
  • tensorflow/python/ops/image_ops_test.py+23 0 modified
    @@ -2335,6 +2335,29 @@ def testInvalidInput(self):
             self.evaluate(v)
     
     
    +class ImageProjectiveTransformV2(test_util.TensorFlowTestCase):
    +
    +  def testShapeTooLarge(self):
    +    interpolation = "BILINEAR"
    +    fill_mode = "REFLECT"
    +    images = constant_op.constant(
    +        0.184634328, shape=[2, 5, 8, 3], dtype=dtypes.float32)
    +    transforms = constant_op.constant(
    +        0.378575385, shape=[2, 8], dtype=dtypes.float32)
    +    output_shape = constant_op.constant([1879048192, 1879048192],
    +                                        shape=[2],
    +                                        dtype=dtypes.int32)
    +    with self.assertRaisesRegex(errors.InvalidArgumentError,
    +                                r"Encountered overflow when multiplying"):
    +      self.evaluate(
    +          gen_image_ops.ImageProjectiveTransformV2(
    +              images=images,
    +              transforms=transforms,
    +              output_shape=output_shape,
    +              interpolation=interpolation,
    +              fill_mode=fill_mode))
    +
    +
     class InternalPadToBoundingBoxTest(test_util.TensorFlowTestCase,
                                        parameterized.TestCase):
     
    

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.