CVE-2020-15198: TensorFlow: heap OOB in SparseCountSparseOutput ops

MEDIUM PoC AVAILABLE
Published September 25, 2020
CISO Take

This 2020 TensorFlow vulnerability allows network-accessible model serving endpoints to be crashed or potentially exploited via malformed sparse tensor inputs. If your ML infrastructure still runs TensorFlow < 2.3.1, patch immediately — this is a straightforward version bump. For teams on modern TF versions, no action required beyond confirming you are not running legacy inference infrastructure.

What is the risk?

Risk is LOW for patched environments but MEDIUM for legacy ML serving deployments that may still run TF 2.3.0 or earlier. CVSS 5.4 with AC:High means exploitation requires deliberate crafting of malformed inputs, reducing opportunistic risk. However, AI/ML serving APIs often lack input validation layers, making them more susceptible than traditional web services. The network attack vector with no privilege requirement means any caller with API access to a TF serving endpoint is a potential threat actor.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 2d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
5.4 / 10
EPSS
0.5%
chance of exploitation in 30 days
Higher than 41% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Advanced
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC High
PR None
UI None
S Changed
C Low
I Low
A None

What should I do?

5 steps
  1. PATCH

    Upgrade TensorFlow to >= 2.3.1 immediately on all training and serving infrastructure.

  2. AUDIT

    Inventory all TF versions across MLOps pipelines using 'pip show tensorflow' or container image scanning.

  3. VALIDATE INPUTS

    Add input shape validation at the serving layer — reject requests where indices and values tensors have mismatched shapes before they reach the TF runtime.

  4. ISOLATE

    Run TF serving processes in containers/VMs with restricted memory and without network egress to limit blast radius of exploitation.

  5. DETECT

    Alert on unexpected process crashes in TF serving pods — heap corruption often manifests as SIGABRT/SIGSEGV.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
8.4 - AI system security
NIST AI RMF
MANAGE 2.2 - Mechanisms for detecting, responding to, and recovering from vulnerabilities MAP 1.5 - Organizational risk tolerance

Frequently Asked Questions

What is CVE-2020-15198?

This 2020 TensorFlow vulnerability allows network-accessible model serving endpoints to be crashed or potentially exploited via malformed sparse tensor inputs. If your ML infrastructure still runs TensorFlow < 2.3.1, patch immediately — this is a straightforward version bump. For teams on modern TF versions, no action required beyond confirming you are not running legacy inference infrastructure.

Is CVE-2020-15198 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2020-15198, increasing the risk of exploitation.

How to fix CVE-2020-15198?

1. PATCH: Upgrade TensorFlow to >= 2.3.1 immediately on all training and serving infrastructure. 2. AUDIT: Inventory all TF versions across MLOps pipelines using 'pip show tensorflow' or container image scanning. 3. VALIDATE INPUTS: Add input shape validation at the serving layer — reject requests where indices and values tensors have mismatched shapes before they reach the TF runtime. 4. ISOLATE: Run TF serving processes in containers/VMs with restricted memory and without network egress to limit blast radius of exploitation. 5. DETECT: Alert on unexpected process crashes in TF serving pods — heap corruption often manifests as SIGABRT/SIGSEGV.

What systems are affected by CVE-2020-15198?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, data preprocessing pipelines, recommendation system backends.

What is the CVSS score for CVE-2020-15198?

CVE-2020-15198 has a CVSS v3.1 base score of 5.4 (MEDIUM). The EPSS exploitation probability is 0.54%.

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesdata preprocessing pipelinesrecommendation system backends

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0029 Denial of AI Service
AML.T0043 Craft Adversarial Data
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: 8.4
NIST AI RMF: MANAGE 2.2, MAP 1.5

What are the technical details?

Original Advisory

In Tensorflow before version 2.3.1, the `SparseCountSparseOutput` implementation does not validate that the input arguments form a valid sparse tensor. In particular, there is no validation that the `indices` tensor has the same shape as the `values` one. The values in these tensors are always accessed in parallel. Thus, a shape mismatch can result in accesses outside the bounds of heap allocated buffers. The issue is patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is released in TensorFlow version 2.3.1.

Exploitation Scenario

An adversary targeting an organization running a recommendation system on TF 2.3.0 identifies the TF Serving REST endpoint. They craft a predict request containing a sparse tensor where the indices shape is [100, 2] but the values shape is [10] — a deliberate mismatch. The SparseCountSparseOutput op accesses both tensors in parallel without bounds checking, triggering an out-of-bounds heap read/write. In the minimal exploitation path, the service crashes (DoS for the recommendation pipeline). In a more targeted scenario with heap layout knowledge, the adversary may achieve partial memory read to extract in-memory model weights or user data cached in the serving process.

Weaknesses (CWE)

CWE-119 — Improper Restriction of Operations within the Bounds of a Memory Buffer: The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

  • [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N

Timeline

Published
September 25, 2020
Last Modified
November 21, 2024
First Seen
September 25, 2020

Related Vulnerabilities