CVE-2020-15200: TensorFlow: heap overflow in RaggedCountSparseOutput DoS
MEDIUM PoC AVAILABLEMedium-severity DoS vulnerability in TensorFlow's ragged tensor ops — if your ML inference APIs accept user-supplied sparse/ragged tensor inputs and run TF < 2.3.1, a crafted payload can crash the serving process. Patch to TF 2.3.1+; no active exploitation observed and high attack complexity limits real-world risk. Prioritize if you expose TF serving endpoints to untrusted clients.
What is the risk?
Effective risk is moderate-low. CVSS 5.9 (AV:N/AC:H) reflects that exploitation requires deliberate crafting of malformed ragged tensor splits, not opportunistic attacks. Primary confirmed impact is availability (segfault/process crash); heap buffer overflow theoretically enables RCE but no working exploit for code execution has been published. Risk spikes for organizations exposing TensorFlow serving endpoints directly to untrusted networks or accepting external tensor payloads without sanitization.
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 (commit 3cbb917b).
-
Input validation
Enforce that
splits[0] == 0and splits generate a valid partition of the values tensor before processing. -
Network segmentation
Ensure TF Serving endpoints are not directly internet-exposed; place behind authenticated API gateways.
-
Detection
Monitor TF serving logs and container restart rates for unexpected segfaults or OOM signals — repeated crashes on specific inputs may indicate exploitation attempts.
-
Container hygiene
Run TF serving containers with restricted capabilities and memory limits to reduce blast radius of any memory corruption.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2020-15200?
Medium-severity DoS vulnerability in TensorFlow's ragged tensor ops — if your ML inference APIs accept user-supplied sparse/ragged tensor inputs and run TF < 2.3.1, a crafted payload can crash the serving process. Patch to TF 2.3.1+; no active exploitation observed and high attack complexity limits real-world risk. Prioritize if you expose TF serving endpoints to untrusted clients.
Is CVE-2020-15200 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2020-15200, increasing the risk of exploitation.
How to fix CVE-2020-15200?
1. **Patch**: Upgrade TensorFlow to 2.3.1 or later (commit 3cbb917b). 2. **Input validation**: Enforce that `splits[0] == 0` and splits generate a valid partition of the values tensor before processing. 3. **Network segmentation**: Ensure TF Serving endpoints are not directly internet-exposed; place behind authenticated API gateways. 4. **Detection**: Monitor TF serving logs and container restart rates for unexpected segfaults or OOM signals — repeated crashes on specific inputs may indicate exploitation attempts. 5. **Container hygiene**: Run TF serving containers with restricted capabilities and memory limits to reduce blast radius of any memory corruption.
What systems are affected by CVE-2020-15200?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference APIs, feature preprocessing pipelines.
What is the CVSS score for CVE-2020-15200?
CVE-2020-15200 has a CVSS v3.1 base score of 5.9 (MEDIUM). The EPSS exploitation probability is 0.84%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service 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. Thus, the code sets up conditions to cause a heap buffer overflow. A `BatchedMap` is equivalent to a vector where each element is a hashmap. However, if the first element of `splits_values` is not 0, `batch_idx` will never be 1, hence there will be no hashmap at index 0 in `per_batch_counts`. Trying to access that in the user code results in a segmentation fault. The issue is patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is released in TensorFlow version 2.3.1.
Exploitation Scenario
Attacker targets a recommendation or NLP inference API backed by TensorFlow Serving. They submit a crafted `RaggedTensor` payload via the gRPC API where `splits_values[0] != 0`, causing `batch_idx` to never reach 1. The code attempts to access index 0 of `per_batch_counts` which is empty, triggering a segmentation fault. The TF Serving process crashes and the container restarts. By automating repeated requests with crafted payloads, the attacker keeps the inference pod in a crash loop, effectively taking the ML inference layer offline and degrading dependent services.
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:N/I:N/A:H 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