CVE-2022-41884: TensorFlow Segmentation Fault Due to Zero and Large Inputs
Summary
CVE-2022-41884: Seg fault in ndarray_tensor_bridge due to zero and large inputs. Affects tensorflow across 3 version ranges.
< 2.8.4
>= 2.9.0, < 2.9.3
>= 2.10.0, < 2.10.1
Fixed in 2.8.4, 2.9.3 or 2.10.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-41884 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 tasks such as deep learning, neural networks, and data analysis. TensorFlow's flexibility and scalability make it a popular choice among developers and researchers. However, like any complex software, it is susceptible to vulnerabilities that can affect its stability and security.
Vulnerability Detail
The vulnerability arises in TensorFlow's handling of numpy arrays, specifically when creating arrays with shapes that include a zero dimension alongside large dimensions. This can lead to a segmentation fault, causing the application to crash. The issue originates from the lack of checks on the return value of PyArray_SimpleNewFromData, which can return null for such shapes. This vulnerability can be exploited when using functions like tf.broadcast_to, potentially leading to application instability and crashes.
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.8.42.8.4pip install --upgrade "tensorflow==2.8.4" -
>= 2.9.0, < 2.9.32.9.3pip install --upgrade "tensorflow==2.9.3" -
>= 2.10.0, < 2.10.12.10.1pip install --upgrade "tensorflow==2.10.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, avoid creating numpy arrays with shapes that include a zero dimension alongside large dimensions. For example, instead of using: np.ones((0, 231, 231)), ensure that the shape does not contain a zero dimension.
Conclusion
CVE-2022-41884 is a significant vulnerability in TensorFlow that can lead to segmentation faults when handling specific numpy array shapes. Users are advised to update to the latest patched versions to ensure application stability and security. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-41884 is a vulnerability in TensorFlow that can cause a segmentation fault when handling numpy arrays with certain shapes.
This vulnerability can lead to application crashes, impacting the stability and reliability of TensorFlow applications.
Affected versions include TensorFlow prior to 2.8.4, 2.9.3, and 2.10.1.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.
The CVSS score for this vulnerability is 4.8, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.