CVE-2021-29613: TensorFlow CTCLoss Incomplete Validation OOB Read Vulnerability
Summary
CVE-2021-29613: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-cpu across 6 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
< 4504a081af71514bb1828048363e6540f797005b
< 14607c0707040d775e06b6817325640cb4b5864c
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-29613 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 domains, including research, industry, and academia. The CTCLoss function in TensorFlow is responsible for computing the Connectionist Temporal Classification (CTC) loss, which is commonly used in sequence-to-sequence models for tasks like speech recognition and handwriting recognition. This vulnerability affects the TensorFlow package, specifically the CTCLoss function.
Vulnerability Detail
The vulnerability (CVE-2021-29613) arises from incomplete validation in the CTCLoss function of TensorFlow. It allows an attacker to trigger an out-of-bounds read from the heap. This can lead to information disclosure or potential crashes in applications that utilize TensorFlow's CTCLoss function. The vulnerability has been identified and fixed by the TensorFlow development team. The fix will be included in TensorFlow 2.5.0, and patches have also been backported to earlier versions (2.4.2, 2.3.3, 2.2.3, and 2.1.4) that are still within the supported range.
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
There is no specific workaround provided for this vulnerability. The recommended approach is to update the TensorFlow package to the fixed version or apply the available patches.
Conclusion
The TensorFlow CTCLoss Incomplete Validation OOB Read Vulnerability (CVE-2021-29613) has been identified and fixed by the TensorFlow development team. It is crucial to update the TensorFlow package to version 2.5.0 or apply the provided patches to mitigate the risk of out-of-bounds reads from the heap. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open source platform for machine learning, providing tools and libraries for developing and deploying machine learning models.
CTCLoss is a function in TensorFlow used for computing the Connectionist Temporal Classification (CTC) loss, commonly used in sequence-to-sequence models.
The vulnerability allows an attacker to trigger an out-of-bounds read from the heap, potentially leading to information disclosure or application crashes.
The vulnerability affects TensorFlow versions 2.1.4, 2.2.3, 2.3.3, 2.4.2, and prior versions within the supported range.
To fix this vulnerability, update the TensorFlow package to version 2.5.0 or apply the relevant patches for the affected versions.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.