CVE-2022-23589: Null pointer dereference in Grappler's `IsConstant` in Tensorflow

Published Feb 4, 2022
·
Updated

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:

cc NodeDef mulleftchild = nodemap->GetNode(node->input(0)); NodeDef mulrightchild = nodemap->GetNode(node->input(1)); // One child must be constant, and the second must be Conv op. const bool leftchildisconstant = IsReallyConstant(mulleftchild); const bool rightchildisconstant = IsReallyConstant(mulrightchild);

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

We have a similar issue during IsIdentityConsumingSwitch:

cc NodeDef inputnode = graph.GetNode(tensorid.node()); return IsSwitch(inputnode);

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.

Other sources

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 mulchild 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 Software

12 affected componentsFixes available
pip/tensorflow-gpu=2.7.0
2.7.1
pip/tensorflow-gpu>=2.6.0<2.6.3
2.6.3
pip/tensorflow-gpu<2.5.3
2.5.3
pip/tensorflow-cpu=2.7.0
2.7.1
pip/tensorflow-cpu>=2.6.0<2.6.3
2.6.3
pip/tensorflow-cpu<2.5.3
2.5.3
pip/tensorflow=2.7.0
2.7.1
pip/tensorflow>=2.6.0<2.6.3
2.6.3
pip/tensorflow<2.5.3
2.5.3
Google TensorFlow<=2.5.2
Google TensorFlow>=2.6.0<=2.6.2
Google TensorFlow=2.7.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/tensorflow-gpu to a version that resolves this vulnerability.

    Fixed in 2.7.1
  2. Upgrade

    Upgrade pip/tensorflow-gpu to a version that resolves this vulnerability.

    Fixed in 2.6.3
  3. Upgrade

    Upgrade pip/tensorflow-gpu to a version that resolves this vulnerability.

    Fixed in 2.5.3
  4. Upgrade

    Upgrade pip/tensorflow-cpu to a version that resolves this vulnerability.

    Fixed in 2.7.1
  5. Upgrade

    Upgrade pip/tensorflow-cpu to a version that resolves this vulnerability.

    Fixed in 2.6.3
  6. Upgrade

    Upgrade pip/tensorflow-cpu to a version that resolves this vulnerability.

    Fixed in 2.5.3
  7. Upgrade

    Upgrade pip/tensorflow to a version that resolves this vulnerability.

    Fixed in 2.7.1
  8. Upgrade

    Upgrade pip/tensorflow to a version that resolves this vulnerability.

    Fixed in 2.6.3
  9. Upgrade

    Upgrade pip/tensorflow to a version that resolves this vulnerability.

    Fixed in 2.5.3
  10. Upgrade

    Upgrade TensorFlow to a version that resolves this vulnerability.

    Fixed in 2.8.0
  11. Upgrade

    Upgrade TensorFlow to a version that resolves this vulnerability.

    Patch 0a365c029e437be0349c31f8d4c9926b69fa3fa1
  12. Upgrade

    Upgrade TensorFlow to a version that resolves this vulnerability.

    Patch 045deec1cbdebb27d817008ad5df94d96a08b1bf

Event History

Feb 4, 2022
CVE Published
via MITRE·10:32 PM
Data Sourced
via MITRE·10:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 9, 2022
Advisory Published
via GitHub·11:29 PM

Frequently Asked Questions

1

What is the severity of CVE-2022-23589?

CVE-2022-23589 is classified as a medium severity vulnerability due to the potential for null pointer dereference.

2

How do I fix CVE-2022-23589?

To resolve CVE-2022-23589, upgrade TensorFlow to version 2.7.1 or version 2.6.3 depending on your installed version.

3

Which versions of TensorFlow are affected by CVE-2022-23589?

CVE-2022-23589 affects TensorFlow versions up to 2.5.2, from 2.6.0 to 2.6.2, and version 2.7.0.

4

What component of TensorFlow is impacted by CVE-2022-23589?

The Grappler component of TensorFlow is the specific area impacted by CVE-2022-23589.

5

Can CVE-2022-23589 be exploited by a malicious SavedModel file?

Yes, CVE-2022-23589 can be triggered by a malicious alteration of a SavedModel file leading to a null pointer dereference.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203