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-cpu 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 · PyPI
- tensorflow-gpu · PyPI
- tensorflow · 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 used for parallelizing work across multiple devices or machines. 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 under certain conditions.
Vulnerability Detail
The vulnerability arises from the expectation that the last argument of the Shard API should be a function taking two int64 (long long) arguments. However, in several places within TensorFlow, a lambda function taking int or int32 arguments is used instead. When the amount of work 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. The vulnerability is patched in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1.
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.
-
< 1.15.41.15.4pip install --upgrade "tensorflow-cpu==1.15.4" -
>= 2.0.0, < 2.0.32.0.3pip install --upgrade "tensorflow-cpu==2.0.3" -
>= 2.1.0, < 2.1.22.1.2pip install --upgrade "tensorflow-cpu==2.1.2" -
>= 2.2.0, < 2.2.12.2.1pip install --upgrade "tensorflow-cpu==2.2.1" -
>= 2.3.0, < 2.3.12.3.1pip install --upgrade "tensorflow-cpu==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 mentioned for this vulnerability.
Conclusion
The TensorFlow Shard API Integer Truncation Vulnerability (CVE-2020-15202) can lead to various issues when using the Shard API with lambda functions taking int or int32 arguments. It is recommended to update TensorFlow to one of the patched versions to mitigate the vulnerability. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework developed by Google.
The Shard API in TensorFlow is used for parallelizing work across multiple devices or machines.
The vulnerability can lead to various issues such as segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption.
To fix the vulnerability, update TensorFlow to one of the patched versions: 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
No specific workaround is mentioned for this vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.