CVE-2021-41208: TensorFlow Boosted Trees API Denial of Service and Heap Buffer Overflow

tensorflow-cpu Updated 02 Oct 2025

Summary

05/11/2021
Yes i
Unrated
Not published

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

< 2.4.4 >= 2.5.0, < 2.5.2 >= 2.6.0, < 2.6.1 >= 2.7.0rc0, < 2.7.0 < 5c8c9a8bfe750f9743d0c859bae112060b216f5c

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-41208 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 open source platform for machine learning. It provides a wide range of tools and libraries for building and deploying machine learning models. The Boosted Trees API in TensorFlow allows users to train and use boosted tree models for various tasks. Boosted trees are an ensemble learning method that combines multiple decision trees to make predictions. They are widely used in machine learning for tasks such as classification and regression. However, in certain versions of TensorFlow, the Boosted Trees API is vulnerable to denial of service attacks and heap buffer overflow. These vulnerabilities can be exploited by attackers to cause the application to crash, read and write from heap buffers, and abuse undefined behavior. It is important to note that the Boosted Trees implementation in TensorFlow is unmaintained, and it is recommended to no longer use these APIs.

Vulnerability Detail

The vulnerability in the Boosted Trees API in TensorFlow arises from missing validation in the code. This allows attackers to trigger denial of service attacks by dereferencing null pointers or causing CHECK failures. It also enables them to abuse undefined behavior by binding references to null pointers. Additionally, depending on the API and arguments used, attackers can read and write from heap buffers. These vulnerabilities can have serious consequences, including application crashes, data corruption, and potential remote code execution. The affected versions of TensorFlow include 2.4.4, 2.5.2, 2.6.1, and 2.7.0rc0. The fix for this vulnerability will be included in TensorFlow 2.7.0, and patches will be released for the affected versions.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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.4.4 2.4.4
    pip install --upgrade "tensorflow-cpu==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow-cpu==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow-cpu==2.6.1"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow-cpu==2.7.0"

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 mentioned for this vulnerability. However, as a general best practice, it is recommended to follow secure coding practices and keep software dependencies up to date. Regularly monitoring for security updates and applying them promptly can help mitigate the risk of vulnerabilities.

Conclusion

The Boosted Trees API in TensorFlow is vulnerable to denial of service attacks and heap buffer overflow. It is recommended to upgrade to the latest version of TensorFlow (2.7.0) or apply the available patches for the affected versions (2.4.4, 2.5.2, and 2.6.1) to mitigate these vulnerabilities. Additionally, it is advised to no longer use the Boosted Trees APIs in TensorFlow, as they are unmaintained and pose a security risk. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides tools and libraries for building and deploying machine learning models.

Boosted trees are an ensemble learning method that combines multiple decision trees to make predictions. They are widely used in machine learning for tasks such as classification and regression.

The consequences of this vulnerability include denial of service attacks, heap buffer overflow, application crashes, data corruption, and potential remote code execution.

The affected versions of TensorFlow include 2.4.4, 2.5.2, 2.6.1, and 2.7.0rc0.

To fix this vulnerability, it is recommended to upgrade to the latest version of TensorFlow (2.7.0) or apply the available patches for the affected versions (2.4.4, 2.5.2, and 2.6.1). It is also advised to no longer use the Boosted Trees APIs in TensorFlow.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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.4.4 2.4.4
    pip install --upgrade "tensorflow-cpu==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow-cpu==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow-cpu==2.6.1"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow-cpu==2.7.0"

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