CVE-2022-23566: Out of Bounds Write in TensorFlow

tensorflow Updated 02 Oct 2025

Summary

09/02/2022
Yes i
High
8.8

CVE-2022-23566: Out of bounds write 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-23566 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in TensorFlow that could potentially allow an attacker to perform an out-of-bounds write operation, leading to unauthorized access or control of the affected system.

Vulnerability Detail

The vulnerability in TensorFlow exists in the Grappler component, specifically in the SetUnknownShape function of the graph_properties.cc file. This function is responsible for setting the shape of a node's output in the inference context. However, due to a flaw in the implementation, an attacker can exploit this function to perform a heap out-of-bounds write. By manipulating the input parameters, the attacker can write arbitrary data to memory locations beyond the bounds of the allocated buffer. This can result in the corruption of critical data structures, leading to a variety of potential consequences, including remote code execution, denial of service, or information disclosure.

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 consider implementing input validation and sanitization mechanisms to prevent malicious inputs from triggering the vulnerable code path. Additionally, it is recommended to apply strict input size limits and boundary checks to prevent out-of-bounds writes. However, these workarounds may not provide complete protection and should be seen as temporary measures until the official patches are applied.

Conclusion

In conclusion, TensorFlow is vulnerable to an out-of-bounds write issue in the Grappler component. This vulnerability can have severe consequences, including remote code execution, denial of service, or information disclosure. Users are strongly advised to update their TensorFlow installations to the patched versions as soon as possible. Implementing input validation and sanitization mechanisms can serve as temporary workarounds until the official patches are applied. For further support and assistance, 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 a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models.

The vulnerability allows an attacker to perform an out-of-bounds write operation, potentially leading to unauthorized access or control of the affected system. The consequences can include remote code execution, denial of service, or information disclosure.

To fix this vulnerability, update your TensorFlow installation to the patched versions: TensorFlow 2.8.0, TensorFlow 2.7.1, TensorFlow 2.6.3, or TensorFlow 2.5.3. These versions include the necessary fixes to prevent exploitation.

As a temporary workaround, you can implement input validation and sanitization mechanisms to prevent malicious inputs from triggering the vulnerable code path. Additionally, apply strict input size limits and boundary checks to mitigate the risk of out-of-bounds writes.

For more information about this vulnerability, you can refer to the TensorFlow security guide: https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md. If you have further questions or need assistance, you can contact the TensorFlow development 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