CVE-2020-15198: TensorFlow: heap OOB in SparseCountSparseOutput ops
MEDIUM PoC AVAILABLEThis 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.
Risk Assessment
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.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
Do you use tensorflow? You're affected.
Severity & Risk
Attack Surface
Recommended Action
5 steps-
PATCH
Upgrade TensorFlow to >= 2.3.1 immediately on all training and serving infrastructure.
-
AUDIT
Inventory all TF versions across MLOps pipelines using 'pip show tensorflow' or container image scanning.
-
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.
-
ISOLATE
Run TF serving processes in containers/VMs with restricted memory and without network egress to limit blast radius of exploitation.
-
DETECT
Alert on unexpected process crashes in TF serving pods — heap corruption often manifests as SIGABRT/SIGSEGV.
Classification
Compliance Impact
This CVE is relevant to:
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.17%.
Technical Details
NVD Description
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)
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N References
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow
AI Threat Alert