CVE-2020-15211: TensorFlow Lite Double Array Indexing Vulnerability
Summary
CVE-2020-15211: Out of bounds access in tensorflow-lite. Affects tensorflow across 5 version ranges.
< 1.15.4
>= 2.0.0, < 2.0.3
>= 2.1.0, < 2.1.2
>= 2.2.0, < 2.2.1
>= 2.3.0, < 2.3.1
Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · PyPI
The same CVE-2020-15211 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 Lite is an open-source deep learning framework developed by Google. It is designed to run machine learning models on resource-constrained devices such as mobile phones and embedded systems. TensorFlow Lite models are saved in the flatbuffer format, which uses a double indexing scheme for subgraphs, operators, and input/output tensors. This vulnerability affects versions before 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1 of TensorFlow Lite.
Vulnerability Detail
The vulnerability arises from the use of a negative -1 value as an index for optional tensors in the flatbuffer model. This allows writing and reading from outside the bounds of heap allocated arrays, resulting in both read and write gadgets. However, the impact is limited to a specific offset from the start of these arrays. The issue has been patched in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1.
How To Fix
Fixed versions by release line
The minimum fixed version depends on the release line you run.
-
< 1.15.41.15.4 -
>= 2.0.0, < 2.0.32.0.3 -
>= 2.1.0, < 2.1.22.1.2 -
>= 2.2.0, < 2.2.12.2.1 -
>= 2.3.0, < 2.3.12.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
A potential workaround is to add a custom Verifier to the model loading code to ensure that only operators which accept optional inputs use the -1 special value and only for the tensors that they expect to be optional. However, this approach is error-prone, and it is strongly advised to upgrade to the patched code instead.
Conclusion
The TensorFlow Lite double array indexing vulnerability (CVE-2020-15211) allows for potential memory corruption and arbitrary code execution. It is crucial to upgrade to the patched versions of TensorFlow Lite to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow Lite is an open-source deep learning framework developed by Google. It is designed to run machine learning models on resource-constrained devices such as mobile phones and embedded systems.
The vulnerability allows writing and reading from outside the bounds of heap allocated arrays, although only at a specific offset from the start of these arrays. This can potentially lead to memory corruption and arbitrary code execution.
To fix this vulnerability, upgrade to the patched versions of TensorFlow Lite (1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1). Update your TensorFlow Lite installation to ensure that the latest security fixes are applied.
A potential workaround is to add a custom Verifier to the model loading code to ensure that only operators which accept optional inputs use the -1 special value and only for the tensors that they expect to be optional. However, this approach is error-prone, and it is strongly advised to upgrade to the patched code instead.
For more information about this vulnerability, you can refer to the official TensorFlow documentation or contact the TensorFlow support team.
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.