Buffer Overflow Affecting tensorflow-cpu package, versions [,2.8.4)[2.9.0,2.9.3)[2.10.0,2.10.1)[2.11.0rc0,2.11.0)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.15% (53rd percentile)

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 IDSNYK-PYTHON-TENSORFLOWCPU-3136218
  • published20 Nov 2022
  • disclosed20 Nov 2022
  • creditThibaut Goetghebuer-Planchon

Introduced: 20 Nov 2022

CVE-2022-41894  (opens in a new tab)
CWE-120  (opens in a new tab)

How to fix?

Upgrade tensorflow-cpu to version 2.8.4, 2.9.3, 2.10.1, 2.11.0 or higher.

Overview

tensorflow-cpu is a machine learning framework.

Affected versions of this package are vulnerable to Buffer Overflow. The reference kernel of the CONV_3D_TRANSPOSE TensorFlow Lite operator wrongly increments the data_ptr when adding the bias to the result. Instead of data_ptr += num_channels; it should be data_ptr += output_num_channels; as if the number of input channels is different than the number of output channels, the wrong result will be returned and a buffer overflow will occur if num_channels > output_num_channels. An attacker can craft a model with a specific number of input channels. It is then possible to write specific values through the bias of the layer outside the bounds of the buffer.

Note: This attack only works if the reference kernel resolver is used in the interpreter.

CVSS Scores

version 3.1