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

tensorflow Updated 02 Oct 2025

Summary

05/11/2021
Yes i
Critical
9.3

CVE-2021-41208: TensorFlow is an open source platform for machine learning. Affects tensorflow 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 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 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. TensorFlow's Boosted Trees implementation has been found to have a vulnerability that can lead to denial of service attacks and heap buffer overflows.

Vulnerability Detail

The vulnerability in TensorFlow's Boosted Trees API stems from missing validation in the code. This allows attackers to trigger denial of service by dereferencing null pointers or causing CHECK failures. It also enables them to abuse undefined behavior by binding references to null pointers. Additionally, attackers can read from and write to heap buffers, depending on the API and arguments used. This vulnerability affects versions of TensorFlow prior to 2.7.0, including 2.6.1, 2.5.2, and 2.4.4. The TensorFlow team recommends discontinuing the use of these APIs and plans to deprecate them in future releases.

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.4.4 2.4.4
    pip install --upgrade "tensorflow==2.4.4"
  • >= 2.5.0, < 2.5.2 2.5.2
    pip install --upgrade "tensorflow==2.5.2"
  • >= 2.6.0, < 2.6.1 2.6.1
    pip install --upgrade "tensorflow==2.6.1"
  • >= 2.7.0rc0, < 2.7.0 2.7.0
    pip install --upgrade "tensorflow==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. The recommended approach is to update TensorFlow to the fixed versions as mentioned in the 'how_to_fix' section.

Conclusion

The Boosted Trees API in TensorFlow has a vulnerability that can lead to denial of service attacks and heap buffer overflows. It is crucial to update TensorFlow to the fixed versions and review any code using the affected APIs. 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 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 commonly used in machine learning tasks.

This vulnerability in TensorFlow's Boosted Trees API can lead to denial of service attacks and heap buffer overflows. Attackers can trigger crashes, abuse undefined behavior, and potentially read from and write to heap buffers.

Versions of TensorFlow prior to 2.7.0 are affected, including 2.6.1, 2.5.2, and 2.4.4.

To mitigate this vulnerability, it is recommended to update TensorFlow to version 2.7.0 or one of the fixed versions (2.6.1, 2.5.2, or 2.4.4). Additionally, review and update any code that relies on the affected Boosted Trees APIs.

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