CVE-2022-23575: TensorFlow CPU - Integer Overflow in OpLevelCostEstimator::CalculateTensorSize
Summary
CVE-2022-23575: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< fcd18ce3101f245b083b30655c27b239dc72221e
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-gpu · PyPI
The same CVE-2022-23575 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
TensorFlow is an open-source machine learning framework widely used for developing and deploying machine learning models. It provides a comprehensive ecosystem of tools, libraries, and resources to facilitate the development of AI applications. TensorFlow CPU is a specific package that focuses on providing CPU support for TensorFlow. It allows users to run TensorFlow models on CPUs without the need for specialized hardware. However, a vulnerability has been discovered in the implementation of OpLevelCostEstimator::CalculateTensorSize in TensorFlow CPU.
Vulnerability Detail
The vulnerability arises due to an integer overflow in the OpLevelCostEstimator::CalculateTensorSize function. If an attacker can create an operation that involves a tensor with a large number of elements, it can trigger the integer overflow. This can lead to various security issues, including memory corruption, crashes, or even potential remote code execution. The vulnerability affects versions of TensorFlow CPU up to and including 2.5.3, 2.6.3, and 2.7.1. However, the fix will be included in TensorFlow 2.8.0.
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.32.5.3pip install --upgrade "tensorflow-cpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip 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 →
Workaround
As a workaround, users can consider limiting the size of tensors used in their operations to avoid triggering the integer overflow. By carefully managing the size of tensors, the risk of exploitation can be reduced. However, this workaround may not be feasible in all scenarios, and it is still recommended to apply the official fix by updating to the patched versions of TensorFlow CPU.
Conclusion
In conclusion, TensorFlow CPU is vulnerable to an integer overflow in the OpLevelCostEstimator::CalculateTensorSize function. This vulnerability can have severe consequences, including memory corruption and potential remote code execution. It is crucial to update to the patched versions of TensorFlow CPU or apply the respective updates once they are released. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying AI models.
The vulnerability can lead to memory corruption, crashes, or potential remote code execution.
Versions up to and including 2.5.3, 2.6.3, and 2.7.1 are affected.
Update TensorFlow CPU to version 2.8.0 once it is released, or apply the respective updates for versions 2.5.3, 2.6.3, and 2.7.1.
Users can limit the size of tensors used in their operations to reduce the risk of exploitation.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.