CVE-2020-5215: Segmentation faultin TensorFlow when converting a Python string to tf.float16
Impact
Converting a string (from Python) to a tf.float16 value results in a segmentation fault in eager mode as the format checks for this use case are only in the graph mode.
This issue can lead to denial of service in inference/training where a malicious attacker can send a data point which contains a string instead of a tf.float16 value.
Similar effects can be obtained by manipulating saved models and checkpoints whereby replacing a scalar tf.float16 value with a scalar string will trigger this issue due to automatic conversions.
This can be easily reproduced by tf.constant("hello", tf.float16), if eager execution is enabled.
Patches We have patched the vulnerability in GitHub commit 5ac1b9.
We are additionally releasing TensorFlow 1.15.1 and 2.0.1 with this vulnerability patched.
TensorFlow 2.1.0 was released after we fixed the issue, thus it is not affected.
We encourage users to switch to TensorFlow 1.15.1, 2.0.1 or 2.1.0.
For more information
Please consult SECURITY.md for more information regarding the security model and how to contact us with issues and questions.
Other sources
In TensorFlow before 1.15.2 and 2.0.1, converting a string (from Python) to a tf.float16 value results in a segmentation fault in eager mode as the format checks for this use case are only in the graph mode. This issue can lead to denial of service in inference/training where a malicious attacker can send a data point which contains a string instead of a tf.float16 value. Similar effects can be obtained by manipulating saved models and checkpoints whereby replacing a scalar tf.float16 value with a scalar string will trigger this issue due to automatic conversions. This can be easily reproduced by tf.constant("hello", tf.float16), if eager execution is enabled. This issue is patched in TensorFlow 1.15.1 and 2.0.1 with this vulnerability patched. TensorFlow 2.1.0 was released after we fixed the issue, thus it is not affected. Users are encouraged to switch to TensorFlow 1.15.1, 2.0.1 or 2.1.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/tensorflow-gputo a version that resolves this vulnerability.Fixed in 2.0.1 - Upgrade
Upgrade
pip/tensorflow-gputo a version that resolves this vulnerability.Fixed in 1.15.2 - Upgrade
Upgrade
pip/tensorflow-cputo a version that resolves this vulnerability.Fixed in 2.0.1 - Upgrade
Upgrade
pip/tensorflow-cputo a version that resolves this vulnerability.Fixed in 1.15.2 - Upgrade
Upgrade
pip/tensorflowto a version that resolves this vulnerability.Fixed in 2.0.1 - Upgrade
Upgrade
pip/tensorflowto a version that resolves this vulnerability.Fixed in 1.15.2 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 1.15.2 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.0.1 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Fixed in 2.1.0 - Upgrade
Upgrade
TensorFlowto a version that resolves this vulnerability.Patch 5ac1b9
Event History
Frequently Asked Questions
What is the severity of CVE-2020-5215?
The severity of CVE-2020-5215 is classified as high due to the potential for denial of service.
How do I fix CVE-2020-5215?
To fix CVE-2020-5215, upgrade TensorFlow to version 2.0.1 or 1.15.2.
What software is affected by CVE-2020-5215?
CVE-2020-5215 affects TensorFlow versions prior to 1.15.2 and between 2.0.0 and 2.0.1.
What causes the vulnerability in CVE-2020-5215?
CVE-2020-5215 is caused by a lack of format checks when converting strings to tf.float16 in eager mode.
Is there a workaround for CVE-2020-5215?
There is no specific workaround for CVE-2020-5215; upgrading to the fixed versions is recommended.