CVE-2021-29601: TensorFlow Integer Overflow in TFLite Concatenation
Summary
CVE-2021-29601: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 5 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
< 4253f96a58486ffe84b61c0415bb234a4632ee73
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-29601 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. The TensorFlow Lite (TFLite) implementation is specifically designed for running machine learning models on resource-constrained devices. TFLite uses int to represent tensor dimensions, while TensorFlow (TF) uses int64. This vulnerability arises from an integer overflow issue in the TFLite implementation of concatenation, where the dimensions of one of the concatenation inputs can overflow the values of int. This vulnerability affects the TensorFlow package, specifically the tensorflow-cpu package on PyPI.
Vulnerability Detail
The vulnerability in TensorFlow allows an attacker to craft a malicious model that triggers an integer overflow when converted to TFLite format. By manipulating the dimensions of one of the concatenation inputs, the attacker can cause an integer overflow in the TFLite implementation. This can lead to various consequences, such as memory corruption, crashes, or even potential remote code execution. The vulnerability affects versions of TensorFlow from 0 to 2.4.2, as well as versions 2.1.4, 2.2.3, and 2.3.3. The issue has been identified and fixed in TensorFlow 2.5.0.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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.42.1.4pip install --upgrade "tensorflow-cpu==2.1.4" -
>= 2.2.0, < 2.2.32.2.3pip install --upgrade "tensorflow-cpu==2.2.3" -
>= 2.3.0, < 2.3.32.3.3pip install --upgrade "tensorflow-cpu==2.3.3" -
>= 2.4.0, < 2.4.22.4.2pip install --upgrade "tensorflow-cpu==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 workaround, users can avoid using the TFLite implementation of concatenation and instead use the TensorFlow implementation. This can be achieved by converting the model to TensorFlow format instead of TFLite format. However, this workaround may not be feasible in all scenarios and may require modifications to the existing codebase.
Conclusion
The vulnerability in TensorFlow's TFLite implementation of concatenation can be exploited through a crafted model to trigger an integer overflow. This can result in memory corruption, crashes, or potential remote code execution. It is crucial to update to the fixed versions of TensorFlow or apply the recommended workarounds to mitigate the risk. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and resources for developing and deploying machine learning models.
TensorFlow Lite (TFLite) is a lightweight version of TensorFlow designed for running machine learning models on resource-constrained devices.
This vulnerability can lead to memory corruption, crashes, or potential remote code execution when a malicious model triggers an integer overflow in the TFLite implementation of concatenation.
Versions of TensorFlow from 0 to 2.4.2, as well as versions 2.1.4, 2.2.3, and 2.3.3, are affected by this vulnerability.
To fix this vulnerability, it is recommended to upgrade to TensorFlow 2.5.0 or later. Alternatively, users can use the TensorFlow implementation of concatenation instead of TFLite.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.