CVE-2022-36012: TensorFlow - Assertion Fail on MLIR Empty Edge Names

tensorflow Updated 02 Oct 2025

Summary

16/09/2022
Yes i
Moderate
5.9

CVE-2022-36012: TensorFlow vulnerable to assertion fail on MLIR empty edge names. Affects tensorflow across 3 version ranges.

< 2.7.2 >= 2.8.0, < 2.8.1 >= 2.9.0, < 2.9.1

Fixed in 2.7.2, 2.8.1 or 2.9.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-36012 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open-source machine learning framework that provides a comprehensive ecosystem of tools, libraries, and community resources. It is widely used for developing and deploying machine learning models in various domains. TensorFlow allows users to define and execute computational graphs, which represent the flow of data and operations in a machine learning model. This vulnerability affects versions of TensorFlow prior to 2.7.2, 2.8.1, and 2.9.1.

Vulnerability Detail

The vulnerability arises in the mlir::tfg::ConvertGenericFunctionToFunctionDef function in the functiondef_import.cc file. When empty function attributes are provided, the function crashes due to an assertion failure. This can be observed in the code snippet below:

SmallVector<Value> ret_vals(func.ret_size() + func.control_ret_size(), Value());
for (const auto& ret_val : func.ret()) {
  auto position = output_name_to_position.find(ret_val.first);
  if (position == output_name_to_position.end())
    return InvalidArgument(
        "Can't import function, returned value references unknown output "
        "argument ",
        ret_val.first);
  ret_vals[position->second] =
      value_manager.GetValueOrCreatePlaceholder(ret_val.second);
}

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip install --upgrade "tensorflow==2.9.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

In conclusion, the vulnerability in TensorFlow versions prior to 2.7.2, 2.8.1, and 2.9.1 can result in a crash when empty function attributes are provided. It is crucial to update to the fixed versions or apply the provided patch to ensure the security and stability of TensorFlow installations. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models.

The vulnerability can lead to a crash in the mlir::tfg::ConvertGenericFunctionToFunctionDef function when empty function attributes are provided.

Versions of TensorFlow prior to 2.7.2, 2.8.1, and 2.9.1 are affected.

To fix the vulnerability, it is recommended to upgrade to TensorFlow versions 2.7.2, 2.8.1, or 2.9.1.

No specific workaround has been mentioned for this vulnerability.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 2.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip install --upgrade "tensorflow==2.9.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback