PT-2021-18282 · Google · Tensorflow

Yakun Zhang

+1

·

Published

2021-05-14

·

Updated

2024-03-06

·

CVE-2021-29531

CVSS v3.1

5.5

Medium

VectorAV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Name of the Vulnerable Software and Affected Versions: TensorFlow versions prior to 2.5.0 TensorFlow versions 2.4.2 and earlier TensorFlow versions 2.3.3 and earlier TensorFlow versions 2.2.3 and earlier TensorFlow versions 2.1.4 and earlier
Description: An attacker can trigger a CHECK fail in PNG encoding by providing an empty input tensor as the pixel data. This is because the implementation only validates that the total number of pixels in the image does not overflow, allowing an attacker to send an empty matrix for encoding. When calling png::WriteImageToBuffer, the first argument is NULL, triggering a CHECK NOTNULL and resulting in abort being called after printing the stacktrace. This allows an attacker to mount a denial of service attack.
Recommendations: Update to TensorFlow 2.5.0 or later. For versions 2.4.2, 2.3.3, 2.2.3, and 2.1.4, apply the cherrypicked commit to fix the issue. As a temporary workaround, consider validating input tensors to ensure they are not empty before encoding.

Exploit

Fix

Improper Check for Exceptional Conditions

Weakness Enumeration

Related Identifiers

BIT-TENSORFLOW-2021-29531
CVE-2021-29531
GHSA-3QXP-QJQ7-W4HF
PYSEC-2021-168
PYSEC-2021-459
PYSEC-2021-657

Affected Products

Tensorflow