CVE-2020-15202: Integer truncation in Shard API usage

CVE-2020-15202 · Severity: low · CVSS 3.1 · Published 2020-09-25

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. However, there are several places in TensorFlow where a lambda taking `int` or `int32` arguments is being used. In these cases, if the amount of work to be parallelized is large enough, integer truncation occurs. Depending on how the two arguments of the lambda are used, this can result in segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption. The issue is patched in commits 27b417360cbd671ef55915e4bb6bb06af8b8a832 and ca8c013b5e97b1373b3bb1c97ea655e69f31a575, and is released in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.

Technologies: tensorflow (PyPI), tensorflow-cpu (PyPI), tensorflow-gpu (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2020-15202 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-15202 being exploited in the wild.
How severe is CVE-2020-15202?
Low severity, with a CVSS score of 3.1, published 25 September 2020.
Which products and versions are affected?
tensorflow (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1; tensorflow-cpu (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1; tensorflow-gpu (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1.
Is there a fix for CVE-2020-15202?
Yes. tensorflow (PyPI): upgrade to 1.15.4, 2.3.1 or later; tensorflow-cpu (PyPI): upgrade to 1.15.4, 2.3.1 or later; tensorflow-gpu (PyPI): upgrade to 1.15.4, 2.3.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2020-15202?
Check whether you run tensorflow (PyPI), tensorflow-cpu (PyPI) or tensorflow-gpu (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • tensorflow (PyPI): upgrade to 1.15.4, 2.3.1 or later
    pip install "tensorflow>=2.3.1"
  • tensorflow-cpu (PyPI): upgrade to 1.15.4, 2.3.1 or later
    pip install "tensorflow-cpu>=2.3.1"
  • tensorflow-gpu (PyPI): upgrade to 1.15.4, 2.3.1 or later
    pip install "tensorflow-gpu>=2.3.1"

Affected products

  • tensorflow (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1
  • tensorflow-cpu (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1
  • tensorflow-gpu (PyPI) ECOSYSTEM:introduced=0,fixed=1.15.4, GIT:introduced=0,fixed=27b417360cbd671ef55915e4bb6bb06af8b8a832,fixed=ca8c013b5e97b1373b3bb1c97ea655e69f31a575|ECOSYSTEM:introduced=0,fixed=1.15.4,introduced=2.0.0,fixed=2.0.3,introduced=2.1.0,fixed=2.1.2,introduced=2.2.0,fixed=2.2.1,introduced=2.3.0,fixed=2.3.1

Identifiers

  • CVE-2020-15202
  • GHSA-h6fg-mjxg-hqq4
  • PYSEC-2020-125
  • PYSEC-2020-282
  • PYSEC-2020-317

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.