CVE-2022-21727: Integer Overflow in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
7.6

CVE-2022-21727: Integer overflow in Tensorflow. Affects tensorflow across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 >= 2.7.0, < 2.7.1

Fixed in 2.5.3, 2.6.3 or 2.7.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-21727 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow supports various platforms and programming languages, making it widely used in both research and production environments. However, a vulnerability has been discovered in TensorFlow that could potentially lead to security issues.

Vulnerability Detail

The vulnerability, identified as CVE-2022-21727, is an integer overflow weakness in the implementation of shape inference for the Dequantize function in TensorFlow. The issue arises from the mishandling of the axis argument, which can be manipulated by an attacker to trigger an integer overflow. This vulnerability can be exploited to execute arbitrary code or cause a denial-of-service (DoS) condition. The impact of this vulnerability is rated as HIGH with a CVSS score of 7.6.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==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.5.3 2.5.3
    pip install --upgrade "tensorflow==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can avoid using the Dequantize function with the vulnerable axis argument. If the function is necessary, it is advised to validate and sanitize the axis input to ensure it falls within the acceptable range.

Conclusion

The vulnerability in TensorFlow (CVE-2022-21727) poses a significant risk to systems utilizing the affected versions. It is crucial to update TensorFlow to the patched versions to mitigate the vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides tools and resources for building and deploying machine learning models.

The vulnerability allows an attacker to trigger an integer overflow, potentially leading to arbitrary code execution or a denial-of-service condition.

To fix the vulnerability, update TensorFlow to version 2.5.3, 2.6.3, 2.7.1, or later, following the official TensorFlow upgrade instructions.

As a temporary workaround, avoid using the Dequantize function with the vulnerable axis argument. Validate and sanitize the axis input if necessary.

For more information, refer to the official security guide provided by the TensorFlow team.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==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.5.3 2.5.3
    pip install --upgrade "tensorflow==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow==2.6.3"
  • >= 2.7.0, < 2.7.1 2.7.1
    pip install --upgrade "tensorflow==2.7.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