CVE-2020-15202: TensorFlow Shard API Integer Truncation Vulnerability

tensorflow-cpu Updated 02 Oct 2025

Summary

25/09/2020
Yes i
Unrated
Not published

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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.4 1.15.4
    pip install --upgrade "tensorflow-cpu==1.15.4"
  • >= 2.0.0, < 2.0.3 2.0.3
    pip install --upgrade "tensorflow-cpu==2.0.3"
  • >= 2.1.0, < 2.1.2 2.1.2
    pip install --upgrade "tensorflow-cpu==2.1.2"
  • >= 2.2.0, < 2.2.1 2.2.1
    pip install --upgrade "tensorflow-cpu==2.2.1"
  • >= 2.3.0, < 2.3.1 2.3.1
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

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.4 1.15.4
    pip install --upgrade "tensorflow-cpu==1.15.4"
  • >= 2.0.0, < 2.0.3 2.0.3
    pip install --upgrade "tensorflow-cpu==2.0.3"
  • >= 2.1.0, < 2.1.2 2.1.2
    pip install --upgrade "tensorflow-cpu==2.1.2"
  • >= 2.2.0, < 2.2.1 2.2.1
    pip install --upgrade "tensorflow-cpu==2.2.1"
  • >= 2.3.0, < 2.3.1 2.3.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback