CVE-2022-35991: TensorFlow CHECK Fail in TensorListScatter and TensorListScatterV2 Leading to Denial of Service
Summary
CVE-2022-35991: TensorFlow vulnerable to CHECK fail in TensorListScatter and TensorListScatterV2. Affects tensorflow-cpu 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 · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
The same CVE-2022-35991 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 that provides a comprehensive ecosystem for building and deploying machine learning models. It is widely used for various applications, including deep learning and neural networks. TensorFlow's core functionality includes support for tensor operations, automatic differentiation, and model training. However, certain operations, such as TensorListScatter and TensorListScatterV2, can lead to vulnerabilities if not properly handled, particularly when dealing with unexpected input shapes.
Vulnerability Detail
The vulnerability arises in the TensorListScatter and TensorListScatterV2 operations when they receive an element_shape with a rank greater than one. This condition triggers a CHECK fail, which can lead to a denial of service (DoS) attack. An attacker can exploit this vulnerability by crafting inputs that cause the TensorFlow framework to fail, potentially disrupting services that rely on TensorFlow for processing. The issue is particularly concerning as it can be triggered with minimal effort, making it a significant risk for applications using affected versions of TensorFlow.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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-cpu==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow-cpu==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip install --upgrade "tensorflow-cpu==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 temporary workaround, users should avoid using TensorListScatter and TensorListScatterV2 with element_shape parameters that have a rank greater than one until they can update to a patched version. Here is an example of how to avoid triggering the vulnerability:
Example of safe usage
import tensorflow as tf arg_0 = tf.random.uniform(shape=(2, 2), dtype=tf.float16, maxval=None) arg_1 = tf.random.uniform(shape=(2, 2), dtype=tf.int32, maxval=65536) arg_2 = tf.constant([]) # Use a scalar or 1D tensor for element_shape arg_3 = '' tf.raw_ops.TensorListScatter(tensor=arg_0, indices=arg_1, element_shape=arg_2, name=arg_3)
Conclusion
CVE-2022-35991 is a significant vulnerability in TensorFlow that can lead to denial of service attacks. Users are strongly advised to update to the latest patched versions of TensorFlow to mitigate this risk. Additionally, temporary workarounds should be employed until the update can be performed.
See every vulnerability recorded for tensorflow-cpu →
FAQ
CVE-2022-35991 is a vulnerability in TensorFlow that can lead to a denial of service due to a CHECK fail in the TensorListScatter and TensorListScatterV2 operations.
The affected versions include TensorFlow 2.7.0 to 2.9.0. The vulnerability has been patched in versions 2.10.0, 2.9.1, 2.8.1, and 2.7.2.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. You can check your application's status without signing up at Vulert Scanner.
As a temporary measure, avoid using TensorListScatter and TensorListScatterV2 with element_shape parameters that have a rank greater than one.
The CVSS score for CVE-2022-35991 is 5.9, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.