CVE-2020-15199: TensorFlow - RaggedCountSparseOutput Validation Failure
Summary
CVE-2020-15199: In Tensorflow before version 2.3.1, the RaggedCountSparseOutput does not validate that the input arguments form a valid ragged tensor. Affects tensorflow across 2 version ranges.
< 2.3.1
< 3cbb917b4714766030b28eba9fb41bb97ce9ee02
Fixed in 3cbb917b4714766030b28eba9fb41bb97ce9ee02. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2020-15199 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 various data structures, including ragged tensors, which are tensors with non-uniform shapes. Ragged tensors are commonly used in natural language processing and other applications where data has variable lengths. However, in versions prior to 2.3.1, TensorFlow does not properly validate the input arguments for the RaggedCountSparseOutput function, leading to a vulnerability.
Vulnerability Detail
The vulnerability (CVE-2020-15199) arises from the lack of validation in the RaggedCountSparseOutput function of TensorFlow. Specifically, the code fails to check if the splits tensor, which is required for initializing a data structure called BatchedMap, has the minimum required number of elements. If the splits tensor is empty or has only one element, a SIGABRT signal is raised by the operating system, resulting in a crash. An attacker could potentially exploit this vulnerability to cause a denial-of-service (DoS) condition or disrupt the execution of TensorFlow-based applications.
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
3cbb917b4714766030b28eba9fb41bb97ce9ee02
This is the first release that contains the fix.
pip install --upgrade "tensorflow==3cbb917b4714766030b28eba9fb41bb97ce9ee02"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to TensorFlow 2.3.1 is not immediately feasible, a possible workaround is to manually validate the splits tensor before passing it to the RaggedCountSparseOutput function. This can be done by checking the number of elements in the splits tensor and ensuring it meets the minimum requirement. Here's an example of how to perform this validation in Python:
import tensorflow as tf
splits = ... # The splits tensor
if tf.size(splits) < 2:
raise ValueError('The splits tensor must have at least two elements.')
# Proceed with using the `RaggedCountSparseOutput` function
...```
Conclusion
In conclusion, the vulnerability (CVE-2020-15199) in TensorFlow versions prior to 2.3.1 allows for a validation failure in the RaggedCountSparseOutput function. This can be exploited to cause a DoS condition or disrupt TensorFlow-based applications. Users should update to TensorFlow 2.3.1 or later to mitigate this vulnerability. If immediate upgrade is not feasible, manual validation of the splits tensor can serve as a temporary workaround. For further assistance or support in 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.
A ragged tensor is a type of tensor in TensorFlow that can handle data with variable lengths. It is commonly used in applications such as natural language processing.
The vulnerability can lead to a denial-of-service (DoS) condition or disruption of TensorFlow-based applications if exploited. It may cause crashes or unexpected behavior.
To fix this vulnerability, update your TensorFlow installation to version 2.3.1 or later. Use the command 'pip install --upgrade tensorflow' to upgrade.
If immediate upgrade is not possible, you can manually validate the splits tensor before using the affected function. Check the number of elements and ensure it meets the minimum requirement.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.