TensorFlow boosted trees can crash or allow heap memory read/write
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 Score | 51 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 7 days Critical severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | ML platform or infrastructure team |
| Likely effort | About 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-00275What 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.
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
| Software | Affected versions | Move 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.4 | 2.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.4 | 2.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.4 | 2.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 be | Already on the machine, or able to get a user to open something on it |
|---|---|
| Account needed | None. No login is needed |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | High |
| Risk of: the service being taken down | High |
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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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 VersionPin it in requirements.txtupgrade
tensorflow>=2.6.1Upgrade tensorflow-cpu with pipupgrade
pip install --upgrade "tensorflow-cpu>=2.6.1"
pip show tensorflow-cpu | grep VersionPin it in requirements.txtupgrade
tensorflow-cpu>=2.6.1Upgrade tensorflow-gpu with pipupgrade
pip install --upgrade "tensorflow-gpu>=2.6.1"
pip show tensorflow-gpu | grep VersionPin it in requirements.txtupgrade
tensorflow-gpu>=2.6.1Check 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 importRate 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.
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.
Related vulnerabilities
In the same software
- TensorFlow can crash or run attacker code when given out-of-bounds axis Critical · CVE-2023-25668
- TensorFlow boosted trees can crash or allow memory access outside bounds Critical · GHSA-h6gw-r52c-724r
- TensorFlow segment sum can write outside heap memory bounds Critical · CVE-2020-15212
- TensorFlow segment sum can crash or corrupt memory if segment IDs are unsorted Critical · CVE-2020-15214
- TensorFlow can read memory outside its bounds from a malicious checkpoint file Critical · CVE-2018-7575
The same kind of mistake in other AI tools
- NLTK XML parser can be made to freeze by reading a crafted corpus file High · CVE-2026-128139
- NLTK WordNet tree methods can run out of memory with deep relation chains High · CVE-2026-129223
- NLTK CCG lexicon parser can be made to freeze with large input High · CVE-2026-126299
- NLTK tree normalizer hangs on wide trees High · CVE-2026-126298
- NLTK can be made to use excessive CPU when reading malformed CoNLL files High · CVE-2026-126297
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-41208For 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.