LiveActive security incident?Get immediate response
CVE Record

CVE-2021-37643: Null pointer dereference in `MatrixDiagPartOp` in TensorFlow

TensorFlow is an end-to-end open source platform for machine learning. If a user does not provide a valid padding value to `tf.raw_ops.MatrixDiagPartOp`, then the code triggers a null pointer dereference (if input is empty) or produces invalid behavior, ignoring all values after the first. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/linalg/matrix_diag_op.cc#L89) reads the first value from a tensor buffer without first checking that the tensor has values to read from. We have patched the issue in GitHub commit 482da92095c4d48f8784b1f00dda4f81c28d2988. 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 flaw in TensorFlow can crash or mishandle matrix diagonal operations when invalid padding data is supplied. For organizations running TensorFlow in ML services, notebooks, or pipelines, the business risk is disruption or corrupted computation if untrusted inputs can reach this operation.

Executive priority

Treat this as a high-priority dependency upgrade for ML systems exposed to shared users or untrusted data. It is less urgent for isolated, trusted-only workloads, but still should be remediated through normal security patching.

Technical view

CVE-2021-37643 is a CWE-476 null pointer dereference in tf.raw_ops.MatrixDiagPartOp. The implementation reads the first padding tensor value without confirming the tensor contains data. Empty input can trigger a null dereference; invalid padding can also cause incorrect behavior. CVSS is 7.7 high.

Likely exposure

Exposure is most likely in TensorFlow deployments that execute user-influenced models, tensors, notebooks, or ML jobs. Affected versions include TensorFlow 2.5.0 before 2.5.1, 2.4.x before 2.4.3, and versions before 2.3.4 as listed in the source bundle.

Exploitation context

The supplied sources do not show active exploitation, and KEV is false. The CVSS vector is local, low complexity, no privileges, and no user interaction, meaning risk is higher where attackers can cause TensorFlow code execution or supply data into trusted ML execution contexts.

Researcher notes

The strongest evidence is the TensorFlow advisory and patch commit. No source in the bundle provides exploit-in-the-wild evidence or a public weaponized exploit. Validation should focus on affected TensorFlow versions and reachability of MatrixDiagPartOp with attacker-influenced padding tensors.

Mitigation direction

  • Upgrade TensorFlow to 2.6.0 or a patched supported branch release.
  • Use TensorFlow 2.5.1, 2.4.3, or 2.3.4 where those branches are required.
  • Prioritize systems processing untrusted ML inputs or shared notebook workloads.
  • Check TensorFlow vendor guidance if pinned dependencies block upgrade.
  • Restrict who can submit models, tensors, or notebooks to production ML runtimes.

Validation and detection

  • Inventory TensorFlow versions across applications, containers, notebooks, and model-serving images.
  • Flag TensorFlow versions matching the affected ranges in the source bundle.
  • Identify code paths using tf.raw_ops.MatrixDiagPartOp or matrix diagonal helpers.
  • Review whether untrusted users can influence tensors reaching those paths.
  • Confirm patched TensorFlow builds are deployed 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-37643 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-37643Attack 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.