LiveActive security incident?Get immediate response
CVE Record

CVE-2021-29591: Stack overflow due to looping TFLite subgraph

TensorFlow is an end-to-end open source platform for machine learning. TFlite graphs must not have loops between nodes. However, this condition was not checked and an attacker could craft models that would result in infinite loop during evaluation. In certain cases, the infinite loop would be replaced by stack overflow due to too many recursive calls. For example, the `While` implementation(https://github.com/tensorflow/tensorflow/blob/106d8f4fb89335a2c52d7c895b7a7485465ca8d9/tensorflow/lite/kernels/while.cc) could be tricked into a scneario where both the body and the loop subgraphs are the same. Evaluating one of the subgraphs means calling the `Eval` function for the other and this quickly exhaust all stack space. 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. Please consult our security guide(https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.

HighCVSS 7.3Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malicious TensorFlow Lite model can make vulnerable TensorFlow versions loop during evaluation and, in some cases, exhaust stack memory. Business risk is highest where untrusted or externally supplied models are accepted. The source bundle shows high severity but no known CISA KEV listing or cited active exploitation.

Executive priority

Treat as a high-priority patch for ML systems that process outside models. Internal-only, tightly controlled model workflows have lower urgency but should still update during normal security maintenance.

Technical view

TFLite graphs should not contain loops between nodes, but affected TensorFlow releases did not enforce this. A crafted model could create recursive subgraph evaluation, including a While case where body and loop subgraphs are the same, causing infinite looping or stack overflow.

Likely exposure

Exposure is most likely in systems using affected TensorFlow versions to load or evaluate TFLite models, especially when models come from users, partners, marketplaces, CI pipelines, or other less-trusted sources.

Exploitation context

The sources describe crafted-model exploitation requiring the attacker to supply a model to a vulnerable evaluator. KEV is false, and the provided sources do not claim active exploitation in the wild.

Researcher notes

The key issue is missing validation that TFLite graphs have no loops between nodes. The cited fix commits and GitHub advisory are the primary evidence. No source-provided standalone workaround or exploitation evidence was included beyond upgrading to fixed releases.

Mitigation direction

  • Upgrade TensorFlow to 2.5.0 or a fixed supported backport.
  • Use 2.4.2, 2.3.3, 2.2.3, or 2.1.4 where pinned to those branches.
  • Restrict TFLite model ingestion to trusted, approved sources.
  • Review TensorFlow security guidance for model trust assumptions.
  • Prioritize externally supplied model evaluation paths first.

Validation and detection

  • Inventory TensorFlow versions in runtime images and dependency lockfiles.
  • Identify services or workflows that evaluate TFLite models.
  • Confirm vulnerable ranges are not deployed in production or CI.
  • Check whether untrusted users can upload or influence models.
  • Review crash or denial-of-service telemetry around model evaluation.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-835: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-29591 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.3 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
4Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.3CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H1.85.5Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.3High
CVSS 3.1 vector shape for CVE-2021-29591Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone
Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
tensorflowtensorflow< 2.1.4, >= 2.2.0, < 2.2.3, >= 2.3.0, < 2.3.3, >= 2.4.0, < 2.4.2Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-835 · source CWE mapping

Loop with Unreachable Exit Condition ('Infinite Loop')

Loop with Unreachable Exit Condition ('Infinite Loop') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.