CVE-2022-41898: TensorFlow SparseFillEmptyRowsGrad Crash Due to Empty Inputs

tensorflow Updated 18 Jul 2026

Summary

13/07/2026
Yes i
Moderate
4.8

CVE-2022-41898: CHECK fail via inputs in SparseFillEmptyRowsGrad. Affects tensorflow across 3 version ranges.

< 2.8.4 >= 2.9.0, < 2.9.3 >= 2.10.0, < 2.10.1

Fixed in 2.8.4, 2.9.3 or 2.10.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-41898 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open-source machine learning library widely used for various applications, including deep learning and neural networks. It provides a comprehensive ecosystem for building and deploying machine learning models. However, like any software, TensorFlow can have vulnerabilities that may affect its stability and security. This specific vulnerability arises in the SparseFillEmptyRowsGrad operation, which is designed to handle sparse tensor operations efficiently. When this operation is provided with empty inputs, it can lead to a crash, disrupting the functionality of applications relying on TensorFlow.

Vulnerability Detail

The vulnerability occurs in the SparseFillEmptyRowsGrad function within TensorFlow, specifically when it is called with empty inputs. This results in a CHECK failure, causing TensorFlow to crash. The issue can be triggered by executing the following code: import tensorflow as tf; tf.raw_ops.SparseFillEmptyRowsGrad(reverse_index_map=[], grad_values=[], name=None). The ramifications of this vulnerability include application crashes and potential data loss, particularly in production environments where TensorFlow is utilized for critical tasks.

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.

  • < 2.8.4 2.8.4
    pip install --upgrade "tensorflow==2.8.4"
  • >= 2.9.0, < 2.9.3 2.9.3
    pip install --upgrade "tensorflow==2.9.3"
  • >= 2.10.0, < 2.10.1 2.10.1
    pip install --upgrade "tensorflow==2.10.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 temporary workaround, avoid passing empty inputs to the SparseFillEmptyRowsGrad function. Ensure that the inputs are validated before calling this operation to prevent crashes. For example, you can implement a check like this: if reverse_index_map and grad_values: tf.raw_ops.SparseFillEmptyRowsGrad(reverse_index_map=reverse_index_map, grad_values=grad_values, name=None).

Conclusion

CVE-2022-41898 is a significant vulnerability in TensorFlow that can lead to application crashes when empty inputs are provided to the SparseFillEmptyRowsGrad function. It is crucial to update to the patched versions of TensorFlow to mitigate this risk. Additionally, implementing input validation can serve as a temporary workaround until an update can be performed.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

CVE-2022-41898 is a vulnerability in TensorFlow that causes the application to crash when the SparseFillEmptyRowsGrad function is called with empty inputs.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit the Vulert playground at Vulert Scanner to analyze your Pipfile.lock.

The affected versions include TensorFlow 2.8.4, 2.9.0, and 2.10.0. The vulnerability has been patched in versions 2.11, 2.10.1, and 2.9.3.

If you cannot update TensorFlow right away, ensure that you validate inputs to the SparseFillEmptyRowsGrad function to avoid passing empty inputs, which can cause crashes.

The CVSS score for this vulnerability is 4.8, indicating a moderate severity level.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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.

  • < 2.8.4 2.8.4
    pip install --upgrade "tensorflow==2.8.4"
  • >= 2.9.0, < 2.9.3 2.9.3
    pip install --upgrade "tensorflow==2.9.3"
  • >= 2.10.0, < 2.10.1 2.10.1
    pip install --upgrade "tensorflow==2.10.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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