CVE-2021-29596: TensorFlow - Division by Zero Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29596: Division by zero in TFLite's implementation of EmbeddingLookup. 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-29596 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem for building and deploying machine learning models. TensorFlow is widely used in various industries and has a large community of developers and users. However, a vulnerability has been discovered in the implementation of the EmbeddingLookup TFLite operator, which can lead to a division by zero error.

Vulnerability Detail

The vulnerability in TensorFlow arises from a division by zero error in the EmbeddingLookup TFLite operator. An attacker can exploit this vulnerability by crafting a malicious model that sets the first dimension of the value input to 0. When this model is executed, it triggers a division by zero error, which can lead to various consequences depending on the context in which TensorFlow is used. The impact of this vulnerability can range from denial of service to potential code execution.

How To Fix

Fixed versions by release line

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

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 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

There is no known workaround for this vulnerability. It is recommended to apply the available patches or update to the latest patched versions of TensorFlow as mentioned in the 'how_to_fix' section.

Conclusion

In conclusion, a division by zero vulnerability has been discovered in TensorFlow's EmbeddingLookup TFLite operator. This vulnerability can be exploited by crafting a malicious model and can lead to various consequences, including denial of service and potential code execution. It is crucial to update to the latest patched versions of TensorFlow or apply the available patches to mitigate the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem for building and deploying machine learning models.

The impact of this vulnerability can range from denial of service to potential code execution, depending on the context in which TensorFlow is used.

To fix this vulnerability, it is recommended to update to the latest patched versions of TensorFlow, which include the fix. Alternatively, you can wait for the release of TensorFlow 2.5.0, which will also include the fix.

No, only versions starting from 0 and up to TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3, and TensorFlow 2.1.4 are affected. It is recommended to update to the latest patched versions or apply the available patches to mitigate the vulnerability.

No, there is no known workaround for this vulnerability. It is recommended to apply the available patches or update to the latest patched versions of TensorFlow.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

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

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 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