TensorFlow boosted trees can crash or allow heap memory read/write

CriticalSE Fix-First Score 51/100CVE-2021-41208SE-AIV-00275Denial of service and resource exhaustionModel serving and inferenceMade public 11 Nov 2021

Download as PDF

What this means

An attacker can crash a service that uses TensorFlow's boosted trees features, causing downtime. In some cases, they might read or write data in memory, risking exposure of model data or other sensitive information stored nearby in memory.

SecurityElites Manager Brief: the decision in one minute

TensorFlow's boosted trees feature has a critical flaw that lets attackers crash services or access heap memory. You need to upgrade to a patched version immediately, or stop using boosted trees APIs while you plan the upgrade.

SecurityElites Fix-First Score51 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 7 days
Critical severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixML platform or infrastructure team
Likely effortAbout 30 minutes to an hour per service: check which version is installed, upgrade to the fixed version, and restart. Longer if you have many services or if you need to test the upgrade in a staging environment first.

Questions to ask your team or supplier

  • Which of our services or pipelines currently use TensorFlow's boosted trees APIs, and can we get a complete list?
  • Have we set up monitoring or alerts for crashes in TensorFlow code, and can we review logs from the past 90 days for signs of exploitation?
  • What is our plan to migrate from TensorFlow boosted trees to TensorFlow Decision Forests, and what is the timeline?

Message you can forward to the owning team

Security notice: TensorFlow boosted trees can crash or allow heap memory read/write (CVE-2021-41208)

Severity: Critical
SecurityElites Fix-First Score: 51 of 100
SecurityElites fix window: Within 7 days
Action: upgrade to tensorflow 2.6.1, tensorflow-cpu 2.6.1, tensorflow-gpu 2.6.1 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2021-41208-tensorflow-boosted-trees-can-crash-or-allow-heap-memory/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-00275

What is at stake in your AI setup

  • Boosted tree model files could be read or corrupted via heap memory access.
  • Training data or feature vectors in memory during boosted trees operations could be exposed or modified.
  • Internal model parameters or intermediate computation results in heap memory could be leaked.

Map where your company uses AI

Who is exposed

  • Any service running TensorFlow version 2.6.0 to 2.6.0, 2.5.0 to 2.5.1, or any version before 2.4.4.
  • Teams using the boosted trees APIs (most at risk).
  • Internal ML pipelines that accept external model data or parameters.

Upgrades you need

SoftwareAffected versionsMove to
tensorflow
PyPI
2.6.0 up to, but not including, 2.6.1; 2.5.0 up to, but not including, 2.5.2; Every version before 2.4.42.6.1 or later
tensorflow-cpu
PyPI
2.6.0 up to, but not including, 2.6.1; 2.5.0 up to, but not including, 2.5.2; Every version before 2.4.42.6.1 or later
tensorflow-gpu
PyPI
2.6.0 up to, but not including, 2.6.1; 2.5.0 up to, but not including, 2.5.2; Every version before 2.4.42.6.1 or later

Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: tensorflow 2.4.4, 2.5.2, 2.6.1; tensorflow-cpu 2.4.4, 2.5.2, 2.6.1; tensorflow-gpu 2.4.4, 2.5.2, 2.6.1.

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Where the attacker must beAlready on the machine, or able to get a user to open something on it
Account neededNone. No login is needed
Does a person have to do somethingNo. It works without anyone clicking or opening anything
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedHigh
Risk of: the service being taken downHigh

Read from the official severity rating: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Kind of coding mistake

  • CWE-476: a missing value crashes the program
  • CWE-824

Where it sits in the standards

OWASP Top 10 for LLM Applications 2025: LLM10 Unbounded Consumption

If you cannot upgrade today

  • If you cannot upgrade immediately, disable or stop all services that use boosted trees APIs until the upgrade is complete.
  • Restrict network access to services using boosted trees to only trusted internal sources.

Signs it may already have been used against you

  • Search logs for crashes or errors in TensorFlow boosted trees code (look for 'boosted_trees' in the filename and 'nullptr', 'CHECK-fail', or 'SIGSEGV' in the error message).
  • Look for unexpected service restarts or high latency spikes around the time of a potential attack.
  • Check if any external or untrusted inputs were sent to boosted trees APIs before the upgrade date.

SecurityElites Fix Guide: step by step

  1. Find TensorFlow installsList all services and environments where tensorflow, tensorflow-cpu, or tensorflow-gpu is installed. Check requirements.txt, setup.py, Pipfile, pyproject.toml, or your package manager's records. Note the exact version of each.
  2. Check if boosted trees are in useSearch your codebase for imports from tensorflow.estimator.experimental.boosted_trees or calls to boosted tree functions. If you find any, those services are at risk. If you find none, the risk is lower but the upgrade is still necessary.
  3. Back up or snapshot your environmentTake a full snapshot of your production or staging environment before making changes. This lets you roll back if the upgrade causes problems.
  4. Upgrade TensorFlow to a fixed versionUpgrade to tensorflow version 2.6.1, 2.5.2, or 2.4.4 (or newer). Use the same package variant (tensorflow, tensorflow-cpu, or tensorflow-gpu) as before. If you are on 2.6.x, upgrade to 2.6.1. If you are on 2.5.x, upgrade to 2.5.2. If you are on 2.4.x or earlier, upgrade to 2.4.4. Use your package manager (pip, conda, etc.) to perform the upgrade.
  5. Restart affected servicesRestart all services that use TensorFlow to ensure they load the new version. Verify in your logs or monitoring that all services started cleanly without errors.
  6. Confirm the fixed version is runningCheck that the running version is now 2.6.1, 2.5.2, 2.4.4, or newer. Use pip show, your Python REPL, or your service's version endpoint. If the version is still the old one, the restart did not work—check for caches or multiple installations.
  7. Review logs for signs of past attacksSearch your logs for crashes or errors in boosted trees code (look for file names or function names containing 'boosted_trees' and errors like 'nullptr', 'CHECK failed', or 'segmentation fault'). If you find any recent ones from before this date, escalate to your security team for investigation.
  8. Plan to migrate away from boosted treesOpen a ticket to review whether you can stop using TensorFlow's boosted trees APIs and switch to TensorFlow Decision Forests instead (the official successor project). Document the APIs you currently use and the timeline to migrate. This reduces future risk since the boosted trees code in TensorFlow is no longer maintained.

How to confirm it is fixed: Confirm that all services running TensorFlow are now at version 2.6.1, 2.5.2, 2.4.4, or newer by running `pip show tensorflow` or equivalent in your environment.

SecurityElites Quick Fixes: copy and paste

Upgrade tensorflow with pipupgrade

pip install --upgrade "tensorflow>=2.6.1"
pip show tensorflow | grep Version

Pin it in requirements.txtupgrade

tensorflow>=2.6.1

Upgrade tensorflow-cpu with pipupgrade

pip install --upgrade "tensorflow-cpu>=2.6.1"
pip show tensorflow-cpu | grep Version

Pin it in requirements.txtupgrade

tensorflow-cpu>=2.6.1

Upgrade tensorflow-gpu with pipupgrade

pip install --upgrade "tensorflow-gpu>=2.6.1"
pip show tensorflow-gpu | grep Version

Pin it in requirements.txtupgrade

tensorflow-gpu>=2.6.1

Check installed TensorFlow version (Python)for this issue

import tensorflow as tf
print(tf.__version__)

Search codebase for boosted trees imports (bash)for this issue

grep -r "from tensorflow.estimator.experimental.boosted_trees" .
grep -r "boosted_trees" . | grep -i import

Rate and size limits with nginxgeneral hardening

limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;

server {
    location /api/ {
        limit_req zone=api burst=20 nodelay;
        client_max_body_size 2m;
    }
}

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2021-41208) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - tensorflow (PyPI): must be 2.6.1 or later
   - tensorflow-cpu (PyPI): must be 2.6.1 or later
   - tensorflow-gpu (PyPI): must be 2.6.1 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What versions of TensorFlow are affected by this flaw?A good answer: Any version of tensorflow, tensorflow-cpu, or tensorflow-gpu before 2.4.4, any 2.5.x version before 2.5.2, and any 2.6.x version before 2.6.1 are affected.
What is the main risk if we keep running an affected version?A good answer: An attacker could crash our service (denial of service) or read and write data from heap memory, potentially exposing or corrupting models and training data.
What is the recommended fix for this flaw?A good answer: Upgrade to TensorFlow 2.6.1, 2.5.2, 2.4.4, or any newer version, then restart all affected services.
What should we do if we cannot upgrade quickly?A good answer: Stop using boosted trees APIs or restrict access to the services that use them to only trusted internal networks until the upgrade is complete.

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## TensorFlow boosted trees can crash or allow heap memory read/write (CVE-2021-41208)

**Severity:** Critical  |  **SE Fix-First Score:** 51/100  |  **Fix window:** Within 7 days
**Record:** SE-AIV-00275 https://securityelites.com/ai-vulnerabilities/cve-2021-41208-tensorflow-boosted-trees-can-crash-or-allow-heap-memory/

### Why this matters
An attacker can crash a service that uses TensorFlow's boosted trees features, causing downtime. In some cases, they might read or write data in memory, risking exposure of model data or other sensitive information stored nearby in memory.

### What to do
1. Find TensorFlow installs
2. Check if boosted trees are in use
3. Back up or snapshot your environment
4. Upgrade TensorFlow to a fixed version
5. Restart affected services
6. Confirm the fixed version is running
7. Review logs for signs of past attacks
8. Plan to migrate away from boosted trees

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2021-41208-tensorflow-boosted-trees-can-crash-or-allow-heap-memory/

### Done when
- [ ] tensorflow is at 2.6.1 or later everywhere it is installed
- [ ] tensorflow-cpu is at 2.6.1 or later everywhere it is installed
- [ ] tensorflow-gpu is at 2.6.1 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm that all services running TensorFlow are now at version 2.6.1, 2.5.2, 2.4.4, or newer by running `pip show tensorflow` or equivalent in your environment.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 10 Nov 2021: Made public
  • 2 Dec 2026: Published

Official record

### Impact The [code for boosted trees in TensorFlow](https://github.com/tensorflow/tensorflow/blob/e0b6e58c328059829c3eb968136f17aa72b6c876/tensorflow/core/kernels/boosted_trees/stats_ops.cc) is still missing validation. As a result, attackers can trigger denial of service (via dereferencing `nullptr`s or via `CHECK`-failures) as well as abuse undefined behavior (binding references to `nullptr`s). An attacker can also read and write from heap buffers, depending on the API that gets used and the arguments that are passed to the call.**Note**: Given that the boosted trees implementation in TensorFlow is unmaintained, it is recommend to no longer use these APIs. Instead, please use the downstream [TensorFlow Decision Forests](https://github.com/tensorflow/decision-forests) project which is newer and supports more features. We will deprecate TensorFlow's boosted trees APIs in subsequent releases.### Patches We have patched the issue in GitHub commit [5c8c9a8bfe750f9743d0c859bae112060b216f5c](https://github.com/tensorflow/tensorflow/commit/5c8c9a8bfe750f9743d0c859bae112060b216f5c).The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.### For more information Please consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.### Attribution This vulnerability has been reported by members of the Aivul Team from Qihoo 360.

Weakness type: CWE-476, CWE-824

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2021-41208

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.