CVE-2022-36012: TensorFlow - Assertion Fail on MLIR Empty Edge Names
Summary
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
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
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.
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.
No signup required · Results in about 60 seconds
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.22.7.2pip install --upgrade "tensorflow==2.7.2" -
>= 2.8.0, < 2.8.12.8.1pip install --upgrade "tensorflow==2.8.1" -
>= 2.9.0, < 2.9.12.9.1pip 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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.