CVE-2022-35982: TensorFlow SparseBincount Segfault Vulnerability
Summary
CVE-2022-35982: TensorFlow vulnerable to segfault in SparseBincount. 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-35982 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 is widely used for building and training machine learning models, offering a flexible architecture and a comprehensive ecosystem. The library supports various tasks, including deep learning and neural network training. However, TensorFlow has a vulnerability in the SparseBincount operation, which can lead to a segmentation fault under certain conditions, potentially allowing for denial of service attacks.
Vulnerability Detail
The vulnerability arises when the SparseBincount function is provided with invalid inputs for indices, values, and dense_shape that do not form a valid sparse tensor. This can lead to a segmentation fault (segfault), causing the application to crash. The impact of this vulnerability is significant as it can be exploited to trigger denial of service attacks, affecting the availability of applications that rely on 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
Currently, there are no specific workarounds provided for this vulnerability. It is recommended to validate inputs to SparseBincount to ensure they form a valid sparse tensor before calling the function.
Conclusion
In summary, the CVE-2022-35982 vulnerability in TensorFlow's SparseBincount function can lead to segmentation faults and potential denial of service attacks. Users are advised to update to the latest patched versions of TensorFlow to mitigate this risk. Regular monitoring and validation of inputs can also help prevent exploitation.
See every vulnerability recorded for tensorflow-cpu →
FAQ
The CVSS score of this vulnerability is 5.9, indicating a moderate severity level.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground without any signup.
The affected versions include TensorFlow 2.7.2, 2.8.0, 2.9.0, and any versions prior to 2.10.0.
If left unaddressed, this vulnerability can be exploited to cause denial of service attacks, leading to application crashes and downtime.
This vulnerability was reported by Di Jin from Secure Systems Labs at Brown University.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.