VYPR
Moderate severityNVD Advisory· Published May 20, 2022· Updated Apr 22, 2025

Missing validation crashes `QuantizeAndDequantizeV4Grad` in TensorFlow

CVE-2022-29192

Description

TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of tf.raw_ops.QuantizeAndDequantizeV4Grad does not fully validate the input arguments. This results in a CHECK-failure which can be used to trigger a denial of service attack. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.6.42.6.4
tensorflowPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
< 2.6.42.6.4
tensorflow-cpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
< 2.6.42.6.4
tensorflow-gpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1

Affected products

1

Patches

1
098e7762d909

Fix tf.raw_ops.QuantizeAndDequantizeV4Grad vulnerability with invalid input_min or input_max.

https://github.com/tensorflow/tensorflowAlan LiuApr 28, 2022via ghsa
1 file changed · +8 2
  • tensorflow/core/kernels/quantize_and_dequantize_op.cc+8 2 modified
    @@ -174,13 +174,13 @@ class QuantizeAndDequantizeV4GradientOp : public OpKernel {
         OP_REQUIRES(ctx,
                     input_min_tensor.dims() == 0 || input_min_tensor.dims() == 1,
                     errors::InvalidArgument(
    -                    "Input min tensor must have dimension 1. Recieved ",
    +                    "Input min tensor must have dimension 0 or 1. Received ",
                         input_min_tensor.dims(), "."));
         const Tensor& input_max_tensor = ctx->input(3);
         OP_REQUIRES(ctx,
                     input_max_tensor.dims() == 0 || input_max_tensor.dims() == 1,
                     errors::InvalidArgument(
    -                    "Input max tensor must have dimension 1. Recieved ",
    +                    "Input max tensor must have dimension 0 or 1. Received ",
                         input_max_tensor.dims(), "."));
         if (axis_ != -1) {
           OP_REQUIRES(
    @@ -203,6 +203,12 @@ class QuantizeAndDequantizeV4GradientOp : public OpKernel {
                        ctx->allocate_output(2, min_max_shape, &input_max_backprop));
     
         if (axis_ == -1) {
    +      OP_REQUIRES(ctx, TensorShapeUtils::IsScalar(input_min_tensor.shape()),
    +                  errors::InvalidArgument(
    +                      "input_min must be a scalar if axis is unspecified"));
    +      OP_REQUIRES(ctx, TensorShapeUtils::IsScalar(input_max_tensor.shape()),
    +                  errors::InvalidArgument(
    +                      "input_max must be a scalar if axis is unspecified"));
           functor::QuantizeAndDequantizeOneScaleGradientFunctor<Device, T> f;
           f(ctx->eigen_device<Device>(), gradient.template flat<T>(),
             input.template flat<T>(), input_min_tensor.scalar<T>(),
    

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

9

News mentions

0

No linked articles in our index yet.