VYPR
Moderate severityNVD Advisory· Published Sep 16, 2022· Updated Apr 23, 2025

Null dereference on MLIR on empty function attributes in TensorFlow

CVE-2022-36011

Description

TensorFlow is an open source platform for machine learning. When mlir::tfg::ConvertGenericFunctionToFunctionDef is given empty function attributes, it gives a null dereference. We have patched the issue in GitHub commit 1cf45b831eeb0cab8655c9c7c5d06ec6f45fc41b. 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.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflowPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-cpuPyPI
< 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
>= 2.9.0, < 2.9.12.9.1
tensorflow-gpuPyPI
< 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
>= 2.9.0, < 2.9.12.9.1

Affected products

1

Patches

1
1cf45b831eeb

[tfg][functiondef_import] Emit error on empty function attributes

https://github.com/tensorflow/tensorflowA. Unique TensorFlowerMay 14, 2022via ghsa
2 files changed · +54 0
  • tensorflow/core/ir/importexport/functiondef_import.cc+2 0 modified
    @@ -333,6 +333,8 @@ Status ImportGenericFunction(
       // Import the function attributes with a `tf.` prefix to match the current
       // infrastructure expectations.
       for (const auto& namedAttr : func.attr()) {
    +    if (namedAttr.first.empty())
    +      return InvalidArgument("Invalid function attribute name");
         const std::string& name = "tf." + namedAttr.first;
         const AttrValue& tf_attr = namedAttr.second;
         TF_ASSIGN_OR_RETURN(Attribute attr,
    
  • tensorflow/core/ir/importexport/tests/graphdef_to_mlir/invalid_generic_function_attr_name.pbtxt+52 0 added
    @@ -0,0 +1,52 @@
    +# RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s
    +
    +# CHECK: Invalid function attribute name
    +
    +library {
    +  function {
    +    signature {
    +      name: "foo"
    +      input_arg {
    +        name: "a"
    +      }
    +      output_arg {
    +        name: "d"
    +      }
    +    }
    +    node_def {
    +      op: "Const"
    +      attr {
    +        key: "_b"
    +        value {
    +          placeholder: "T"
    +        }
    +      }
    +      attr {
    +        key: "dtype"
    +        value {
    +          type: DT_INT32
    +        }
    +      }
    +      attr {
    +        key: "value"
    +        value {
    +          tensor {
    +            dtype: DT_INT32
    +            tensor_shape {
    +            }
    +          }
    +        }
    +      }
    +    }
    +    ret {
    +      key: "d"
    +      value: "a"
    +    }
    +    attr {
    +      key: ""
    +      value {
    +        s: "a"
    +      }
    +    }
    +  }
    +}
    

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

5

News mentions

0

No linked articles in our index yet.