CVE-2020-15205: TensorFlow: heap overflow in StringNGrams, ASLR bypass
CRITICAL PoC AVAILABLEAny TensorFlow deployment processing user-controlled text through StringNGrams is exposed to remote heap overflow and memory disclosure that can defeat ASLR — enabling full system compromise. Patch to TF 1.15.4/2.0.3/2.1.2/2.2.1/2.3.1+ immediately; treat unpatched model-serving endpoints as critical-risk. If immediate patching is not possible, isolate TF inference endpoints from untrusted input sources as a stopgap.
Risk Assessment
CVSS 9.8 with network vector, zero authentication, and zero user interaction makes this trivially reachable against any exposed TF serving deployment. The combination of heap overflow (code execution path) and memory stack disclosure (ASLR bypass) gives a capable attacker a reliable exploitation chain. Risk is highest for organizations running TF model-serving APIs that accept externally-supplied text data without prior sanitization.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| tensorflow | pip | — | No patch |
| leap | — | — | No patch |
Severity & Risk
Attack Surface
Recommended Action
5 steps-
Patch: upgrade to TF 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1+.
-
Isolate: restrict network access to TF serving endpoints; enforce strict input validation before user data reaches raw ops.
-
Detect: scan container registries, pip environments, and model-serving infra for TF versions below patched thresholds.
-
Monitor: alert on anomalous process crashes or unexpected memory-related errors in TF serving processes (heap corruption indicators).
-
Verify: confirm patched version via
pip show tensorflowor container image manifests before marking remediated.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2020-15205?
Any TensorFlow deployment processing user-controlled text through StringNGrams is exposed to remote heap overflow and memory disclosure that can defeat ASLR — enabling full system compromise. Patch to TF 1.15.4/2.0.3/2.1.2/2.2.1/2.3.1+ immediately; treat unpatched model-serving endpoints as critical-risk. If immediate patching is not possible, isolate TF inference endpoints from untrusted input sources as a stopgap.
Is CVE-2020-15205 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2020-15205, increasing the risk of exploitation.
How to fix CVE-2020-15205?
1. Patch: upgrade to TF 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1+. 2. Isolate: restrict network access to TF serving endpoints; enforce strict input validation before user data reaches raw ops. 3. Detect: scan container registries, pip environments, and model-serving infra for TF versions below patched thresholds. 4. Monitor: alert on anomalous process crashes or unexpected memory-related errors in TF serving processes (heap corruption indicators). 5. Verify: confirm patched version via `pip show tensorflow` or container image manifests before marking remediated.
What systems are affected by CVE-2020-15205?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, NLP preprocessing pipelines.
What is the CVSS score for CVE-2020-15205?
CVE-2020-15205 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.54%.
Technical Details
NVD Description
In Tensorflow before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, the `data_splits` argument of `tf.raw_ops.StringNGrams` lacks validation. This allows a user to pass values that can cause heap overflow errors and even leak contents of memory In the linked code snippet, all the binary strings after `ee ff` are contents from the memory stack. Since these can contain return addresses, this data leak can be used to defeat ASLR. The issue is patched in commit 0462de5b544ed4731aa2fb23946ac22c01856b80, and is released in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
Exploitation Scenario
An adversary targeting an NLP model API sends a crafted inference request with malformed data_splits values to tf.raw_ops.StringNGrams. The absent validation causes a heap buffer overflow, corrupting adjacent memory structures. By reading leaked stack contents embedded in the error response or via timing side-channels, the adversary recovers return addresses to break ASLR. With ASLR defeated, they chain a follow-up memory corruption payload to achieve RCE inside the model-serving process — gaining access to model weights, in-memory training data, API credentials, and a foothold on the underlying host.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
- lists.opensuse.org/opensuse-security-announce/2020-10/msg00065.html Mailing List 3rd Party
- github.com/tensorflow/tensorflow/commit/0462de5b544ed4731aa2fb23946ac22c01856b80 Patch 3rd Party
- github.com/tensorflow/tensorflow/releases/tag/v2.3.1 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-g7p5-5759-qv46 Exploit 3rd Party
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
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-35939 9.8 TensorFlow: ScatterNd OOB write enables RCE/crash
Same package: tensorflow
AI Threat Alert