CVE-2021-37657
Python vulnerability analysis and mitigation

Overview

TensorFlow, an end-to-end open source platform for machine learning, was found to contain a vulnerability (CVE-2021-37657) that allows attackers to cause undefined behavior through binding a reference to a null pointer in operations of type tf.raw_ops.MatrixDiagV*. The vulnerability was discovered and disclosed in August 2021, affecting TensorFlow versions prior to 2.6.0 (GitHub Advisory, NVD).

Technical details

The vulnerability stems from incomplete validation of the 'k' parameter in the matrix_diag_op.cc implementation. While the code checks if the value is a scalar or vector, it fails to verify the number of elements. When an empty tensor is provided, the code attempts to access the first element of the tensor through 'diag_index.flat()(0)', leading to a null pointer dereference (GitHub Advisory). The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (HIGH) with vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

The vulnerability can lead to undefined behavior when exploited, potentially causing program crashes or other unintended behavior in applications using the affected TensorFlow operations (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in TensorFlow versions 2.3.4, 2.4.3, 2.5.1, and 2.6.0. Users are recommended to upgrade to these patched versions. The fix includes additional validation to ensure the diag_index tensor has at least one element (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-5882-5rx9-xgxpCRITICAL10
  • PythonPython
  • crawl4ai
NoYesJan 16, 2026
GHSA-vx9w-5cx4-9796HIGH8.6
  • PythonPython
  • crawl4ai
NoYesJan 16, 2026
CVE-2026-23535HIGH8
  • PythonPython
  • wlc
NoYesJan 16, 2026
CVE-2026-23490HIGH7.5
  • PythonPython
  • pyasn1
NoYesJan 16, 2026
CVE-2026-23528MEDIUM5.3
  • PythonPython
  • distributed
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management