CVE-2021-29585: TensorFlow - TFLite Computation Size of Output After Padding Vulnerability
Summary
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
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
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.
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.
No signup required · Results in about 60 seconds
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.42.1.4 -
>= 2.2.0, < 2.2.32.2.3 -
>= 2.3.0, < 2.3.32.3.3 -
>= 2.4.0, < 2.4.22.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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.