LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37647: Null pointer dereference in `SparseTensorSliceDataset` in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. When a user does not supply arguments that determine a valid sparse tensor, `tf.raw_ops.SparseTensorSliceDataset` implementation can be made to dereference a null pointer. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/data/sparse_tensor_slice_dataset_op.cc#L240-L251) has some argument validation but fails to consider the case when either `indices` or `values` are provided for an empty sparse tensor when the other is not. If `indices` is empty, then [code that performs validation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/data/sparse_tensor_slice_dataset_op.cc#L260-L261) (i.e., checking that the indices are monotonically increasing) results in a null pointer dereference. If `indices` as provided by the user is empty, then `indices` in the C++ code above is backed by an empty `std::vector`, hence calling `indices->dim_size(0)` results in null pointer dereferencing (same as calling `std::vector::at()` on an empty vector). We have patched the issue in GitHub commit 02cc160e29d20631de3859c6653184e3f876b9d7. 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 7.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A malformed TensorFlow sparse tensor dataset call can crash the TensorFlow process because validation may dereference a null pointer. Business risk is highest in shared ML environments where untrusted users can influence TensorFlow operations or inputs.

Executive priority

Prioritize remediation for shared or user-extensible ML platforms, especially notebooks and job runners. For isolated workloads with trusted code and controlled inputs, urgency is lower but still appropriate because patched releases are available.

Technical view

CVE-2021-37647 is a CWE-476 null pointer dereference in tf.raw_ops.SparseTensorSliceDataset. Empty or mismatched sparse tensor indices and values bypass incomplete validation; later monotonicity checks dereference an empty backing vector. The vendor patched this in commit 02cc160e29d20631de3859c6653184e3f876b9d7.

Likely exposure

Exposure is limited to TensorFlow deployments using affected versions: 2.5.0 before 2.5.1, 2.4.x before 2.4.3, and versions before 2.3.4. Risk depends on whether untrusted users, jobs, notebooks, or data paths can trigger this raw operation.

Exploitation context

The source bundle does not show active exploitation, KEV listing, or public weaponization. CVSS describes local attack vector, low complexity, no privileges, and no user interaction, with high integrity and availability impact and no confidentiality impact.

Researcher notes

The provided evidence supports the affected versions, vulnerable operation, root cause, CVSS score, CWE, and patch commit. It does not establish active exploitation, network reachability, or a vendor workaround beyond upgrading to patched TensorFlow releases.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or a patched supported branch release.
  • For 2.5.x, upgrade to TensorFlow 2.5.1 or later.
  • For 2.4.x, upgrade to TensorFlow 2.4.3 or later.
  • For 2.3.x or older, upgrade to TensorFlow 2.3.4 or later.
  • Check TensorFlow advisory guidance for any environment-specific remediation details.

Validation and detection

  • Inventory deployed TensorFlow package versions across training and inference environments.
  • Check dependency lockfiles, images, notebooks, and ML worker runtimes for affected versions.
  • Identify whether untrusted users can run TensorFlow code or submit tensor-processing jobs.
  • Confirm patched versions are running after redeployment.
  • Review crash logs for TensorFlow sparse tensor dataset failures.
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-37647 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.7 (3.1)
Known Exploited
No
Published

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

Vulnerability scoring details

Base CVSS 3.1 score

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

Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/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.