LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37639: Null pointer dereference and heap OOB read in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. When restoring tensors via raw APIs, if the tensor name is not provided, TensorFlow can be tricked into dereferencing a null pointer. Alternatively, attackers can read memory outside the bounds of heap allocated data by providing some tensor names but not enough for a successful restoration. The [implementation](https://github.com/tensorflow/tensorflow/blob/47a06f40411a69c99f381495f490536972152ac0/tensorflow/core/kernels/save_restore_tensor.cc#L158-L159) retrieves the tensor list corresponding to the `tensor_name` user controlled input and immediately retrieves the tensor at the restoration index (controlled via `preferred_shard` argument). This occurs without validating that the provided list has enough values. If the list is empty this results in dereferencing a null pointer (undefined behavior). If, however, the list has some elements, if the restoration index is outside the bounds this results in heap OOB read. We have patched the issue in GitHub commit 9e82dce6e6bd1f36a57e08fa85af213e2b2f2622. 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.

HighCVSS 8.4Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

CVE-2021-37639 is a TensorFlow flaw in tensor restoration. Malformed or incomplete tensor names can make affected TensorFlow versions crash or read heap memory outside expected bounds. The main concern is ML workloads that restore tensors from inputs or checkpoints influenced by untrusted users.

Executive priority

Treat as high priority for ML platforms running affected TensorFlow versions, especially shared or user-facing environments. There is no cited active exploitation, but the vendor-confirmed memory-safety impact and available fixes justify prompt remediation.

Technical view

TensorFlow raw restore APIs used tensor_name-controlled lookup results and indexed them using preferred_shard without validating list size. An empty list can cause null pointer dereference; an undersized list can cause heap out-of-bounds read. TensorFlow fixed this in commit 9e82dce6e6bd1f36a57e08fa85af213e2b2f2622 and planned patched releases.

Likely exposure

Exposure is limited to affected TensorFlow versions: 2.5.0, 2.4.0 through 2.4.2, and versions before 2.3.4. Highest-risk environments are ML services, pipelines, notebooks, or batch jobs where untrusted users can influence tensor names, checkpoints, or restore parameters.

Exploitation context

The source bundle does not indicate CISA KEV listing or active exploitation. The CVSS vector is local, low complexity, no privileges, no user interaction, with high confidentiality, integrity, and availability impact. Evidence supports serious exposure where an attacker can reach affected restoration behavior.

Researcher notes

The key validation point is reachability: affected versions alone are not enough; confirm whether raw tensor restore behavior is reachable with attacker-influenced inputs. Do not assume unrelated TensorFlow products or later branches are affected without vendor evidence.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or later where feasible.
  • Apply TensorFlow 2.5.1, 2.4.3, or 2.3.4 for supported affected branches.
  • Check TensorFlow advisory guidance for branch-specific remediation details.
  • Restrict untrusted control over tensor names, checkpoints, and restore parameters.
  • Prioritize internet-adjacent or shared ML execution environments first.

Validation and detection

  • Inventory TensorFlow versions in applications, notebooks, containers, and ML worker images.
  • Check dependency manifests and SBOMs for affected TensorFlow version ranges.
  • Identify code paths using raw tensor restoration APIs.
  • Review whether users can influence tensor names, checkpoints, or preferred_shard values.
  • Confirm deployed runtimes use patched TensorFlow versions after remediation.
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-476: 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-37639 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
8.4 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/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
8.4CVSS 3.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H2.55.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

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

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/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-476 · source CWE mapping

NULL Pointer Dereference

NULL Pointer Dereference represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.