CVE-2022-21736: TensorFlow - SparseTensorSliceDataset Null Pointer Dereference

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
Medium
Not published

CVE-2022-21736: Undefined behavior in Tensorflow. Affects tensorflow across 3 version ranges.

< 2.5.3 >= 2.6.0, < 2.6.3 >= 2.7.0, < 2.7.1

Fixed in 2.5.3, 2.6.3 or 2.7.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-21736 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 framework developed by Google. It provides a comprehensive ecosystem for building and deploying machine learning models. TensorFlow includes various components and APIs for data manipulation, model training, and inference. One of the key features of TensorFlow is its support for sparse tensors, which are efficient representations of tensors with a large number of zero values. However, the implementation of the SparseTensorSliceDataset in TensorFlow has a vulnerability that can lead to a null pointer dereference under certain conditions.

Vulnerability Detail

The vulnerability in TensorFlow's SparseTensorSliceDataset arises from the lack of validation of preconditions for the three input arguments that represent a sparse tensor. When these arguments do not satisfy the required conditions, the implementation can dereference a null pointer, leading to undefined behavior. An attacker could potentially exploit this vulnerability to cause a denial of service (DoS) or execute arbitrary code with the privileges of the TensorFlow process. The vulnerability has been assigned the CVE identifier CVE-2022-21736.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 2.7.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 this vulnerability is being addressed through software updates, there is no specific workaround provided. Users are encouraged to prioritize updating their TensorFlow installations to the patched versions.

Conclusion

The vulnerability in TensorFlow's SparseTensorSliceDataset can lead to a null pointer dereference, potentially resulting in a denial of service or arbitrary code execution. Users are advised to update their TensorFlow installations to the latest patched version as soon as it becomes available. For further support on vulnerability remediation, you can reach out to 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 a comprehensive ecosystem for building and deploying machine learning models.

A sparse tensor is an efficient representation of a tensor that contains a large number of zero values. It allows for more efficient storage and computation for tensors with sparse data.

The vulnerability in TensorFlow's SparseTensorSliceDataset can lead to a null pointer dereference, resulting in undefined behavior. This could potentially be exploited by an attacker to cause a denial of service or execute arbitrary code with the privileges of the TensorFlow process.

To fix this vulnerability, it is recommended to update your TensorFlow installation to the latest patched version as soon as it becomes available. The TensorFlow development team has addressed the issue in TensorFlow 2.8.0 and backported the fix to earlier versions within the supported range.

As this vulnerability is being addressed through software updates, there is no specific workaround provided. It is recommended to update your TensorFlow installation to the patched version.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.5.3 2.5.3
  • >= 2.6.0, < 2.6.3 2.6.3
  • >= 2.7.0, < 2.7.1 2.7.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