CVE-2020-15201: TensorFlow: heap overflow in ragged tensor ops
MEDIUM PoC AVAILABLEA heap buffer overflow in TensorFlow's RaggedCountSparseOutput operation allows network-accessible exploitation with no authentication required, though high attack complexity limits immediate risk. Any TensorFlow deployment exposing inference endpoints that process ragged/sparse tensor inputs should patch to 2.3.1+ immediately. No active exploitation reported, but the no-auth network vector is unacceptable for production AI serving infrastructure.
What is the risk?
Medium risk overall, but context-dependent severity for AI serving deployments. CVSS 4.8 reflects high attack complexity (AC:H), which requires crafting malformed ragged tensor inputs with precisely invalid splits partitioning. The network vector (AV:N) with no privileges (PR:N) and no user interaction (UI:N) is the primary risk amplifier — any internet-exposed TensorFlow Serving or gRPC inference endpoint accepting raw tensor inputs is a legitimate attack surface. No CISA KEV listing and 2020 publication date suggest no widespread active exploitation.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| TensorFlow | pip | — | No patch |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch: Upgrade TensorFlow to 2.3.1 or later — patch is in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02.
-
Validate inputs: Add server-side validation that splits tensors form valid ragged partitions before invoking RaggedCountSparseOutput; reject any request where splits[-1] < num_values.
-
Network segmentation: TensorFlow Serving gRPC/REST endpoints should never be directly internet-exposed; place behind an API gateway that validates tensor shapes and types.
-
Detection: Monitor for malformed tensor shape errors or unexpected crashes in TF Serving logs; anomalous spike in op-level errors on sparse/ragged ops may indicate probing.
-
Runtime hardening: Run inference containers with restricted memory access (seccomp, read-only rootfs) to limit blast radius of memory corruption.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2020-15201?
A heap buffer overflow in TensorFlow's RaggedCountSparseOutput operation allows network-accessible exploitation with no authentication required, though high attack complexity limits immediate risk. Any TensorFlow deployment exposing inference endpoints that process ragged/sparse tensor inputs should patch to 2.3.1+ immediately. No active exploitation reported, but the no-auth network vector is unacceptable for production AI serving infrastructure.
Is CVE-2020-15201 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2020-15201, increasing the risk of exploitation.
How to fix CVE-2020-15201?
1. Patch: Upgrade TensorFlow to 2.3.1 or later — patch is in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02. 2. Validate inputs: Add server-side validation that splits tensors form valid ragged partitions before invoking RaggedCountSparseOutput; reject any request where splits[-1] < num_values. 3. Network segmentation: TensorFlow Serving gRPC/REST endpoints should never be directly internet-exposed; place behind an API gateway that validates tensor shapes and types. 4. Detection: Monitor for malformed tensor shape errors or unexpected crashes in TF Serving logs; anomalous spike in op-level errors on sparse/ragged ops may indicate probing. 5. Runtime hardening: Run inference containers with restricted memory access (seccomp, read-only rootfs) to limit blast radius of memory corruption.
What systems are affected by CVE-2020-15201?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, data preprocessing pipelines.
What is the CVSS score for CVE-2020-15201?
CVE-2020-15201 has a CVSS v3.1 base score of 4.8 (MEDIUM). The EPSS exploitation probability is 0.56%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0024 Exfiltration via AI Inference API AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
In Tensorflow before version 2.3.1, the `RaggedCountSparseOutput` implementation does not validate that the input arguments form a valid ragged tensor. In particular, there is no validation that the values in the `splits` tensor generate a valid partitioning of the `values` tensor. Hence, the code is prone to heap buffer overflow. If `split_values` does not end with a value at least `num_values` then the `while` loop condition will trigger a read outside of the bounds of `split_values` once `batch_idx` grows too large. The issue is patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is released in TensorFlow version 2.3.1.
Exploitation Scenario
An adversary targeting an organization running TensorFlow 2.x inference services constructs a malicious prediction request containing a ragged tensor where the splits array does not correctly partition the values array — specifically, the final split value is less than the total number of values. When TensorFlow processes this input through RaggedCountSparseOutput, the while loop increments batch_idx beyond the bounds of split_values, triggering a heap buffer over-read. In a model serving context (e.g., TF Serving gRPC endpoint processing NLP inputs or sparse feature vectors), this could leak adjacent heap memory contents — potentially exposing cached inference results, model weight fragments, or internal runtime metadata. An attacker could iterate over multiple crafted payloads to incrementally reconstruct sensitive in-memory data.
Weaknesses (CWE)
CWE-787 Out-of-bounds Write
Primary
CWE-122 Heap-based Buffer Overflow CWE-20 Improper Input Validation CWE-787 — Out-of-bounds Write: The product writes data past the end, or before the beginning, of the intended buffer.
- [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:U/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