CVE-2021-29612: TensorFlow - Heap Buffer Overflow in BandedTriangularSolve

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29612: Heap buffer overflow in BandedTriangularSolve. 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-29612 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 for developing and deploying machine learning models. TensorFlow is widely used in various industries and research domains due to its flexibility and scalability. However, a vulnerability has been discovered in the implementation of tf.raw_ops.BandedTriangularSolve in TensorFlow.

Vulnerability Detail

The vulnerability arises from a heap buffer overflow in the Eigen implementation of tf.raw_ops.BandedTriangularSolve. The implementation fails to validate that the two input tensors are not empty, leading to a potential heap buffer overflow. Additionally, the validation present in the code is ineffective due to a missing check of the ctx->status() value. This vulnerability can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition. The impact of this vulnerability is rated as high.

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 specific workaround provided for this vulnerability.

Conclusion

In conclusion, TensorFlow is affected by a heap buffer overflow vulnerability in the BandedTriangularSolve implementation. This vulnerability can be mitigated by updating to TensorFlow 2.5.0 or applying the fix on the affected versions. For further support on vulnerability remediation, you can 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 for developing and deploying machine learning models.

The vulnerability can be exploited by an attacker to execute arbitrary code or cause a denial-of-service condition. The impact is rated as high.

To fix this vulnerability, update TensorFlow to version 2.5.0 or any subsequent version. Alternatively, you can apply the fix by cherrypicking the commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3, or TensorFlow 2.1.4.

No specific workarounds have been provided for this vulnerability.

For more information about this vulnerability, you can refer to the provided source link in the vulnerability details.

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