CVE-2021-29585: TensorFlow - TFLite Computation Size of Output After Padding Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29585: Division by zero in padding computation in TFLite. 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-29585 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 end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems. However, a vulnerability has been discovered in TensorFlow related to the TFLite computation for the size of output after padding.

Vulnerability Detail

The vulnerability in TensorFlow arises from the ComputeOutSize function in the TFLite computation. This function does not check whether the stride argument is set to 0 before performing a division operation. As a result, malicious users can create specially crafted models that trigger a call to ComputeOutSize with a stride value of 0. This can lead to various issues, including potential memory corruption or unexpected behavior in the application using TensorFlow. The vulnerability has been assigned the CVE identifier CVE-2021-29585 and has a severity rating of High.

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 specific workaround provided for this vulnerability. The recommended approach is to update to the fixed versions of TensorFlow as mentioned in the 'how_to_fix' section.

Conclusion

The vulnerability in TensorFlow related to the TFLite computation for the size of output after padding has been addressed in the latest versions of TensorFlow. Users are strongly advised to update their installations to the fixed versions to mitigate the risk. For further support and assistance with 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 set of tools and libraries for developing and deploying machine learning models.

The vulnerability can potentially lead to memory corruption or unexpected behavior in applications using TensorFlow.

The vulnerability affects TensorFlow versions 0.x, 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.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file to the playground and it will provide real-time alerts for open-source vulnerabilities.

You can find more information about this vulnerability in the TensorFlow vulnerability database at https://github.com/bitnami/vulndb/tree/main/data/tensorflow/BIT-tensorflow-2021-29585.json.

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