CVE-2022-23589
JSON

6.5medium

Null pointer dereference in Grappler's `IsConstant` in Tensorflow

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.14% (higher than 67% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-9px9-73fg-3fqpBIT-TENSORFLOW-2022-23589PYSEC-2022-153PYSEC-2022-98PYSEC-2026-3154

Description

Tensorflow is an Open Source Machine Learning Framework. Under certain scenarios, Grappler component of TensorFlow can trigger a null pointer dereference. There are 2 places where this can occur, for the same malicious alteration of a `SavedModel` file (fixing the first one would trigger the same dereference in the second place). First, during constant folding, the `GraphDef` might not have the required nodes for the binary operation. If a node is missing, the correposning `mul_*child` would be null, and the dereference in the subsequent line would be incorrect. We have a similar issue during `IsIdentityConsumingSwitch`. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Affected

Product or packageVersionsReported by
tensorflow tensorflow>= 2.7.0, < 2.7.1, >= 2.6.0, < 2.6.3, < 2.5.3CVE List
tensorflow (PyPI)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1GitHub Advisory Database, PyPA Advisory Database
tensorflow-cpu (PyPI)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1, before 0a365c029e437be0349c31f8d4c9926b69fa3fa1, before 045deec1cbdebb27d817008ad5df94d96a08b1bfGitHub Advisory Database, PyPA Advisory Database
tensorflow-gpu (PyPI)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1, before 0a365c029e437be0349c31f8d4c9926b69fa3fa1, before 045deec1cbdebb27d817008ad5df94d96a08b1bfGitHub Advisory Database, PyPA Advisory Database
google tensorflowup to 2.5.2, from 2.6.0 up to 2.6.2, 2.7.0NVD
tensorflow (Bitnami)before 2.5.3, from 2.6.0 before 2.6.3, from 2.7.0 before 2.7.1Bitnami Vulnerability Database

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
GitHub6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD4.0medium CVSS:2.0AV:N/AC:L/Au:S/C:N/I:N/A:P
PyPA Advisory Database6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Bitnami Vulnerability Databasemedium rating

Classification

CWE-476

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Tensorflow is an Open Source Machine Learning Framework. Under certain scenarios, Grappler component of TensorFlow can trigger a null pointer dereference. There are 2 places where this can occur, for the same malicious alteration of a `SavedModel` file (fixing the first one would trigger the same dereference in the second place). First, during constant folding, the `GraphDef` might not have the required nodes for the binary operation. If a node is missing, the correposning `mul_*child` would be null, and the dereference in the subsequent line would be incorrect. We have a similar issue during `IsIdentityConsumingSwitch`. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

GitHub Advisory Database
Impact

Under certain scenarios, Grappler component of TensorFlow can trigger a null pointer dereference. There are 2 places where this can occur, for the same malicious alteration of a SavedModel file (fixing the first one would trigger the same dereference in the second place):

First, during constant folding, the GraphDef might not have the required nodes for the binary operation:

  NodeDef* mul_left_child = node_map_->GetNode(node->input(0));
  NodeDef* mul_right_child = node_map_->GetNode(node->input(1));
  // One child must be constant, and the second must be Conv op.
  const bool left_child_is_constant = IsReallyConstant(*mul_left_child);
  const bool right_child_is_constant = IsReallyConstant(*mul_right_child);

If a node is missing, the correposning mul_*child would be null, and the dereference in the subsequent line would be incorrect.

We have a similar issue during IsIdentityConsumingSwitch:

  NodeDef* input_node = graph.GetNode(tensor_id.node());
  return IsSwitch(*input_node);
Patches

We have patched the issue in GitHub commits 0a365c029e437be0349c31f8d4c9926b69fa3fa1 and 045deec1cbdebb27d817008ad5df94d96a08b1bf.

The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

NVD (es)

Tensorflow es un Marco de Aprendizaje Automático de Código Abierto. Bajo determinados escenarios, el componente Grappler de TensorFlow puede desencadenar una desreferencia de puntero null. Se presentan 2 lugares donde esto puede ocurrir, para la misma alteración maliciosa de un archivo "SavedModel" (arreglar el primero desencadenaría la misma desreferencia en el segundo lugar). Primero, durante el plegado constante, el "GraphDef" podría no tener los nodos necesarios para la operación binaria. Si falta un nodo, el "mul_*child" correspondiente sería nulo, y la desreferencia en la línea posterior sería incorrecta. Tenemos un problema similar durante "IsIdentityConsumingSwitch". La corrección será incluida en TensorFlow versión 2.8.0. También seleccionaremos este commit en TensorFlow versión 2.7.1, TensorFlow versión 2.6.3, y TensorFlow versión 2.5.3, ya que estos también están afectados y aún están en el rango admitido

References

https://github.com/tensorflow/tensorflow/security/advisories/GHSA-9px9-73fg-3fqpadvisory, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/commit/045deec1cbdebb27d817008ad5df94d96a08b1bfadvisory, fix, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/commit/0a365c029e437be0349c31f8d4c9926b69fa3fa1advisory, fix, patch, third-party-advisory, web
https://github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/mutable_graph_view.cc#L59-L74advisory, exploit, third-party-advisory, web
https://github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/optimizers/constant_folding.cc#L3466-L3497advisory, exploit, third-party-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2022-23589advisory, web
https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-98.yamlweb
https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-153.yamlweb
https://github.com/tensorflow/tensorflowweb
https://pypi.org/project/tensorflowpackage
https://github.com/advisories/GHSA-9px9-73fg-3fqpadvisory

Sources

SourceRecordLicence
CVE ListCVE-2022-23589 changed 2025-04-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-9px9-73fg-3fqp changed 2026-07-13CC-BY-4.0
NVDCVE-2022-23589 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2022-153 changed 2026-07-13CC-BY-4.0
PyPA Advisory DatabasePYSEC-2022-98 changed 2026-07-13CC-BY-4.0
PyPA Advisory DatabasePYSEC-2026-3154 changed 2026-07-13CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-TENSORFLOW-2022-23589 changed 2026-09-08Apache-2.0