CVE-2022-23575: TensorFlow Integer Overflow Vulnerability
Summary
CVE-2022-23575: 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
- tensorflow · Bitnami
- tensorflow-gpu · PyPI
- tensorflow-cpu · 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 library developed by Google. It is widely used for building and training machine learning models, offering a flexible architecture that allows deployment across various platforms. TensorFlow's capabilities include deep learning, neural networks, and complex mathematical computations. However, it is susceptible to vulnerabilities that can arise from its complex operations, such as the integer overflow issue described in this report.
Vulnerability Detail
The vulnerability arises from the implementation of the 'OpLevelCostEstimator::CalculateTensorSize' function in TensorFlow, which can lead to an integer overflow when calculating the size of a tensor. This occurs when both the element count and the data type size are large enough to cause an overflow during multiplication. An attacker could exploit this vulnerability by creating a tensor with a large number of elements, potentially leading to denial of service or other unintended behaviors in applications relying on 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.32.5.3pip install --upgrade "tensorflow==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow==2.6.3" -
>= 2.7.0, < 2.7.12.7.1pip 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
Currently, there are no specific workarounds mentioned for this vulnerability. The best course of action is to update to the patched versions of TensorFlow.
Conclusion
The integer overflow vulnerability in TensorFlow (CVE-2022-23575) poses a significant risk to applications using the library. It is essential to update to the patched versions to ensure the security and stability of your machine learning applications. Regular monitoring for vulnerabilities using tools like Vulert can help maintain the integrity of your software.
See every vulnerability recorded for tensorflow →
FAQ
CVE-2022-23575 is a vulnerability in TensorFlow that can lead to an integer overflow when calculating tensor sizes, potentially causing denial of service.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit the Vulert playground at Vulert Scanner to check if your application is affected without needing to sign up.
TensorFlow versions prior to 2.5.3, 2.6.3, and 2.7.1 are affected by this vulnerability.
The CVSS score of this vulnerability is 6.5, indicating a moderate severity level.
While there are no specific workarounds, it is crucial to plan an update to the patched versions as soon as possible to mitigate the risk.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.