CVE-2022-23592: TensorFlow Heap Out-of-Bounds Read

tensorflow-cpu Updated 02 Oct 2025

Summary

04/02/2022
Yes i
Unrated
Not published

CVE-2022-23592: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 2 version ranges.

>= 2.7.0, < 2.8.0 < c99d98cd189839dcf51aee94e7437b54b31f8abd

Fixed in c99d98cd189839dcf51aee94e7437b54b31f8abd. How to fix ↓

Also tracked for

The same CVE-2022-23592 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 machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive ecosystem for building and training various types of neural networks. TensorFlow is written in Python and C++ and supports multiple platforms and programming languages. It is known for its flexibility, scalability, and extensive library of pre-built models and tools. However, a vulnerability has been discovered in TensorFlow that can lead to a heap out-of-bounds read.

Vulnerability Detail

The vulnerability in TensorFlow arises from its type inference mechanism, which can result in a heap out-of-bounds read. The issue occurs because the bounds checking is performed using a DCHECK macro, which is a no-op during production. An attacker can manipulate the input_idx variable to exceed the number of values in node_t.args, leading to a read beyond the bounds of the heap. This can potentially expose sensitive information or cause a crash. The vulnerability affects all versions of TensorFlow prior to 2.8.0.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

c99d98cd189839dcf51aee94e7437b54b31f8abd

This is the first release that contains the fix.

pip install --upgrade "tensorflow-cpu==c99d98cd189839dcf51aee94e7437b54b31f8abd"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can implement their own bounds checking when using TensorFlow's type inference. By validating the input_idx variable against the number of values in node_t.args, users can ensure that no out-of-bounds reads occur. Here's an example of how to implement this workaround in Python:

input_idx = ...  # user-controlled input
args_count = len(node_t.args)

if input_idx >= args_count:
    raise ValueError('Invalid input_idx')

# Continue with TensorFlow operations

Conclusion

The vulnerability in TensorFlow that allows a heap out-of-bounds read has been addressed in version 2.8.0. Users are strongly advised to update their TensorFlow installation to the latest version to mitigate the risks associated with this vulnerability. For further support on vulnerability remediation and to stay updated on open-source vulnerabilities in your software, consider using Vulert (https://vulert.com). Vulert provides real-time monitoring and alerts for open-source vulnerabilities without requiring access to the code or installation.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive ecosystem for building and training various types of neural networks.

A heap out-of-bounds read occurs when a program reads data from a memory location outside the bounds of a dynamically allocated heap buffer. This can lead to the exposure of sensitive information or a crash.

The vulnerability in TensorFlow arises from its type inference mechanism, which performs bounds checking using a DCHECK macro. However, this macro is a no-op during production, allowing an attacker to manipulate the input_idx variable and cause a heap out-of-bounds read.

The vulnerability can potentially expose sensitive information stored in the heap or cause a crash, leading to denial-of-service or other security implications. It is important to promptly update TensorFlow to the fixed version to mitigate these risks.

To fix the vulnerability, users of TensorFlow should upgrade to version 2.8.0 or later. The fix includes proper bounds checking during type inference to prevent heap out-of-bounds reads. Users can update their TensorFlow installation using the package manager or by manually downloading and installing the latest version from the official TensorFlow website.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

c99d98cd189839dcf51aee94e7437b54b31f8abd

This is the first release that contains the fix.

pip install --upgrade "tensorflow-cpu==c99d98cd189839dcf51aee94e7437b54b31f8abd"

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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