CVE-2022-36002: TensorFlow Unbatch CHECK Fail Vulnerability
Summary
CVE-2022-36002: TensorFlow vulnerable to CHECK fail in Unbatch. Affects tensorflow across 3 version ranges.
< 2.7.2
>= 2.8.0, < 2.8.1
>= 2.9.0, < 2.9.1
Fixed in 2.7.2, 2.8.1 or 2.9.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
The same CVE-2022-36002 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 developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. The vulnerability identified as CVE-2022-36002 affects TensorFlow versions 0 to 2.7.2, 2.8.0 to 2.8.1, and 2.9.0 to 2.9.1, as well as their CPU and GPU variants.
Vulnerability Detail
The vulnerability in TensorFlow lies in the Unbatch function, which fails a CHECK when receiving a nonscalar input id. This flaw can be exploited to trigger a denial of service attack. An attacker can provide a malicious input that causes the CHECK to fail, leading to the termination of the program or service. This vulnerability has a CVSS score of 5.9, indicating a moderate severity level.
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.7.22.7.2pip install --upgrade "tensorflow==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip install --upgrade "tensorflow==2.9.1"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a workaround, users can avoid using the Unbatch function with nonscalar input id until the TensorFlow installation is updated to a patched version. This can be achieved by validating and filtering the input data to ensure it is scalar before passing it to the Unbatch function. Here is an example of how to perform this validation in Python:
import tensorflow as tf
def validate_input_id(id):
if tf.rank(id) > 0:
raise ValueError('Input id must be scalar')
# Usage
id = ... # Input id
validate_input_id(id)
# Call Unbatch function
... # Unbatch call
Conclusion
The vulnerability in TensorFlow's Unbatch function can lead to a denial of service attack. Users are advised to update their TensorFlow installation to one of the patched versions (2.7.2, 2.8.1, or 2.9.1) to mitigate this vulnerability. Alternatively, users can implement the provided workaround to validate and filter the input data. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models.
The vulnerability in TensorFlow can be exploited to trigger a denial of service attack. An attacker can provide a malicious input that causes the Unbatch function to fail, leading to the termination of the program or service.
The vulnerability affects TensorFlow versions 0 to 2.7.2, 2.8.0 to 2.8.1, and 2.9.0 to 2.9.1, as well as their CPU and GPU variants.
To fix the vulnerability, users should update their TensorFlow installation to one of the patched versions: TensorFlow 2.7.2, TensorFlow 2.8.1, or TensorFlow 2.9.1.
Yes, users can avoid using the Unbatch function with nonscalar input id until the TensorFlow installation is updated. It is recommended to validate and filter the input data to ensure it is scalar before passing it to the Unbatch function.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.