CVE-2020-5215: TensorFlow - Segmentation Fault in Eager Mode
Summary
CVE-2020-5215: Segmentation faultin TensorFlow when converting a Python string to tf.float16. Affects tensorflow across 2 version ranges.
< 1.15.2
>= 2.0.0, < 2.0.1
Fixed in 1.15.2 or 2.0.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · PyPI
The same CVE-2020-5215 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 supports both graph mode and eager mode execution. In eager mode, operations are executed immediately as they are called, allowing for more interactive and intuitive development. However, this mode is susceptible to a vulnerability that can lead to a denial of service attack.
Vulnerability Detail
The vulnerability (CVE-2020-5215) in TensorFlow versions before 1.15.2 and 2.0.1 arises when converting a string from Python to a tf.float16 value in eager mode. The format checks for this use case are only present in graph mode, resulting in a segmentation fault. An attacker can exploit this issue by sending a data point containing a string instead of a tf.float16 value, causing a denial of service in inference/training. Additionally, manipulating saved models and checkpoints by replacing a scalar tf.float16 value with a scalar string can trigger this vulnerability. The issue can be easily reproduced using the code tf.constant("hello", tf.float16) with eager execution enabled. TensorFlow versions 1.15.1, 2.0.1, and 2.1.0 have been patched to address this vulnerability.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 1.15.21.15.2 -
>= 2.0.0, < 2.0.12.0.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no specific workaround provided for this vulnerability. The recommended solution is to upgrade to the patched versions of TensorFlow.
Conclusion
The vulnerability (CVE-2020-5215) in TensorFlow versions before 1.15.2 and 2.0.1 can result in a segmentation fault in eager mode, leading to a denial of service attack. Upgrading to TensorFlow versions 1.15.2, 2.0.1, or 2.1.0 is necessary to mitigate this vulnerability. It is important to keep software dependencies up to date to ensure compatibility. 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 tools and resources for building and deploying machine learning models.
The vulnerability can lead to a denial of service attack in inference/training when a string is converted to a tf.float16 value in eager mode. An attacker can exploit this to disrupt the functioning of TensorFlow-based applications.
You can reproduce this vulnerability by executing the code tf.constant("hello", tf.float16) with eager execution enabled in a vulnerable version of TensorFlow.
Versions of TensorFlow before 1.15.2 and 2.0.1 are affected by this vulnerability. TensorFlow 2.1.0 and later versions are not affected.
No specific workarounds are provided for this vulnerability. It is recommended to upgrade to the patched versions of TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.