CVE-2021-37640
Python vulnerability analysis and mitigation

Overview

TensorFlow's implementation of tf.raw_ops.SparseReshape contained a vulnerability (CVE-2021-37640) that could trigger an integral division by zero exception. The vulnerability was discovered in versions prior to 2.6.0 and affected the sparse tensor reshaping functionality. The issue was patched in TensorFlow 2.6.0 and backported to version 2.5.1 (GitHub Advisory).

Technical details

The vulnerability existed in the implementation of tf.raw_ops.SparseReshape where the reshaping functor was called whenever there was at least one index in the input, without verifying that both the input shape and target shape had non-zero number of elements. The reshape functor would perform division operations using the dimensions of the target shape without proper validation, leading to potential division by zero errors (GitHub Commit).

Impact

When exploited, this vulnerability could cause the application to crash due to division by zero exceptions, potentially leading to denial of service conditions. The issue could be triggered by providing specific inputs to the SparseReshape operation where either the input shape or target shape contained zero elements (GitHub Advisory).

Mitigation and workarounds

The issue was fixed by adding validation checks to ensure that when reshaping tensors with non-zero elements, both the input and output shapes must have non-zero elements. Users are advised to upgrade to TensorFlow version 2.6.0 or apply the backported fix in version 2.5.1 (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

CVE-2025-66423HIGH7.1
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-66454MEDIUM6.5
  • PythonPython
  • arcade-mcp-server
NoYesDec 02, 2025
CVE-2025-66424MEDIUM6.5
  • PythonPython
  • trytond
NoYesNov 30, 2025
CVE-2025-66422MEDIUM4.3
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-65858LOW3.5
  • PythonPython
  • calibreweb
NoNoDec 02, 2025

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