CVE-2022-23570: TensorFlow Null-Dereference Vulnerability
Summary
CVE-2022-23570: Tensorflow is an Open Source Machine Learning Framework. Affects tensorflow-cpu across 3 version ranges.
< 2.5.3
>= 2.6.0, < 2.6.3
< 8a513cec4bec15961fbfdedcaa5376522980455c
Fixed in 2.5.3 or 2.6.3, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-gpu · PyPI
The same CVE-2022-23570 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 widely used for developing and deploying machine learning models. It provides a comprehensive ecosystem of tools, libraries, and resources for building and training neural networks. TensorFlow supports various platforms and programming languages, making it a popular choice among developers and researchers in the field of artificial intelligence. However, a vulnerability has been discovered in TensorFlow that can lead to a null-dereference error when decoding a tensor from protobuf.
Vulnerability Detail
The vulnerability in TensorFlow arises when attributes of mutable arguments to certain operations are missing from the protobuf. This can result in a null-dereference error during the decoding process. In production builds, where the DCHECK guard is a no-op, the execution proceeds to dereference the null pointer, potentially causing unexpected behavior or crashes. In debug builds, the DCHECK assertion failure leads to a crash. The impact of this vulnerability can range from data corruption to denial of service. The issue has been identified and fixed in TensorFlow 2.8.0, with backports to TensorFlow 2.7.1 and 2.6.3.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==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.5.32.5.3pip install --upgrade "tensorflow-cpu==2.5.3" -
>= 2.6.0, < 2.6.32.6.3pip install --upgrade "tensorflow-cpu==2.6.3"
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a workaround, developers can manually check and ensure that all attributes of mutable arguments to operations are present in the protobuf before decoding the tensor. This can be achieved by validating the protobuf structure and handling missing attributes appropriately. Here is an example code snippet demonstrating the workaround:
import tensorflow as tf
from tensorflow.core.framework import tensor_pb2
def decode_protobuf(protobuf_data):
tensor_proto = tensor_pb2.TensorProto()
tensor_proto.ParseFromString(protobuf_data)
if not tensor_proto.attr:
# Handle missing attributes
...
tensor = tf.make_tensor_proto(tensor_proto)
...
Conclusion
The null-dereference vulnerability in TensorFlow can have serious consequences, including data corruption and denial of service. It is crucial to update TensorFlow to the fixed versions or apply the provided patches to mitigate these risks. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow is an open-source machine learning framework used for developing and deploying machine learning models. It provides a comprehensive ecosystem of tools and resources for building neural networks.
A null-dereference vulnerability occurs when a program attempts to access or dereference a null pointer, leading to unexpected behavior or crashes.
The vulnerability in TensorFlow arises when attributes of mutable arguments to certain operations are missing from the protobuf, resulting in a null-dereference error during tensor decoding.
The vulnerability can lead to data corruption, unexpected behavior, or denial of service if exploited. It is important to update TensorFlow to the fixed versions to mitigate these risks.
To fix the vulnerability, update TensorFlow to version 2.8.0 or apply the respective patches for TensorFlow 2.7.1 and 2.6.3. Ensure all dependencies and associated libraries are also updated.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.