LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37690: Use after free and segfault in shape inference functions in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. In affected versions when running shape functions, some functions (such as `MutableHashTableShape`) produce extra output information in the form of a `ShapeAndType` struct. The shapes embedded in this struct are owned by an inference context that is cleaned up almost immediately; if the upstream code attempts to access this shape information, it can trigger a segfault. `ShapeRefiner` is mitigating this for normal output shapes by cloning them (and thus putting the newly created shape under ownership of an inference context that will not die), but we were not doing the same for shapes and types. This commit fixes that by doing similar logic on output shapes and types. We have patched the issue in GitHub commit ee119d4a498979525046fba1c3dd3f13a039fbb1. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

MediumCVSS 6.6Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

TensorFlow had a memory lifetime bug in shape inference. In affected versions, some shape metadata could point to data that was already cleaned up, causing crashes and limited confidentiality or integrity impact. Business urgency is moderate, focused on ML systems where users can run TensorFlow workloads.

Executive priority

Treat as a moderate remediation item. Prioritize shared ML platforms, multi-user research environments, and production systems where TensorFlow availability matters. It is less urgent than remotely exploitable critical issues based on supplied evidence.

Technical view

The issue is CWE-416 use-after-free in TensorFlow shape inference. ShapeAndType structs could hold shapes owned by a short-lived inference context. Later access could segfault. TensorFlow fixed this by cloning shapes and types, with fixes planned in 2.6.0 and backports to 2.5.1, 2.4.3, and 2.3.4.

Likely exposure

Exposure is most likely in environments running affected TensorFlow versions where local users or jobs can execute TensorFlow graphs that trigger shape inference. The CVSS vector is local, low complexity, low privileges, no user interaction, with high availability impact.

Exploitation context

The supplied sources do not cite active exploitation, and the CVE is not marked KEV. The described impact is a crash from use-after-free during shape inference, not a confirmed remote compromise path.

Researcher notes

CVSS 3.1 is 6.6: AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H. The key fix is commit ee119d4a, which applies ShapeRefiner-style cloning to output shapes and types. No exploit details are provided in the source bundle.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or a patched backport release.
  • Patch TensorFlow 2.5.x to at least 2.5.1.
  • Patch TensorFlow 2.4.x to at least 2.4.3.
  • Patch TensorFlow 2.3.x to at least 2.3.4.
  • Check TensorFlow vendor guidance for unsupported older branches.

Validation and detection

  • Inventory TensorFlow versions in applications, notebooks, containers, and ML runtime images.
  • Compare findings against affected ranges listed in the advisory.
  • Confirm patched versions are deployed in shared ML execution environments.
  • Review crash reports for TensorFlow shape inference failures after deployment.
Prepared
Confidence
high
Sources
4

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-416: 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-37690 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
Medium
CVSS
6.6 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/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
3Source 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
6.6CVSS 3.1MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H1.84.7Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

6.6Medium
CVSS 3.1 vector shape for CVE-2021-37690Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/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.5.0, < 2.5.1, >= 2.4.0, < 2.4.3, < 2.3.4Listed
Weakness

CWE details

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

CWE-416 · source CWE mapping

Use After Free

Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.