CVE-2021-29536: Heap Buffer Overflow in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29536: Heap buffer overflow in QuantizedReshape. 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-29536 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been identified in TensorFlow that can lead to a heap buffer overflow.

Vulnerability Detail

The vulnerability, identified as CVE-2021-29536, exists in the QuantizedReshape function of TensorFlow. It can be exploited by an attacker by passing invalid thresholds for the quantization. The implementation assumes that the arguments are valid scalars and directly accesses the numeric value. However, if any of the tensors is empty, accessing the element at position 0 results in a heap buffer overflow. This vulnerability can have severe consequences, including potential remote code execution or denial of service.

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 currently no known workaround for this vulnerability. It is recommended to apply the official fix or update to the patched versions of TensorFlow.

Conclusion

The identified vulnerability in TensorFlow can result in a heap buffer overflow, posing significant security risks. Users are strongly advised to update their TensorFlow installations to the fixed versions as soon as they become available. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive set of tools and resources for developing and deploying machine learning models.

This vulnerability can lead to a heap buffer overflow, which can have severe consequences, including potential remote code execution or denial of service.

The vulnerability will be fixed in TensorFlow 2.5.0. Users are advised to update their installations to the fixed versions as soon as they become available.

Yes, older versions of TensorFlow, including 2.4.2, 2.3.3, 2.2.3, and 2.1.4, are also affected by this vulnerability.

There is currently no known workaround for this vulnerability. It is recommended to apply the official fix or update to the patched versions of TensorFlow.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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