CVE-2020-15190: TensorFlow - Switch Operation Segmentation Fault
Summary
CVE-2020-15190: In Tensorflow before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, the tf.raw_ops.Switch operation takes as input a tensor and a boolean and outputs two tensors. Affects tensorflow across 6 version ranges.
< 1.15.4
>= 2.0.0, < 2.0.3
>= 2.1.0, < 2.1.2
>= 2.2.0, < 2.2.1
>= 2.3.0, < 2.3.1
< da8558533d925694483d2c136a9220d6d49d843c
Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2020-15190 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 community resources for building and deploying machine learning models. The tf.raw_ops.Switch operation in TensorFlow is used to conditionally output two tensors based on a boolean value. However, a vulnerability in versions before 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1 allows for a segmentation fault due to undefined behavior when binding a reference to a nullptr tensor.
Vulnerability Detail
The vulnerability arises from the eager runtime in TensorFlow traversing all tensors in the output of the tf.raw_ops.Switch operation. As only one tensor is defined, the other tensor is nullptr, leading to a segmentation fault. This issue can result in crashes and potentially be exploited by attackers to execute arbitrary code or cause denial of service.
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.
-
< 1.15.41.15.4pip install --upgrade "tensorflow==1.15.4" -
>= 2.0.0, < 2.0.32.0.3pip install --upgrade "tensorflow==2.0.3" -
>= 2.1.0, < 2.1.22.1.2pip install --upgrade "tensorflow==2.1.2" -
>= 2.2.0, < 2.2.12.2.1pip install --upgrade "tensorflow==2.2.1" -
>= 2.3.0, < 2.3.12.3.1pip install --upgrade "tensorflow==2.3.1"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a workaround, users can avoid using the tf.raw_ops.Switch operation in their code until they have updated to the patched versions of TensorFlow.
Conclusion
The vulnerability in TensorFlow's tf.raw_ops.Switch operation can lead to a segmentation fault and potential security risks. It is crucial to update to the patched versions of TensorFlow to mitigate this issue. 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.
The tf.raw_ops.Switch operation in TensorFlow is used to conditionally output two tensors based on a boolean value.
The vulnerability can lead to a segmentation fault, causing crashes and potentially enabling attackers to execute arbitrary code or cause denial of service.
To fix this vulnerability, update TensorFlow to versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
Yes, users can avoid using the tf.raw_ops.Switch operation until they have updated to the patched versions of TensorFlow.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.