CVE-2021-29533: Denial of Service in TensorFlow-GPU
Summary
CVE-2021-29533: TensorFlow is an end-to-end open source platform for machine learning. Affects tensorflow-gpu across 5 version ranges.
>= 2.2.0, < 2.3.0rc0
< 2.2.0rc0
>= 2.3.0, < 2.3.4
>= 2.4.0, < 2.4.3
< b432a38fe0e1b4b904a6c222cbce794c39703e87
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
The same CVE-2021-29533 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-GPU is an open-source platform for machine learning that provides a comprehensive ecosystem for developing and deploying machine learning models. It is widely used in various industries and research domains for its powerful capabilities and ease of use. However, a vulnerability has been discovered in TensorFlow-GPU that can lead to a denial of service (DoS) attack.
Vulnerability Detail
The vulnerability (CVE-2021-29533) in TensorFlow-GPU arises from a flaw in the implementation of the tf.raw_ops.DrawBoundingBoxes function. An attacker can trigger a DoS attack by passing an empty image to this function, causing a CHECK failure. The implementation uses CHECK_* assertions instead of OP_REQUIRES to validate user-controlled inputs. While OP_REQUIRES allows returning an error condition to the user, CHECK_* macros result in a program crash if the condition is false. In this case, the height of the image is 0, leading to a negative value for max_box_row_clamp and a falsified assertion, resulting in the program aborting. This vulnerability can be exploited by an attacker to disrupt the availability of TensorFlow-GPU and potentially impact systems relying on it for machine learning tasks.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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.2.0rc02.2.0rc0pip install --upgrade "tensorflow-gpu==2.2.0rc0" -
>= 2.2.0, < 2.3.0rc02.3.0rc0pip install --upgrade "tensorflow-gpu==2.3.0rc0" -
>= 2.3.0, < 2.3.42.3.4pip install --upgrade "tensorflow-gpu==2.3.4" -
>= 2.4.0, < 2.4.32.4.3pip install --upgrade "tensorflow-gpu==2.4.3"
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 can validate the input images before passing them to the tf.raw_ops.DrawBoundingBoxes function. By ensuring that the height of the image is not zero, the vulnerability can be mitigated. Here is an example code snippet demonstrating the workaround:
# Validate image height
if image.shape[0] == 0:
raise ValueError('Image height cannot be zero')
# Call the DrawBoundingBoxes function
tf.raw_ops.DrawBoundingBoxes(images, ...)
Conclusion
The vulnerability (CVE-2021-29533) in TensorFlow-GPU can lead to a denial of service (DoS) attack by exploiting a flaw in the tf.raw_ops.DrawBoundingBoxes function. It is crucial for users to update their TensorFlow-GPU installations to the latest patched version once it becomes available. In the meantime, a temporary workaround is available by validating input images to mitigate the vulnerability. For further support and assistance in vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
FAQ
TensorFlow-GPU is an open-source platform for machine learning that provides a comprehensive ecosystem for developing and deploying machine learning models. It leverages the power of GPUs to accelerate the training and inference processes.
This vulnerability can be exploited by an attacker to trigger a denial of service (DoS) attack, leading to the unavailability of TensorFlow-GPU and potentially impacting systems relying on it for machine learning tasks.
The vulnerability will be fixed in TensorFlow-GPU version 2.5.0. Users are advised to update their installations to the latest patched version as soon as it becomes available. Backported fixes will also be provided for earlier supported versions.
Yes, a temporary workaround is to validate the input images before passing them to the vulnerable function. By ensuring that the image height is not zero, the vulnerability can be mitigated.
For more information about this vulnerability, you can refer to the official advisory provided by the TensorFlow-GPU project. Additionally, you can use vulnerability monitoring tools like Vulert to stay updated on the latest security vulnerabilities in your software.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.