CVE-2020-15202: TensorFlow Shard API Integer Truncation Vulnerability
Summary
CVE-2020-15202: In Tensorflow before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, the Shard API in TensorFlow expects the last argument to be a function taking two int64 (i.e., long long) arguments. Affects tensorflow across 7 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
< 27b417360cbd671ef55915e4bb6bb06af8b8a832
< ca8c013b5e97b1373b3bb1c97ea655e69f31a575
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 allows for parallelization of workloads by dividing them into smaller tasks. However, prior to versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1, there was a vulnerability in the Shard API that could lead to integer truncation.
Vulnerability Detail
The vulnerability in the TensorFlow Shard API arises from the expectation of the last argument being a function that takes two int64 (long long) arguments. However, in several instances, a lambda function taking int or int32 arguments is used instead. When the workload to be parallelized is large enough, integer truncation can occur. This can result in various issues such as segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption.
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. However, users can mitigate the risk by ensuring they are using one of the patched versions of TensorFlow.
Conclusion
The TensorFlow Shard API Integer Truncation vulnerability can lead to various issues when using certain lambda functions. It is crucial to update to the patched versions of TensorFlow to mitigate the risk. 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 allows for parallelization of workloads by dividing them into smaller tasks.
Integer truncation occurs when a floating-point number is converted to an integer, resulting in the loss of the decimal part of the number.
The consequences of this vulnerability can include segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption.
To fix this vulnerability, it is recommended to upgrade to one of the patched versions of TensorFlow (1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1).
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.