CVE-2022-29207: TensorFlow - Undefined behavior when users supply invalid resource handles

tensorflow Updated 02 Oct 2025

Summary

24/05/2022
Yes i
Moderate
5.5

CVE-2022-29207: Undefined behavior when users supply invalid resource handles. Affects tensorflow across 3 version ranges.

< 2.6.4 >= 2.7.0, < 2.7.2 >= 2.8.0, < 2.8.1

Fixed in 2.6.4, 2.7.2 or 2.8.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-29207 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

TensorFlow is an open-source machine learning framework that provides a comprehensive ecosystem of tools, libraries, and resources for developing and deploying machine learning models. It is widely used in various domains, including research, industry, and academia. TensorFlow allows users to build and execute computational graphs, enabling efficient training and inference of machine learning models. However, a vulnerability has been identified in TensorFlow that can lead to undefined behavior when users supply invalid resource handles.

Vulnerability Detail

The vulnerability in TensorFlow arises when certain operations are performed in eager mode with an invalid resource handle. In graph mode, these API calls would not be possible, but the migration to TensorFlow 2.x eager mode has exposed this vulnerability. If an empty resource handle is provided, a reference is bound to a null pointer within the TensorFlow codebase, resulting in undefined behavior. This vulnerability can have various ramifications depending on the specific operations being performed, potentially leading to crashes, memory corruption, or other unexpected behavior.

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.6.4 2.6.4
    pip install --upgrade "tensorflow==2.6.4"
  • >= 2.7.0, < 2.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"

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. Users are advised to update their TensorFlow installation to the fixed versions mentioned above.

Conclusion

The vulnerability in TensorFlow that allows undefined behavior when users supply invalid resource handles has been addressed by the TensorFlow development team. Users are advised to update their TensorFlow installation to the fixed versions mentioned above. 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 machine learning framework that provides tools and resources for developing and deploying machine learning models.

The vulnerability can lead to undefined behavior in TensorFlow operations, potentially resulting in crashes, memory corruption, or other unexpected behavior.

To fix this vulnerability, update your TensorFlow installation to one of the fixed versions: TensorFlow 2.9.0, TensorFlow 2.8.1, TensorFlow 2.7.2, or TensorFlow 2.6.4.

No specific workaround has been provided for this vulnerability. Updating to the fixed versions is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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.6.4 2.6.4
    pip install --upgrade "tensorflow==2.6.4"
  • >= 2.7.0, < 2.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"

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