VYPR
High severityNVD Advisory· Published Mar 24, 2023· Updated Feb 19, 2025

TensorFlow has double free in Fractional(Max/Avg)Pool

CVE-2023-25801

Description

TensorFlow is an open source machine learning platform. Prior to versions 2.12.0 and 2.11.1, nn_ops.fractional_avg_pool_v2 and nn_ops.fractional_max_pool_v2 require the first and fourth elements of their parameter pooling_ratio to be equal to 1.0, as pooling on batch and channel dimensions is not supported. A fix is included in TensorFlow 2.12.0 and 2.11.1.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.11.12.11.1
tensorflow-cpuPyPI
< 2.11.12.11.1
tensorflow-gpuPyPI
< 2.11.12.11.1

Affected products

1

Patches

1
ee50d1e00f81

Fix security vulnerability with FractionalMax(AVG)Pool with illegal pooling_ratio

https://github.com/tensorflow/tensorflowZhufeng PanJan 12, 2023via ghsa
4 files changed · +24 4
  • tensorflow/core/kernels/fractional_avg_pool_op.cc+1 1 modified
    @@ -51,7 +51,7 @@ class FractionalAvgPoolOp : public OpKernel {
                           pooling_ratio_[i]));
         }
         OP_REQUIRES(
    -        context, pooling_ratio_[0] == 1 || pooling_ratio_[3] == 1,
    +        context, pooling_ratio_[0] == 1 && pooling_ratio_[3] == 1,
             errors::Unimplemented("Fractional average pooling is not yet "
                                   "supported on the batch nor channel dimension."));
         OP_REQUIRES_OK(context, context->GetAttr("deterministic", &deterministic_));
    
  • tensorflow/core/kernels/fractional_max_pool_op.cc+1 1 modified
    @@ -53,7 +53,7 @@ class FractionalMaxPoolOp : public OpKernel {
         }
     
         OP_REQUIRES(
    -        context, pooling_ratio_[0] == 1 || pooling_ratio_[3] == 1,
    +        context, pooling_ratio_[0] == 1 && pooling_ratio_[3] == 1,
             errors::Unimplemented("Fractional max pooling is not yet "
                                   "supported on the batch nor channel dimension."));
     
    
  • tensorflow/python/kernel_tests/nn_ops/fractional_avg_pool_op_test.py+11 1 modified
    @@ -351,7 +351,7 @@ def testPoolingRatioHasMoreDimThanInput(self):
                 name=None)
             self.evaluate(result)
     
    -  def testPoolingRatioValueOutOfRange(self):
    +  def testPoolingRatioIllegalSmallValue(self):
         with self.cached_session() as _:
           # Whether turn on `TF2_BEHAVIOR` generates different error messages
           with self.assertRaisesRegex(
    @@ -368,6 +368,16 @@ def testPoolingRatioValueOutOfRange(self):
             )
             self.evaluate(result)
     
    +  def testPoolingIllegalRatioForBatch(self):
    +    with self.cached_session() as _:
    +      with self.assertRaises(errors.UnimplementedError):
    +        result = nn_ops.gen_nn_ops.fractional_avg_pool(
    +            np.zeros([3, 30, 50, 3]),
    +            [2, 3, 1.5, 1],
    +            True,
    +            True)
    +        self.evaluate(result)
    +
     
     class FractionalAvgPoolGradTest(test.TestCase):
       """Tests for FractionalAvgPoolGrad.
    
  • tensorflow/python/kernel_tests/nn_ops/fractional_max_pool_op_test.py+11 1 modified
    @@ -338,7 +338,7 @@ def testPoolingRatioHasMoreDimThanInput(self):
                 name=None)
             self.evaluate(result)
     
    -  def testPoolingRatioValueOutOfRange(self):
    +  def testPoolingRatioIllegalSmallValue(self):
         with self.cached_session() as _:
           # Whether turn on `TF2_BEHAVIOR` generates different error messages
           with self.assertRaisesRegex(
    @@ -355,6 +355,16 @@ def testPoolingRatioValueOutOfRange(self):
             )
             self.evaluate(result)
     
    +  def testPoolingIllegalRatioForBatch(self):
    +    with self.cached_session() as _:
    +      with self.assertRaises(errors.UnimplementedError):
    +        result = nn_ops.fractional_max_pool(
    +            np.zeros([3, 30, 50, 3]),
    +            [2, 3, 1.5, 1],
    +            True,
    +            True)
    +        self.evaluate(result)
    +
     
     class FractionalMaxPoolGradTest(test.TestCase):
       """Tests for FractionalMaxPoolGrad.
    

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

4

News mentions

0

No linked articles in our index yet.