PT-2021-21762 · Google · Tensorflow

Mihaimaruseac

·

Published

2021-08-12

·

Updated

2024-03-06

·

CVE-2021-37647

CVSS v3.1

7.7

High

VectorAV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
Name of the Vulnerable Software and Affected Versions TensorFlow versions prior to 2.6.0 TensorFlow version 2.5.1 TensorFlow version 2.4.3 TensorFlow version 2.3.4
Description The issue arises when a user does not supply arguments that determine a valid sparse tensor, causing the tf.raw ops.SparseTensorSliceDataset implementation to dereference a null pointer. This occurs when either indices or values are provided for an empty sparse tensor when the other is not. Specifically, if indices is empty, the code that performs validation results in a null pointer dereference. The indices in the C++ code is backed by an empty std::vector, and calling indices->dim size(0) results in null pointer dereferencing.
Recommendations For TensorFlow versions prior to 2.6.0, update to TensorFlow 2.6.0 or later to resolve the issue. For TensorFlow version 2.5.1, apply the patch from GitHub commit 02cc160e29d20631de3859c6653184e3f876b9d7 or update to a later version. For TensorFlow version 2.4.3, apply the patch from GitHub commit 02cc160e29d20631de3859c6653184e3f876b9d7 or update to a later version. For TensorFlow version 2.3.4, apply the patch from GitHub commit 02cc160e29d20631de3859c6653184e3f876b9d7 or update to a later version. As a temporary workaround, consider validating user-supplied indices and values to ensure they determine a valid sparse tensor before passing them to tf.raw ops.SparseTensorSliceDataset.

Fix

NULL Pointer Dereference

Weakness Enumeration

Related Identifiers

BIT-TENSORFLOW-2021-37647
CVE-2021-37647
GHSA-C5X2-P679-95WC
OPENSUSE-SU-2022:10014-1
OPENSUSE-SU-2024:12116-1
PYSEC-2021-269
PYSEC-2021-560
PYSEC-2021-758

Affected Products

Tensorflow