CVE-2020-15193: TensorFlow - Uninitialized Memory Corruption in dlpack.to_dlpack
Summary
CVE-2020-15193: In Tensorflow before versions 2.2.1 and 2.3.1, the implementation of dlpack.to_dlpack can be made to use uninitialized memory resulting in further memory corruption. Affects tensorflow across 3 version ranges.
< 2.2.1
>= 2.3.0rc0, < 2.3.1
< 22e07fb204386768e5bcbea563641ea11f96ceb8
Fixed in 2.2.1 or 2.3.1, depending on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2020-15193 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 building and training neural networks. It provides a comprehensive set of tools and libraries for numerical computation and dataflow programming. The dlpack.to_dlpack function in TensorFlow is responsible for converting TensorFlow tensors to the DLPack format, which enables interoperability with other deep learning frameworks. However, a vulnerability in the implementation of dlpack.to_dlpack allows uninitialized memory to be used, leading to further memory corruption.
Vulnerability Detail
The vulnerability in TensorFlow arises from the pybind11 glue code assuming that the argument passed to dlpack.to_dlpack is a tensor. However, users can pass a Python object instead of a tensor, resulting in uninitialized memory usage. The issue occurs due to a reinterpret_cast operation, which fails when casting a PyObject to an EagerTensor. This uninitialized memory can lead to memory corruption and potentially enable an attacker to execute arbitrary code. The vulnerability is patched in commit 22e07fb204386768e5bcbea563641ea11f96ceb8 and is addressed in TensorFlow versions 2.2.1 and 2.3.1.
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.2.12.2.1pip install --upgrade "tensorflow==2.2.1" -
>= 2.3.0rc0, < 2.3.12.3.1pip install --upgrade "tensorflow==2.3.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 available for this vulnerability. However, users can mitigate the risk by avoiding the usage of dlpack.to_dlpack with Python objects instead of tensors. It is recommended to validate the input and ensure that only tensors are passed to the function.
Conclusion
The vulnerability in TensorFlow's dlpack.to_dlpack function allows uninitialized memory usage, leading to memory corruption. It is crucial to update TensorFlow to versions 2.2.1 or 2.3.1 to mitigate this vulnerability. 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 building and training neural networks.
dlpack.to_dlpack is a function in TensorFlow that converts TensorFlow tensors to the DLPack format for interoperability with other deep learning frameworks.
The vulnerability occurs because the pybind11 glue code assumes that the argument passed to dlpack.to_dlpack is a tensor, but users can pass a Python object instead, leading to uninitialized memory usage.
The vulnerability can result in memory corruption and potentially allow an attacker to execute arbitrary code.
To fix the vulnerability, update TensorFlow to version 2.2.1 or 2.3.1.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.