CVE-2020-15202: Integer truncation in Shard API usage in TensorFlow
Summary
CVE-2020-15202: Integer truncation in Shard API usage. Affects tensorflow across 5 version ranges.
< 1.15.4
>= 2.0.0, < 2.0.3
>= 2.1.0, < 2.1.2
>= 2.2.0, < 2.2.1
>= 2.3.0, < 2.3.1
Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2020-15202 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 open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. The Shard API in TensorFlow is responsible for parallelizing work across multiple devices or machines. It expects a function that takes two 64-bit integer arguments. However, due to a programming error, several places in TensorFlow use a lambda function that takes 32-bit integer arguments instead. This can lead to integer truncation and various security vulnerabilities.
Vulnerability Detail
The vulnerability arises from the incorrect usage of the Shard API in TensorFlow. When the lambda function with 32-bit integer arguments is used, integer truncation can occur if the amount of work to be parallelized is large enough. This can result in severe consequences such as segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption. The impact of this vulnerability is critical, with a CVSS score of 9.0.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow==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.
-
< 1.15.41.15.4pip install --upgrade "tensorflow==1.15.4" -
>= 2.0.0, < 2.0.32.0.3pip install --upgrade "tensorflow==2.0.3" -
>= 2.1.0, < 2.1.22.1.2pip install --upgrade "tensorflow==2.1.2" -
>= 2.2.0, < 2.2.12.2.1pip install --upgrade "tensorflow==2.2.1" -
>= 2.3.0, < 2.3.12.3.1pip install --upgrade "tensorflow==2.3.1"
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 upgrade to the patched versions of TensorFlow.
Conclusion
The vulnerability in TensorFlow's Shard API usage can lead to severe security issues due to integer truncation. It is crucial to upgrade to the patched versions of TensorFlow to mitigate the risks associated with this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework developed by Google. It provides tools and resources for building and deploying machine learning models.
The Shard API in TensorFlow is responsible for parallelizing work across multiple devices or machines.
Integer truncation occurs when a larger integer value is converted to a smaller integer type, resulting in the loss of the higher-order bits.
The potential consequences of this vulnerability include segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption.
The CVSS score of this vulnerability is 9.0, indicating a critical impact.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.