CVE-2021-29565
Python vulnerability analysis and mitigation

Overview

TensorFlow, an end-to-end open source platform for machine learning, was found to contain a null pointer dereference vulnerability (CVE-2021-29565) in the implementation of tf.raw_ops.SparseFillEmptyRows. The vulnerability was discovered by Yakun Zhang and Ying Wang of Baidu X-Team and disclosed on May 14, 2021. The issue affects multiple versions of TensorFlow including versions up to 2.1.4, 2.2.0-2.2.3, 2.3.0-2.3.3, and 2.4.0-2.4.2 (GitHub Advisory).

Technical details

The vulnerability stems from missing validation in the implementation of tf.raw_ops.SparseFillEmptyRows. When the dense_shape tensor is empty, dense_shape_t.vec<>() causes a null pointer dereference in the operation's implementation. The issue was originally marked under a TODO comment in the code. The vulnerability has been assigned a CVSS v3.1 base score of 5.5 (MEDIUM) by NIST with a vector of CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H, while GitHub assessed it as LOW with a score of 2.5 (NVD).

Impact

The vulnerability allows an attacker to trigger a null pointer dereference in the TensorFlow library, which could lead to application crashes. The impact is primarily limited to availability issues, with no direct impact on confidentiality or integrity of the system (GitHub Advisory).

Exploitability

The vulnerability can be exploited by providing an empty dense_shape tensor to the tf.raw_ops.SparseFillEmptyRows operation. A proof-of-concept exploit involves using specific TensorFlow commands with empty tensors (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in TensorFlow 2.5.0. The fix has also been backported to TensorFlow versions 2.4.2, 2.3.3, 2.2.3, and 2.1.4. Users are advised to upgrade to these patched versions. The fix includes adding validation to check if the dense shape is empty (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Arch Linux

Fixed

rolling

tensorflow: 2.5.0-1

Fixed

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-66455CRITICAL9.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-63374CRITICAL9.3
  • Python logoPython
  • airflow-3
NoYesSep 18, 2026
CVE-2026-59163CRITICAL9.1
  • Python logoPython
  • mnemosyne-memory
NoYesSep 18, 2026
CVE-2026-33625HIGH8.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-64847MEDIUM6.8
  • Python logoPython
  • py3-anyio
NoYesSep 18, 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