CVE-2022-21739: TensorFlow Null Pointer Dereference Vulnerability
Summary
CVE-2022-21739: Null pointer dereference 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-21739 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. It is widely used for building and training machine learning models, offering flexibility and scalability. TensorFlow supports various tasks, including deep learning, neural networks, and data flow programming. However, it has a vulnerability related to the QuantizedMaxPool operation, which can lead to undefined behavior due to null pointer dereferencing.
Vulnerability Detail
The vulnerability arises from the implementation of the QuantizedMaxPool operation in TensorFlow, where user-controlled inputs can inadvertently bind to a null pointer, leading to a potential crash or undefined behavior. This issue can be exploited by providing specific inputs that trigger the null pointer dereference, impacting the stability and reliability of applications using TensorFlow.
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
Currently, there are no specific workarounds provided for this vulnerability. It is recommended to update to the patched version as soon as possible.
Conclusion
The CVE-2022-21739 vulnerability in TensorFlow poses a significant risk due to the potential for null pointer dereferencing. Users are strongly advised to update their TensorFlow installations to the latest patched versions to mitigate this risk and ensure the stability of their applications.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-21739 is a vulnerability in TensorFlow that allows for a null pointer dereference due to improper handling of user inputs in the QuantizedMaxPool operation.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application against this vulnerability using the Vulert playground at Vulert Scanner without any signup.
The affected versions include TensorFlow 2.5.3, 2.6.0, 2.7.0, and earlier versions. The vulnerability has been patched in versions 2.5.3, 2.6.3, and 2.7.1.
Exploiting this vulnerability can lead to application crashes or undefined behavior, which may compromise the stability of systems relying on TensorFlow.
You can update TensorFlow to a secure version by running the command: pip install --upgrade tensorflow in your terminal.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.