CVE-2021-29531
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-29531) that allows attackers to trigger a CHECK fail in PNG encoding. The vulnerability was discovered in May 2021 and affects versions prior to 2.5.0. The issue impacts multiple versions of TensorFlow including versions before 2.1.4, 2.2.3, 2.3.3, and 2.4.2 (GitHub Advisory).

Technical details

The vulnerability exists because the implementation only validates that the total number of pixels in the image does not overflow, allowing an attacker to send an empty matrix for encoding. When the tensor is empty, the associated buffer becomes nullptr. When calling png::WriteImageToBuffer, the first argument (image.flat().data()) is NULL, which triggers the CHECK_NOTNULL in the first line of png::WriteImageToBuffer. This results in abort being called after printing the stacktrace (NVD).

Impact

The vulnerability allows an attacker to mount a denial of service attack by causing the application to abort execution. The CVSS v3.1 base score is 5.5 MEDIUM, indicating moderate severity with local access required (NVD).

Mitigation and workarounds

The issue has been patched in TensorFlow 2.5.0. The fix was also backported to TensorFlow 2.4.2, 2.3.3, 2.2.3, and 2.1.4. Users are advised to upgrade to these patched versions. The fix involves adding additional validation to check for empty tensors before processing (GitHub Commit).

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-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 11, 2025
CVE-2025-13780CRITICAL9.1
  • PythonPython
  • cpe:2.3:a:pgadmin:pgadmin
NoYesDec 11, 2025
CVE-2025-67644HIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 11, 2025
CVE-2025-67720MEDIUM6.5
  • PythonPython
  • pyrofork
NoYesDec 11, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 10, 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