Null-dereference in `mlir::tfg::GraphDefImporter::ConvertNodeDef` in TensorFlow
Description
TensorFlow is an open source platform for machine learning. When mlir::tfg::GraphDefImporter::ConvertNodeDef tries to convert NodeDefs without an op name, it crashes. We have patched the issue in GitHub commit a0f0b9a21c9270930457095092f558fbad4c03e5. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | < 2.7.2 | 2.7.2 |
tensorflowPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflowPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-cpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-cpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-cpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
tensorflow-gpuPyPI | < 2.7.2 | 2.7.2 |
tensorflow-gpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-gpuPyPI | >= 2.9.0, < 2.9.1 | 2.9.1 |
Affected products
1- Range: < 2.7.2
Patches
1a0f0b9a21c92[TF] NodeDefs without an op name are invalid, return error on import
2 files changed · +23 −0
tensorflow/core/ir/importexport/graphdef_import.cc+3 −0 modified@@ -746,6 +746,9 @@ StatusOr<unsigned> GraphDefImporter::ArgNumType(const NamedAttrList &attrs, Status GraphDefImporter::ConvertNodeDef(OpBuilder &builder, ConversionState &s, const NodeDef &node) { VLOG(4) << "Importing: " << node.name(); + if (node.op().empty()) + return InvalidArgument("Node ", node.name(), " has an empty op name"); + OperationState state(ConvertLocation(node), absl::StrCat("tfg.", node.op())); // The GraphImporter does light shape inference, but here we will defer all of
tensorflow/core/ir/importexport/tests/graphdef_to_mlir/invalid_op_name.pbtxt+20 −0 added@@ -0,0 +1,20 @@ +# RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s + +# CHECK: Node has an empty op name + +library { + function { + signature { + name: "\\344\\264\\264" + description: "value" + is_distributed_communication: true + } + node_def { + input: "|" + } + control_ret { + key: "" + value: "" + } + } +} \ No newline at end of file
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-828c-5j5q-vrjqghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-36013ghsaADVISORY
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/ir/importexport/graphdef_import.ccghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/commit/a0f0b9a21c9270930457095092f558fbad4c03e5ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.10.0ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-828c-5j5q-vrjqghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.