PT-2021-21806 · Google · Tensorflow

Yakun Zhang

·

Published

2021-08-12

·

Updated

2024-03-06

·

CVE-2021-37687

CVSS v4.0

6.8

Medium

VectorAV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Name of the Vulnerable Software and Affected Versions TensorFlow versions prior to 2.6.0 TensorFlow versions 2.5.1 and earlier TensorFlow versions 2.4.3 and earlier TensorFlow versions 2.3.4 and earlier
Description The issue arises from TFLite's GatherNd implementation not supporting negative indices but lacking checks for this situation, allowing an attacker to read arbitrary data from the heap by crafting a model with negative values in indices. A similar issue exists in the Gather implementation. This can be exploited by carefully crafting a model, as demonstrated in a provided Python example, which utilizes the tf.gather function with negative indices values to read data from the heap.
Recommendations For versions prior to 2.6.0, update to TensorFlow 2.6.0 or later. For versions 2.5.1 and earlier, update to TensorFlow 2.5.1 or later. For versions 2.4.3 and earlier, update to TensorFlow 2.4.3 or later. For versions 2.3.4 and earlier, update to TensorFlow 2.3.4 or later. As a temporary workaround, consider disabling the GatherNd and Gather implementations until a patch is available. Restrict access to the vulnerable TFLite kernel to minimize the risk of exploitation. Avoid using negative values in indices for the affected API endpoints until the issue is resolved.

Fix

Out of bounds Read

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

BIT-TENSORFLOW-2021-37687
CVE-2021-37687
GHSA-JWF9-W5XM-F437
OPENSUSE-SU-2022:10014-1
OPENSUSE-SU-2024:12116-1
PYSEC-2021-309
PYSEC-2021-600
PYSEC-2021-798

Affected Products

Tensorflow