CVE-2022-23566: TensorFlow Heap OOB Write in Grappler
Summary
CVE-2022-23566: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-gpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< 97282c6d0d34476b6ba033f961590b783fa184cd
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-cpu · PyPI
The same CVE-2022-23566 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 deploying machine learning models. It provides a comprehensive ecosystem of tools, libraries, and resources for building and training neural networks. TensorFlow is vulnerable to a heap out-of-bounds write in the Grappler component. This vulnerability allows a malicious user to perform unauthorized writes to an array at a specified index, potentially leading to arbitrary code execution or a denial of service attack. The vulnerability affects versions of TensorFlow up to 2.5.3, 2.6.3, and 2.7.1.
Vulnerability Detail
The vulnerability arises from the set_output function in Grappler, which writes to an array at the specified index. By exploiting this flaw, an attacker can gain a write primitive, enabling them to modify memory beyond the bounds of the allocated array. This can lead to various security issues, including remote code execution, privilege escalation, or crashing the application. The vulnerability has been assigned the identifier CVE-2022-23566.
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 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.5.32.5.3pip install --upgrade "tensorflow-gpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow-gpu==2.6.3"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
No workaround has been provided for this vulnerability. It is recommended to apply the official fix by updating to the patched version of TensorFlow.
Conclusion
TensorFlow is vulnerable to a heap out-of-bounds write in the Grappler component, which can lead to various security risks. Users are advised to update their TensorFlow installations to the latest patched version to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive set of tools and resources for building neural networks.
The vulnerability allows an attacker to perform unauthorized writes to memory, potentially leading to arbitrary code execution, privilege escalation, or crashing the application.
Versions up to 2.5.3, 2.6.3, and 2.7.1 are affected by this vulnerability.
Yes, the vulnerability has been fixed in TensorFlow 2.8.0. The fix has also been backported to TensorFlow 2.7.1, 2.6.3, and 2.5.3.
To update your TensorFlow installation, follow the official upgrade instructions provided by TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.