CVE-2022-35971: TensorFlow CHECK Fail in FakeQuantWithMinMaxVars Leading to Denial of Service
Summary
CVE-2022-35971: TensorFlow vulnerable to CHECK fail in FakeQuantWithMinMaxVars. 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-35971 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 provides a comprehensive ecosystem for building and deploying machine learning models. TensorFlow supports various tasks, including deep learning and neural network training, and is widely used in both research and production environments. However, it has been found to have a vulnerability in the FakeQuantWithMinMaxVars operation, which can lead to a denial of service if improperly used.
Vulnerability Detail
The vulnerability arises when the FakeQuantWithMinMaxVars operation is provided with min or max tensors that have a nonzero rank. This situation triggers a CHECK fail, which can be exploited to cause a denial of service. An attacker can craft inputs that lead to this failure, effectively crashing the application or service utilizing TensorFlow. This vulnerability is particularly concerning for applications that rely on TensorFlow for real-time processing or critical tasks.
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, ensure that the min and max tensors provided to the FakeQuantWithMinMaxVars operation have zero rank. Here is an example of how to correctly use the operation:
import tensorflow as tf
num_bits = 8
narrow_range = False
inputs = tf.constant(0, shape=[], dtype=tf.float32) # Zero rank tensor
min = tf.constant(0, shape=[], dtype=tf.float32) # Zero rank tensor
max = tf.constant(0, shape=[], dtype=tf.float32) # Zero rank tensor
tf.raw_ops.FakeQuantWithMinMaxVars(inputs=inputs, min=min, max=max, num_bits=num_bits, narrow_range=narrow_range)
Conclusion
In summary, CVE-2022-35971 is a significant vulnerability in TensorFlow that can lead to denial of service if the FakeQuantWithMinMaxVars operation is misused. It is crucial to update to the latest patched versions to mitigate this risk and ensure the stability of applications using TensorFlow.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-35971 is a vulnerability in TensorFlow that can lead to a denial of service due to a CHECK fail in the FakeQuantWithMinMaxVars operation when provided with improperly shaped tensors.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors open-source vulnerabilities in real-time.
TensorFlow versions prior to 2.10.0, including 2.9.0, 2.8.0, and 2.7.2, are affected by this vulnerability.
You can update TensorFlow to the patched version by running the command: pip install --upgrade tensorflow.
The primary impact of this vulnerability is a denial of service, which can crash applications relying on TensorFlow for processing, leading to downtime and potential data loss.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.