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

Floating point exception in `Conv2D` in TensorFlow

CVE-2022-35996

Description

TensorFlow is an open source platform for machine learning. If Conv2D is given empty input and the filter and padding sizes are valid, the output is all-zeros. This causes division-by-zero floating point exceptions that can be used to trigger a denial of service attack. We have patched the issue in GitHub commit 611d80db29dd7b0cfb755772c69d60ae5bca05f9. 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
611d80db29dd

Fix conv2d crash when input size is empty.

https://github.com/tensorflow/tensorflowAntonio SanchezJul 25, 2022via ghsa
2 files changed · +19 0
  • tensorflow/core/kernels/conv_ops.cc+10 0 modified
    @@ -44,6 +44,7 @@ limitations under the License.
     #include "tensorflow/core/framework/types.h"
     #include "tensorflow/core/kernels/conv_2d.h"
     #include "tensorflow/core/kernels/deep_conv2d.h"
    +#include "tensorflow/core/kernels/fill_functor.h"
     #include "tensorflow/core/kernels/ops_util.h"
     #include "tensorflow/core/lib/core/errors.h"
     #include "tensorflow/core/lib/gtl/array_slice.h"
    @@ -701,6 +702,15 @@ class Conv2DOp : public BinaryOp<T> {
           return;
         }
     
    +    // If the input is empty, result can only be due to padding.
    +    if (input.NumElements() == 0) {
    +      // Zero-out output and return.
    +      functor::SetZeroFunctor<Device, T>()(context->eigen_device<Device>(),
    +                                           output->template flat<T>());
    +
    +      return;
    +    }
    +
     #ifdef TENSORFLOW_USE_LIBXSMM_CONVOLUTIONS
         if (params_.padding != EXPLICIT &&
             LaunchXsmmConvOp<Device, T>::Run(
    
  • tensorflow/python/kernel_tests/nn_ops/conv_ops_test.py+9 0 modified
    @@ -759,6 +759,15 @@ def testConv2DExplicitPaddingWithDilations(self):
             padding=[[2, 1], [1, 2]],
             dilations=[2, 3])
     
    +  @test_util.run_in_graph_and_eager_modes()
    +  def testConv2dOnlyPaddingReturnsZeros(self):
    +    self._VerifyValues(
    +        tensor_in_sizes=[1, 0, 2, 1],
    +        filter_in_sizes=[1, 1, 1, 1],
    +        strides=[1, 1],
    +        padding=[[1, 1], [1, 1]],
    +        expected=[0, 0, 0, 0, 0, 0, 0, 0])
    +
       def testConv2DExplicitPaddingWithLayoutOptimizer(self):
         # Test with Grappler's layout optimizer, to ensure the layout optimizer
         # handles explicit padding correctly.
    

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.