CVE-2020-15197: TensorFlow SparseCountSparseOutput Rank Validation Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2020-15197: Denial of Service in Tensorflow. Affects tensorflow versions >= 2.3.0, < 2.3.1. Fixed in 2.3.1. How to fix ↓

Also tracked for

The same CVE-2020-15197 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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. The SparseCountSparseOutput function in TensorFlow is used to count the number of nonzero elements in a sparse tensor. However, prior to version 2.3.1, this implementation does not validate the input arguments, specifically the 'indices' tensor, to ensure it has a rank of 2. This can lead to a CHECK assertion failure and a crash if malicious users pass tensors of different ranks. This vulnerability can be exploited to cause denial of service in serving installations where users have control over the input sparse tensor components.

Vulnerability Detail

The vulnerability in TensorFlow's SparseCountSparseOutput function arises from the lack of validation for the rank of the 'indices' tensor. This tensor is assumed to be a matrix and its elements are accessed accordingly. However, if a tensor of a different rank is provided, a CHECK assertion failure occurs, resulting in a crash. Malicious users can exploit this vulnerability to cause a denial of service in serving installations. The issue has been patched in commit 3cbb917b4714766030b28eba9fb41bb97ce9ee02 and is addressed in TensorFlow version 2.3.1.

How To Fix

Minimum fixed version

2.3.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, users can manually validate the rank of the 'indices' tensor before passing it to the SparseCountSparseOutput function. This can be done by checking the shape of the tensor and ensuring it has a rank of 2. If the tensor has a different rank, appropriate actions can be taken to handle the situation and prevent a crash.

Conclusion

The TensorFlow SparseCountSparseOutput Rank Validation Vulnerability (CVE-2020-15197) allows malicious users to cause a denial of service in serving installations. It can be mitigated by updating TensorFlow to version 2.3.1 or later and regularly updating dependencies. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

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 SparseCountSparseOutput function in TensorFlow is used to count the number of nonzero elements in a sparse tensor.

This vulnerability can be exploited by malicious users to cause a denial of service in serving installations where they have control over the input sparse tensor components.

To fix this vulnerability, update TensorFlow to version 2.3.1 or later. Regularly update all dependencies and libraries used in the application.

Yes, a workaround is to manually validate the rank of the 'indices' tensor before passing it to the SparseCountSparseOutput function.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.3.1

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback