CVE-2020-26271: TensorFlow: OOB read on saved model load leaks heap addresses
LOW PoC AVAILABLEA crafted TensorFlow SavedModel can trigger out-of-bounds memory reads during graph construction, leaking heap addresses that undermine ASLR. Exploitation requires local access and the ability to supply a malicious model file — the realistic threat is a supply chain attack where a poisoned model reaches your inference or training infrastructure. Patch to TF 1.15.5/2.0.4/2.1.3/2.2.2/2.3.2/2.4.0+ and enforce cryptographic verification of model artifacts before loading.
What is the risk?
Low standalone severity (CVSS 3.3) due to local-only attack vector and limited direct impact. However, in AI/ML environments the risk profile elevates slightly: models are routinely downloaded from public registries, shared across teams, and loaded with elevated privileges inside GPU-attached hosts. If chained with a memory corruption primitive, the address leak could bypass ASLR. Organizations with uncontrolled model sourcing or no artifact signing are the primary risk group.
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 TensorFlow to 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, or 2.4.0+.
-
Enforce cryptographic signing (SHA-256 hash + signature) for all SavedModel artifacts and validate before loading.
-
Restrict model loading to trusted, internally-vetted sources; block unauthenticated model downloads in CI/CD and serving pipelines.
-
Run model loading in sandboxed environments (containers with seccomp/AppArmor) to limit blast radius of any memory disclosure.
-
For detection, monitor for unusual heap-spray patterns or repeated model-load failures on inference nodes — no public exploit code is known.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2020-26271?
A crafted TensorFlow SavedModel can trigger out-of-bounds memory reads during graph construction, leaking heap addresses that undermine ASLR. Exploitation requires local access and the ability to supply a malicious model file — the realistic threat is a supply chain attack where a poisoned model reaches your inference or training infrastructure. Patch to TF 1.15.5/2.0.4/2.1.3/2.2.2/2.3.2/2.4.0+ and enforce cryptographic verification of model artifacts before loading.
Is CVE-2020-26271 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2020-26271, increasing the risk of exploitation.
How to fix CVE-2020-26271?
1. Patch TensorFlow to 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, or 2.4.0+. 2. Enforce cryptographic signing (SHA-256 hash + signature) for all SavedModel artifacts and validate before loading. 3. Restrict model loading to trusted, internally-vetted sources; block unauthenticated model downloads in CI/CD and serving pipelines. 4. Run model loading in sandboxed environments (containers with seccomp/AppArmor) to limit blast radius of any memory disclosure. 5. For detection, monitor for unusual heap-spray patterns or repeated model-load failures on inference nodes — no public exploit code is known.
What systems are affected by CVE-2020-26271?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, MLOps pipelines, model registries.
What is the CVSS score for CVE-2020-26271?
CVE-2020-26271 has a CVSS v3.1 base score of 3.3 (LOW). The EPSS exploitation probability is 0.21%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.003 Model AML.T0011.000 Unsafe AI Artifacts AML.T0025 Exfiltration via Cyber Means AML.T0058 Publish Poisoned Models Compliance Controls Affected
What are the technical details?
Original Advisory
In affected versions of TensorFlow under certain cases, loading a saved model can result in accessing uninitialized memory while building the computation graph. The MakeEdge function creates an edge between one output tensor of the src node (given by output_index) and the input slot of the dst node (given by input_index). This is only possible if the types of the tensors on both sides coincide, so the function begins by obtaining the corresponding DataType values and comparing these for equality. However, there is no check that the indices point to inside of the arrays they index into. Thus, this can result in accessing data out of bounds of the corresponding heap allocated arrays. In most scenarios, this can manifest as unitialized data access, but if the index points far away from the boundaries of the arrays this can be used to leak addresses from the library. This is fixed in versions 1.15.5, 2.0.4, 2.1.3, 2.2.2, 2.3.2, and 2.4.0.
Exploitation Scenario
An adversary compromises a public model repository or HuggingFace-style hub and publishes a TensorFlow SavedModel with edge indices in the graph definition that reference out-of-bounds positions in the type arrays inside MakeEdge. A data scientist or automated MLOps pipeline pulls and loads the model. During graph construction, TensorFlow reads beyond heap array boundaries, returning uninitialized memory containing library addresses. These addresses let the adversary calculate the ASLR base offset for libtensorflow, potentially enabling a chained follow-on exploit (e.g., a separately crafted model with an RCE primitive that now has a reliable memory layout). The victim sees no error unless the index is far enough out of bounds to cause a segfault.
Weaknesses (CWE)
CWE-125 Out-of-bounds Read
Primary
CWE-908 Use of Uninitialized Resource
Primary
CWE-125 Out-of-bounds Read CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] Use a language that provides appropriate memory abstractions.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N References
- github.com/tensorflow/tensorflow/commit/0cc38aaa4064fd9e79101994ce9872c6d91f816b Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-q263-fvxm-m5mw Exploit Patch 3rd Party
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-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow