CVE-2020-15266: Float cast overflow undefined behavior in TensorFlow
Summary
CVE-2020-15266: Float cast overflow undefined behavior. Affects tensorflow versions < 2.4.0. Fixed in 2.4.0. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2020-15266 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 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 identified in TensorFlow versions prior to 2.4.0 that can lead to undefined behavior and a segmentation fault when certain conditions are met.
Vulnerability Detail
The vulnerability, identified as CVE-2020-15266, arises when the boxes argument of the tf.image.crop_and_resize function in TensorFlow is assigned a very large value. In such cases, the CPU kernel implementation interprets it as a C++ nan floating point value. Operating on this value results in undefined behavior, which can subsequently lead to a segmentation fault. The impact of this vulnerability can be significant, potentially causing crashes or instability in applications utilizing 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 version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.4.0
This is the first release that contains the fix.
pip install --upgrade "tensorflow==2.4.0"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a workaround, users can manually check the value of the boxes argument before passing it to the tf.image.crop_and_resize function. If the value is expected to be very large, it is advisable to handle it appropriately to avoid triggering the vulnerability. Here's an example of how to perform this check in Python:
if boxes > MAX_ALLOWED_VALUE:
# Handle the large value appropriately
else:
tf.image.crop_and_resize(image, boxes, ...)
Conclusion
In conclusion, the CVE-2020-15266 vulnerability in TensorFlow versions prior to 2.4.0 can result in undefined behavior and a segmentation fault when the boxes argument of tf.image.crop_and_resize is assigned a very large value. It is crucial to update to TensorFlow 2.4.0 or later versions to mitigate this vulnerability. Users can also manually check the value of the boxes argument and handle it appropriately as a workaround. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
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 can lead to undefined behavior and a segmentation fault in applications utilizing TensorFlow. This can result in crashes or instability.
To fix this vulnerability, update to TensorFlow 2.4.0 or later versions, which contain the necessary patches to mitigate the issue.
Yes, as a workaround, users can manually check the value of the boxes argument before passing it to the tf.image.crop_and_resize function and handle it appropriately if it is expected to be very large.
For more information, please refer to the TensorFlow security guide and the GitHub issue #42129 where the vulnerability was reported.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.