CVE-2022-23566: TensorFlow Heap OOB Write Vulnerability
Summary
CVE-2022-23566: Out of bounds write in Tensorflow. Affects tensorflow across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
>= 2.7.0, < 2.7.1
Fixed in 2.5.3, 2.6.3 or 2.7.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-gpu · 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 library developed by Google, widely used for building and training machine learning models. It provides a flexible ecosystem of tools, libraries, and community resources that enables researchers and developers to create and deploy machine learning applications. However, TensorFlow has a vulnerability that allows for an out-of-bounds write, which can lead to severe security risks.
Vulnerability Detail
TensorFlow is vulnerable to a heap out-of-bounds (OOB) write in the Grappler component. The vulnerability arises from the 'SetUnknownShape' function, which allows a malicious user to exploit the 'set_output' function to write to an array at an arbitrary index. This can lead to potential data corruption, unauthorized access, or even remote code execution, depending on how the library is used in applications.
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.5.32.5.3pip install --upgrade "tensorflow==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow==2.6.3" -
>= 2.7.0, < 2.7.12.7.1pip install --upgrade "tensorflow==2.7.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 are no specific workarounds mentioned for this vulnerability. The best course of action is to update to the patched version of TensorFlow as soon as possible.
Conclusion
The CVE-2022-23566 vulnerability in TensorFlow poses significant security risks due to the potential for heap out-of-bounds writes. Users are strongly advised to update to the latest patched versions to mitigate these risks. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-23566 is a vulnerability in TensorFlow that allows for a heap out-of-bounds write, potentially leading to data corruption or unauthorized access.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Versions of TensorFlow prior to 2.5.3, 2.6.3, and 2.7.1 are affected by this vulnerability.
The CVSS score of this vulnerability is 8.8, indicating a high severity level.
You can update TensorFlow by running the command 'pip install --upgrade tensorflow' in your terminal.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.