CVE-2021-29550: Divide By Zero
TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a runtime division by zero error and denial of service in tf.raw_ops.FractionalAvgPool
. This is because the implementation computes a divisor quantity by dividing two user controlled values. The user controls the values of input_sizei]
and pooling_ratio_[i
pooling_ratioarguments). If the value in
input_sizei pooling_ratio_i]
, then the floor operation results in output_size[i 0. The
DCHECK_GTline is a no-op outside of debug mode, so in released versions of TF this does not trigger. Later, these computed values are used as arguments to
GeneratePoolingSequence. There, the first computation is a division in a modulo operation. Since
output_length` can be 0, this results in runtime crashing. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
References
Detect and mitigate CVE-2021-29550 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →