CVE-2022-35982: PYSEC-2026-947 - TensorFlow vulnerable to segfault in `SparseBincount`

CVE-2022-35982 · Severity: low · CVSS 3.1 · Published 2026-07-07

TensorFlow is a machine learning library used to build and deploy AI models. The SparseBincount operation can crash (segfault) when given malformed input data, causing the application to crash and denying service to users and processes relying on that TensorFlow instance.

Technologies: Google TensorFlow, tensorflow (PyPI), tensorflow-cpu (PyPI), tensorflow-gpu (PyPI). Vendors: Google, PyPI.

Quick answers

Is CVE-2022-35982 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-35982 being exploited in the wild.
How severe is CVE-2022-35982?
Low severity, with a CVSS score of 3.1, published 7 July 2026.
Which products and versions are affected?
Google TensorFlow 0.x through 2.7.1; 2.8.0; 2.9.0; tensorflow (PyPI) ECOSYSTEM:introduced=0,fixed=2.7.2,introduced=2.8.0,fixed=2.8.1,introduced=2.9.0,fixed=2.9.1; tensorflow-cpu (PyPI) ECOSYSTEM:introduced=0,fixed=2.7.2,introduced=2.8.0,fixed=2.8.1,introduced=2.9.0,fixed=2.9.1; tensorflow-gpu (PyPI) ECOSYSTEM:introduced=0,fixed=2.7.2,introduced=2.8.0,fixed=2.8.1,introduced=2.9.0,fixed=2.9.1.
Is there a fix for CVE-2022-35982?
Yes. tensorflow (PyPI): upgrade to 2.9.1 or later; tensorflow-cpu (PyPI): upgrade to 2.9.1 or later; tensorflow-gpu (PyPI): upgrade to 2.9.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-35982 attacked?
It is attacked over the network.
Am I affected by CVE-2022-35982?
Check whether you run Google TensorFlow, tensorflow (PyPI), tensorflow-cpu (PyPI) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • tensorflow (PyPI): upgrade to 2.9.1 or later
    pip install "tensorflow>=2.9.1"
  • tensorflow-cpu (PyPI): upgrade to 2.9.1 or later
    pip install "tensorflow-cpu>=2.9.1"
  • tensorflow-gpu (PyPI): upgrade to 2.9.1 or later
    pip install "tensorflow-gpu>=2.9.1"

Technical details

The vulnerability is a segmentation fault (CWE-20: Improper Input Validation) in TensorFlow's SparseBincount operation. When SparseBincount receives indices, values, and dense_shape parameters that do not form a valid sparse tensor, it fails to validate the input properly and attempts to dereference invalid memory, resulting in a process crash. The attack vector is local/network depending on deployment (requires ability to call SparseBincount with crafted inputs); no authentication is required. An attacker can achieve denial of service by crashing the TensorFlow process. The vulnerability has been patched in TensorFlow 2.7.2, 2.8.1, 2.9.1, and 2.10.0.

Affected products

  • Google TensorFlow 0.x through 2.7.1; 2.8.0; 2.9.0
  • Google TensorFlow CPU 1.15.0 through 2.7.1; 2.8.0; 2.9.0
  • Google TensorFlow GPU 0.x through 2.7.1; 2.8.0; 2.9.0

Identifiers

  • CVE-2022-35982
  • GHSA-397c-5g2j-qxpv
  • PYSEC-2026-3093
  • PYSEC-2026-3270
  • PYSEC-2026-947

Timeline

  • 2022-09-16: disclosed
  • 2022-09-16: patched: Patched in TensorFlow 2.7.2, 2.8.1, 2.9.1, and 2.10.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.