CVE-2022-23592: TensorFlow Heap Out of Bounds Read
Summary
CVE-2022-23592: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 2 version ranges.
>= 2.7.0, < 2.8.0
< c99d98cd189839dcf51aee94e7437b54b31f8abd
Fixed in c99d98cd189839dcf51aee94e7437b54b31f8abd. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-cpu · PyPI
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.
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.
No signup required · Results in about 60 seconds
Background
TensorFlow is an open-source machine learning framework widely used for developing and training machine learning models. It provides a comprehensive ecosystem for building and deploying machine learning applications. TensorFlow's type inference is a critical component that determines the data types of variables and expressions during the execution of a program. However, a vulnerability in TensorFlow's type inference mechanism can lead to a heap out of bounds read. This vulnerability arises due to inadequate bounds checking, which is disabled during production. An attacker can exploit this vulnerability by manipulating the input_idx variable to exceed the number of values in node_t.args. The issue affects the tensorflow-gpu package on PyPI and will be resolved in TensorFlow version 2.8.0.
Vulnerability Detail
The vulnerability in TensorFlow's type inference can be exploited by an attacker to cause a heap out of bounds read. By controlling the input_idx variable, an attacker can manipulate the program execution to read data beyond the bounds of the allocated heap. This can lead to information disclosure or potentially allow an attacker to execute arbitrary code. The vulnerability is present in the tensorflow-gpu package on PyPI and affects all versions prior to 2.8.0. It is important to note that the bounds checking, performed by DCHECK, is disabled during production, making the vulnerability exploitable.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==c99d98cd189839dcf51aee94e7437b54b31f8abd"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a workaround, users can consider implementing additional bounds checking in their code to ensure that the input_idx variable does not exceed the number of values in node_t.args. By validating the input before passing it to TensorFlow's type inference mechanism, the risk of triggering the heap out of bounds read can be mitigated. Here's an example of how to perform the bounds checking in Python:
if input_idx < len(node_t.args):
# Perform TensorFlow type inference
else:
# Handle the case when input_idx is out of bounds
Conclusion
The vulnerability in TensorFlow's type inference can lead to a heap out of bounds read, potentially resulting in information disclosure or arbitrary code execution. It is crucial to update the tensorflow-gpu package to version 2.8.0 or later to mitigate this vulnerability. Implementing proper input validation and bounds checking in your code can provide an additional layer of protection. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow is an open-source machine learning framework that provides a comprehensive ecosystem for developing and training machine learning models. It is widely used in both research and production environments.
Type inference in TensorFlow is the process of automatically determining the data types of variables and expressions during the execution of a program. It helps ensure type safety and efficient execution of machine learning models.
The vulnerability in TensorFlow's type inference arises due to inadequate bounds checking. The DCHECK mechanism, responsible for bounds checking, is a no-op during production, allowing an attacker to manipulate the input_idx variable and trigger a heap out of bounds read.
The vulnerability can lead to information disclosure or allow an attacker to execute arbitrary code. By reading data beyond the bounds of the allocated heap, an attacker can access sensitive information or manipulate the program's execution flow.
To protect your application, it is recommended to update the tensorflow-gpu package to version 2.8.0 or later. Additionally, implementing proper input validation and bounds checking in your code can help mitigate the risk of triggering the heap out of bounds read.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.