CVE-2021-29590: TensorFlow TFLite: OOB read via empty tensor in Min/Max ops

HIGH PoC AVAILABLE
Published May 14, 2021
CISO Take

Upgrade all TFLite deployments to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 now. An attacker with local access (including co-tenant processes or container escapes) can craft empty tensor inputs to the Minimum/Maximum operators and read arbitrary heap memory—potentially leaking model weights, intermediate activation data, or process secrets—or crash the inference runtime entirely. If you ship TFLite on edge devices or in containerized serving environments, treat this as priority patching regardless of the 2021 publication date.

What is the risk?

Risk is HIGH in edge and on-device deployments, MEDIUM in containerized model-serving environments. The local attack vector caps real-world blast radius for internet-exposed systems, but 'local' in ML infrastructure often means a co-tenant microservice, a compromised notebook server, or a malicious TFLite model file distributed through an internal model registry. CVSS confidentiality impact is HIGH (heap OOB read can expose arbitrary process memory), availability impact is HIGH (crash/segfault). No CISA KEV listing and no reported active exploitation reduces urgency, but the low attack complexity (no special skill required once the model file is crafted) keeps this firmly in the patching queue.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
7.1 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 10% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C High
I None
A High

What should I do?

5 steps
  1. PATCH

    Upgrade to TensorFlow 2.5.0, or cherry-pick to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4 per your branch. Commit 953f28d is the authoritative fix.

  2. INPUT VALIDATION

    Add pre-inference checks that validate no input tensor has shape with zero-length dimensions before passing to TFLite interpreter. Reject empty tensors at the serving layer.

  3. MODEL PROVENANCE

    Restrict ingestion of .tflite model files to trusted, signed sources. Implement model registry signing and hash verification to block malicious model file injection.

  4. CONTAINER ISOLATION

    Ensure TFLite inference processes run with minimal privileges and strong container isolation to limit the impact of a heap read primitive.

  5. DETECTION

    Monitor for inference process crashes (SIGSEGV/SIGABRT) originating from tflite::reference_ops::MaximumMinimumBroadcast* call stacks—these are indicators of exploitation attempts.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.10.5 - AI system security — vulnerability management
NIST AI RMF
MANAGE 2.2 - Mechanisms are in place to track and manage AI risks
OWASP LLM Top 10
LLM05:2025 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2021-29590?

Upgrade all TFLite deployments to TF 2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4 now. An attacker with local access (including co-tenant processes or container escapes) can craft empty tensor inputs to the Minimum/Maximum operators and read arbitrary heap memory—potentially leaking model weights, intermediate activation data, or process secrets—or crash the inference runtime entirely. If you ship TFLite on edge devices or in containerized serving environments, treat this as priority patching regardless of the 2021 publication date.

Is CVE-2021-29590 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2021-29590, increasing the risk of exploitation.

How to fix CVE-2021-29590?

1. PATCH: Upgrade to TensorFlow 2.5.0, or cherry-pick to 2.4.2 / 2.3.3 / 2.2.3 / 2.1.4 per your branch. Commit 953f28d is the authoritative fix. 2. INPUT VALIDATION: Add pre-inference checks that validate no input tensor has shape with zero-length dimensions before passing to TFLite interpreter. Reject empty tensors at the serving layer. 3. MODEL PROVENANCE: Restrict ingestion of .tflite model files to trusted, signed sources. Implement model registry signing and hash verification to block malicious model file injection. 4. CONTAINER ISOLATION: Ensure TFLite inference processes run with minimal privileges and strong container isolation to limit the impact of a heap read primitive. 5. DETECTION: Monitor for inference process crashes (SIGSEGV/SIGABRT) originating from tflite::reference_ops::MaximumMinimumBroadcast* call stacks—these are indicators of exploitation attempts.

What systems are affected by CVE-2021-29590?

This vulnerability affects the following AI/ML architecture patterns: edge inference, on-device ML (mobile/embedded), model serving, training pipelines, containerized inference.

What is the CVSS score for CVE-2021-29590?

CVE-2021-29590 has a CVSS v3.1 base score of 7.1 (HIGH). The EPSS exploitation probability is 0.20%.

What is the AI security impact?

Affected AI Architectures

edge inferenceon-device ML (mobile/embedded)model servingtraining pipelinescontainerized inference

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0011.000 Unsafe AI Artifacts
AML.T0025 Exfiltration via Cyber Means
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.10.5
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

TensorFlow is an end-to-end open source platform for machine learning. The implementations of the `Minimum` and `Maximum` TFLite operators can be used to read data outside of bounds of heap allocated objects, if any of the two input tensor arguments are empty. This is because the broadcasting implementation(https://github.com/tensorflow/tensorflow/blob/0d45ea1ca641b21b73bcf9c00e0179cda284e7e7/tensorflow/lite/kernels/internal/reference/maximum_minimum.h#L52-L56) indexes in both tensors with the same index but does not validate that the index is within bounds. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.

Exploitation Scenario

An adversary with access to an internal model registry or model-serving pipeline crafts a TFLite flatbuffer model containing a Minimum or Maximum operator where one input tensor is defined with an empty shape (e.g., shape=[0]). When the TFLite interpreter executes the broadcasting kernel, it iterates using a computed index against both tensors but does not bounds-check against the empty tensor's zero-length buffer. The CPU reads from heap memory adjacent to the empty tensor allocation, potentially exposing the weights of co-loaded model layers, LSTM cell states, or other inference context. In a multi-tenant model serving environment (e.g., a shared inference microservice), this leaks data from other tenants' inference sessions. The same crafted model causes the inference process to segfault if the OOB address is unmapped, enabling a targeted denial of service against a specific inference worker.

Weaknesses (CWE)

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:H/I:N/A:H

Timeline

Published
May 14, 2021
Last Modified
November 21, 2024
First Seen
May 14, 2021

Related Vulnerabilities