CVE-2022-23574: TensorFlow Heap Out-of-Bounds Read/Write

tensorflow-cpu Updated 02 Oct 2025

Summary

04/02/2022
Yes i
Unrated
Not published

CVE-2022-23574: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 < 0657c83d08845cc434175934c642299de2c0f042

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

Also tracked for

The same CVE-2022-23574 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 widely used for developing and deploying machine learning models. It provides a comprehensive set of tools and libraries for building and training neural networks. TensorFlow is written in Python and C++ and supports various platforms and devices. It is maintained by the TensorFlow team at Google. This vulnerability affects the TensorFlow CPU package available on PyPI.

Vulnerability Detail

The vulnerability in TensorFlow is caused by a typo in the SpecializeType function. This typo leads to a heap out-of-bounds read/write issue. In the affected code, the variable arg is incorrectly initialized to the ith mutable argument in a loop where the loop index is j. This allows an attacker to assign values to arg from outside the vector of arguments, resulting in both read and write operations outside the bounds of the data. This vulnerability can be exploited to manipulate memory and potentially execute arbitrary code. The issue has been identified and fixed in TensorFlow 2.8.0, and the fix has also been backported to TensorFlow 2.7.1 and TensorFlow 2.6.3.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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-cpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-cpu==2.6.3"

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

Conclusion

The vulnerability in TensorFlow's SpecializeType function can lead to heap out-of-bounds read/write operations, potentially enabling an attacker to manipulate memory and execute arbitrary code. It is crucial to update to the fixed versions of TensorFlow (2.8.0, 2.7.1, or 2.6.3) to mitigate this vulnerability. For further assistance or support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow-cpu →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for building and training neural networks.

This vulnerability allows an attacker to perform heap out-of-bounds read/write operations, potentially leading to memory manipulation and arbitrary code execution.

The vulnerability affects TensorFlow versions 2.5.3, 2.6.0, 2.6.3, and prior versions.

To fix this vulnerability, update to TensorFlow 2.8.0, 2.7.1, or 2.6.3, depending on your current version.

No specific workaround has been provided. It is recommended to update to the fixed versions of TensorFlow.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-cpu.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-cpu==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-cpu==2.5.3"
  • >= 2.6.0, < 2.6.3 2.6.3
    pip install --upgrade "tensorflow-cpu==2.6.3"

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