CVE-2021-29592: TensorFlow Reshape Operator Null Buffer Backed Tensor Vulnerability

tensorflow Updated 02 Oct 2025

Summary

14/05/2021
Yes i
Moderate
4.4

CVE-2021-29592: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow across 5 version ranges.

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

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-29592 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 industries and research domains for tasks such as image recognition, natural language processing, and recommendation systems.

Vulnerability Detail

The vulnerability (CVE-2021-29592) in TensorFlow arises from a missed case in the fix for CVE-2020-15209. The fix for CVE-2020-15209 addressed an issue in the Reshape operator, but it failed to account for cases where the target shape of the operator is given by the elements of a 1-D tensor. This oversight allows for the passing of a null-buffer-backed tensor with a 1D shape. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial of service.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow==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 specific workaround provided for this vulnerability. However, users can mitigate the risk by following best practices for securing their TensorFlow deployments. This includes ensuring that TensorFlow is kept up to date with the latest security patches, implementing proper access controls, and monitoring for any suspicious activity or unauthorized access to TensorFlow resources.

Conclusion

The vulnerability in TensorFlow's Reshape operator allows for the passing of a null-buffer-backed tensor with a 1D shape, which can be exploited by attackers. It is crucial for users to update their TensorFlow installations to the patched versions as soon as they become available. Regularly checking for updates and following best practices for securing TensorFlow deployments will help mitigate the risk of this vulnerability. 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 ecosystem of tools and libraries for developing and deploying machine learning models.

This vulnerability allows for the passing of a null-buffer-backed tensor with a 1D shape, which can be exploited by an attacker to execute arbitrary code or cause a denial of service.

The vulnerability affects TensorFlow versions 2.1.4, 2.2.3, 2.3.3, and 2.4.2. The upcoming TensorFlow 2.5.0 release will include a fix for this vulnerability.

No specific workaround is provided for this vulnerability. It is recommended to update to the patched versions of TensorFlow as soon as they are available.

To protect your TensorFlow deployment, ensure that you regularly update TensorFlow with the latest security patches, implement proper access controls, and monitor for any suspicious activity or unauthorized access.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.1.4 2.1.4
    pip install --upgrade "tensorflow==2.1.4"
  • >= 2.2.0, < 2.2.3 2.2.3
    pip install --upgrade "tensorflow==2.2.3"
  • >= 2.3.0, < 2.3.3 2.3.3
    pip install --upgrade "tensorflow==2.3.3"
  • >= 2.4.0, < 2.4.2 2.4.2
    pip install --upgrade "tensorflow==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