CVE-2021-29531: Denial of Service Vulnerability in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2021-29531: CHECK-fail in tf.raw_ops.EncodePng. Affects tensorflow across 4 version ranges.

< 2.1.4 >= 2.2.0, < 2.2.3 >= 2.3.0, < 2.3.3 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-29531 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and community resources that enable researchers and developers to build and deploy machine learning models. TensorFlow is widely used in various industries for tasks such as image recognition, natural language processing, and recommendation systems. However, a vulnerability has been discovered in TensorFlow that can lead to a denial of service attack.

Vulnerability Detail

The vulnerability in TensorFlow arises from a flaw in the PNG encoding functionality. When encoding an image, the implementation fails to validate the input tensor for empty pixel data. This allows an attacker to provide an empty matrix as input, resulting in a null pointer dereference. As a consequence, the program crashes with an abort call, effectively causing a denial of service. This vulnerability can be exploited remotely by an attacker with the ability to send malicious input to the affected system.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to follow the steps mentioned in the 'how_to_fix' section to upgrade to the patched versions of TensorFlow.

Conclusion

The vulnerability in TensorFlow can lead to a denial of service attack by crashing the affected application. It is crucial to upgrade to the patched versions of TensorFlow or apply the necessary updates to mitigate the risk. Regularly checking for updates and following best practices for software security is recommended. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

This vulnerability allows an attacker to mount a denial of service attack by crashing the affected TensorFlow application. This can lead to service disruption and potential loss of data.

Yes, this vulnerability can be exploited remotely by an attacker who can send malicious input to the affected system.

There are no known instances of this vulnerability being exploited in the wild at the time of this report. However, it is important to apply the necessary patches and updates to mitigate the risk.

Yes, the TensorFlow development team has released patches for this vulnerability in TensorFlow versions 2.5.0, 2.4.2, 2.3.3, 2.2.3, and 2.1.4. It is recommended to upgrade to the latest patched version.

For more information about this vulnerability, you can refer to the official TensorFlow security advisory or contact the TensorFlow development team.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback