CVE-2022-35982: TensorFlow SparseBincount Segfault Vulnerability

tensorflow-cpu Updated 18 Jul 2026

Summary

13/07/2026
Yes i
Medium
5.9

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

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.2 2.7.2
    pip install --upgrade "tensorflow-cpu==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow-cpu==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

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.2 2.7.2
    pip install --upgrade "tensorflow-cpu==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow-cpu==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback