CVE-2021-29513: TensorFlow - Null Pointer Dereference Vulnerability
Summary
CVE-2021-29513: Type confusion during tensor casts lead to dereferencing null pointers. Affects tensorflow across 4 version ranges.
< 2.1.4
>= 2.2.0, < 2.2.3
>= 2.3.0, < 2.3.3
>= 2.4.0, < 2.4.2
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
The same CVE-2021-29513 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 end-to-end open source platform for machine learning. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow allows users to perform various operations on tensors, which are multi-dimensional arrays. These operations are typically performed on numeric tensors. However, calling TensorFlow operations with tensors of non-numeric types can lead to null pointer dereferences.
Vulnerability Detail
The vulnerability in TensorFlow arises from a type confusion during the conversion from Python array to C++ array. This vulnerability can be exploited when TensorFlow operations that expect numeric tensors are called with non-numeric tensors. As a result, null pointer dereferences occur, leading to crashes or potentially allowing attackers to execute arbitrary code. The issue has been identified and fixed in TensorFlow 2.5.0. To mitigate the risk, it is recommended to update to the fixed versions of TensorFlow.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 2.1.42.1.4 -
>= 2.2.0, < 2.2.32.2.3 -
>= 2.3.0, < 2.3.32.3.3 -
>= 2.4.0, < 2.4.22.4.2
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 provided for this vulnerability. The recommended approach is to update TensorFlow to the fixed versions mentioned above.
Conclusion
The vulnerability in TensorFlow (CVE-2021-29513) exposes users to null pointer dereferences when non-numeric tensors are used in TensorFlow operations. To address this issue, it is crucial to update TensorFlow to the fixed versions (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4). For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow is an open source platform for machine learning that provides tools and resources for building and deploying machine learning models.
A null pointer dereference occurs when a program attempts to access or manipulate memory using a null pointer, resulting in a crash or potentially allowing attackers to execute arbitrary code.
The vulnerability in TensorFlow arises from a type confusion during the conversion from Python array to C++ array, which can be exploited when non-numeric tensors are passed to TensorFlow operations that expect numeric tensors.
The vulnerability can lead to null pointer dereferences, resulting in crashes or potentially allowing attackers to execute arbitrary code.
To mitigate the risk, it is recommended to update TensorFlow to the fixed versions (2.5.0, 2.4.2, 2.3.3, 2.2.3, or 2.1.4) that address the type confusion vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.