CVE-2021-29527: Division by 0 in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

21/05/2021
Yes i
Low
2.5

CVE-2021-29527: Division by 0 in QuantizedConv2D. Affects tensorflow across 4 version ranges.

< 2.1.4 >= 2.2.0, < 2.2.3 >= 2.3.0, < 2.3.3 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-29527 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an open-source machine learning framework widely used for building and training various deep learning models. It provides a comprehensive set of tools and libraries for numerical computation and large-scale machine learning. TensorFlow supports both CPU and GPU processing and is available for multiple programming languages, including Python. This vulnerability affects versions 0.0.0 to 2.1.4, 2.2.0 to 2.2.3, 2.3.0 to 2.3.3, and 2.4.0 to 2.4.2 of the TensorFlow package.

Vulnerability Detail

The vulnerability, identified as CVE-2021-29527, allows an attacker to trigger a division by 0 in the QuantizedConv2D function of TensorFlow. By providing specific input and filter values, an attacker can exploit this vulnerability. The issue arises due to a division operation that is controlled by the caller and can result in a division by 0 error. This vulnerability has a CVSS score of 2.5, indicating a low severity level. The impact of this vulnerability can lead to denial of service (DoS) attacks or potential information disclosure.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow==2.4.2"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can avoid using the QuantizedConv2D function with the specific input and filter values that trigger the division by 0 error. Alternatively, users can implement their own validation checks to ensure that the input and filter values are within valid ranges before calling the QuantizedConv2D function.

Conclusion

In conclusion, the CVE-2021-29527 vulnerability in TensorFlow allows an attacker to trigger a division by 0 error in the QuantizedConv2D function. This can lead to denial of service (DoS) attacks or potential information disclosure. It is recommended to update TensorFlow to the latest patched versions or version 2.5.0 once it becomes available. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for building and training deep learning models.

The vulnerability can lead to denial of service (DoS) attacks or potential information disclosure.

To fix this vulnerability, update TensorFlow to version 2.5.0 or the patched versions 2.4.2, 2.3.3, 2.2.3, or 2.1.4.

Yes, users can avoid using the QuantizedConv2D function with specific input and filter values that trigger the division by 0 error.

For more information, please refer to the TensorFlow security guide and the GitHub commit cfa91be9863a91d5105a3b4941096044ab32036b.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow==2.4.2"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback