# CVE-2022-35968: PYSEC-2026-940 - TensorFlow vulnerable to `CHECK` fail in `AvgPoolGrad`

Source: https://junglewise.ai/threats/cve-2022-35968-tensorflow-check-failure-in-avgpoolgrad  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-07. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

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

TensorFlow's average pooling gradient operation (AvgPoolGrad) fails to properly validate input tensor dimensions, allowing an attacker to trigger a denial-of-service crash by supplying invalid input shapes. This can disrupt machine learning applications that rely on TensorFlow for training or inference.

Technologies: [Google TensorFlow](https://junglewise.ai/threats/technologies/tensorflow), [tensorflow (PyPI)](https://junglewise.ai/threats/technologies/pypi-tensorflow), [tensorflow-cpu (PyPI)](https://junglewise.ai/threats/technologies/tensorflow-cpu), [tensorflow-gpu (PyPI)](https://junglewise.ai/threats/technologies/tensorflow-gpu). Vendors: [Google](https://junglewise.ai/threats/vendors/google), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2022-35968 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2022-35968 being exploited in the wild.

**How severe is CVE-2022-35968?** Low severity, with a CVSS score of 3.1, published 7 July 2026.

**Which products and versions are affected?** Google TensorFlow all versions before 2.7.2; 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-35968?** 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-35968 attacked?** It is attacked over the network.

**Am I affected by CVE-2022-35968?** 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

  ```sh
  pip install "tensorflow>=2.9.1"
  ```

- tensorflow-cpu (PyPI): upgrade to 2.9.1 or later

  ```sh
  pip install "tensorflow-cpu>=2.9.1"
  ```

- tensorflow-gpu (PyPI): upgrade to 2.9.1 or later

  ```sh
  pip install "tensorflow-gpu>=2.9.1"
  ```


## Technical details

The vulnerability is a missing input validation bug (CWE-617) in the AvgPoolGrad operation of TensorFlow. The operation does not fully validate the orig_input_shape parameter before using it, causing an unhandled CHECK failure (assertion failure) that terminates the process. An attacker can trigger this by calling tf.raw_ops.AvgPoolGrad with a maliciously crafted orig_input_shape tensor containing invalid values (e.g., negative dimensions). The attack requires network access only if the TensorFlow model is exposed via a service; no authentication or user interaction is needed. The impact is denial of service through application crash. Patches have been released in TensorFlow 2.7.2, 2.8.1, 2.9.1, and 2.10.0.

## Affected products

- Google TensorFlow all versions before 2.7.2; 2.8.0; 2.9.0
- Google TensorFlow CPU all versions before 2.7.2; 2.8.0; 2.9.0
- Google TensorFlow GPU all versions before 2.7.2; 2.8.0; 2.9.0

## Identifiers

- CVE-2022-35968
- GHSA-2475-53vw-vp25
- PYSEC-2026-3083
- PYSEC-2026-3263
- PYSEC-2026-940

## Timeline

- 2022-09-16: disclosed: Vulnerability advisory published
- 2022-09-16: patched: Fix committed in GitHub; patches released for TensorFlow 2.7.2, 2.8.1, 2.9.1, 2.10.0

## References

- [https://github.com/tensorflow/tensorflow/security/advisories/GHSA-2475-53vw-vp25](https://github.com/tensorflow/tensorflow/security/advisories/GHSA-2475-53vw-vp25)

## Related threats

- [PYSEC-2026-3331 - TensorFlow has segfault in array_ops.upper_bound](https://junglewise.ai/threats/cve-2023-33976-tensorflow-has-segfault-in-array-ops-upper-bound)
- [PYSEC-2026-3182 - TensorFlow Denial of Service vulnerability](https://junglewise.ai/threats/cve-2023-25661-tensorflow-denial-of-service-vulnerability)
- [PYSEC-2026-3300 - TensorFlow vulnerable to Out-of-Bounds Read in DynamicStitch](https://junglewise.ai/threats/cve-2023-25659-tensorflow-vulnerable-to-out-of-bounds-read-in-dynamicstitch)
- [PYSEC-2026-3362 - TensorFlow vulnerable to seg fault in `tf.raw_ops.Print`](https://junglewise.ai/threats/cve-2023-25660-tensorflow-vulnerable-to-seg-fault-in-tf-raw-ops-print)
- [PYSEC-2026-3293 - TensorFlow vulnerable to integer overflow in EditDistance](https://junglewise.ai/threats/cve-2023-25662-tensorflow-vulnerable-to-integer-overflow-in-editdistance)
