CVE-2022-29203: TensorFlow Integer Overflow in SpaceToBatchND
Summary
CVE-2022-29203: Integer overflow in SpaceToBatchND. Affects tensorflow across 3 version ranges.
< 2.6.4
>= 2.7.0, < 2.7.2
>= 2.8.0, < 2.8.1
Fixed in 2.6.4, 2.7.2 or 2.8.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-29203 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, widely used for building and training machine learning models. It provides a flexible ecosystem of tools, libraries, and community resources that allows researchers and developers to create and deploy machine learning applications. The library includes various operations for tensor manipulation, including the SpaceToBatchND operation, which is designed to rearrange the data in a tensor for batch processing. However, a vulnerability has been identified in this operation that can lead to serious issues.
Vulnerability Detail
The vulnerability arises from an integer overflow in the implementation of the tf.raw_ops.SpaceToBatchND operation. This issue can be exploited when negative values are passed as parameters, leading to an overflow during the allocation of the output tensor. The result is a denial of service due to a CHECK-failure (assertion failure), which can disrupt the normal functioning of applications using TensorFlow. This vulnerability affects all backends, including XLA and handwritten kernels, making it a critical issue for users relying on TensorFlow for their machine learning 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.6.42.6.4pip install --upgrade "tensorflow==2.6.4" -
>= 2.7.0, < 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"
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, avoid using negative values for the block_shape parameter in the SpaceToBatchND operation. For example, ensure that the block_shape is defined as follows: block_shape = tf.constant([2, 2], shape=[2], dtype=tf.int64)
Conclusion
In summary, CVE-2022-29203 is a significant vulnerability in TensorFlow's SpaceToBatchND operation that can lead to denial of service due to integer overflow. Users are strongly advised to update their TensorFlow installations to the latest patched versions to mitigate this risk. Additionally, temporary workarounds can help reduce exposure until an update can be applied.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-29203 is a vulnerability in TensorFlow's SpaceToBatchND operation that can lead to an integer overflow and denial of service.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
The vulnerability affects TensorFlow versions prior to 2.6.4, 2.7.2, 2.8.1, and 2.9.0, which contain the necessary patches.
If you cannot update TensorFlow immediately, ensure that you do not use negative values for the block_shape parameter in the SpaceToBatchND operation as a temporary workaround.
The CVSS score of this vulnerability is 5.5, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.