CVE-2020-15207: TensorFlow Lite Negative Indexing Out-of-Bounds Access
Summary
CVE-2020-15207: In tensorflow-lite before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, to mimic Python's indexing with negative values, TFLite uses ResolveAxis to convert negative values to positive indices. Affects tensorflow-cpu across 6 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
< 2d88f470dea2671b430884260f3626b1fe99830a
Fixed in 5 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Also tracked for
- tensorflow · Bitnami
- tensorflow · PyPI
- tensorflow-gpu · PyPI
- tensorflow · PyPI
The same CVE-2020-15207 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 designed for resource-constrained devices. It provides a lightweight solution for running machine learning models on mobile and embedded devices. TensorFlow Lite utilizes various optimizations to ensure efficient execution on limited hardware resources.
Vulnerability Detail
The vulnerability (CVE-2020-15207) in TensorFlow Lite versions before 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1 arises from the mishandling of negative indices. To mimic Python's indexing with negative values, TensorFlow Lite uses ResolveAxis to convert negative values to positive indices. However, the validation check for the converted index is only present in debug builds. In release builds, if the DCHECK does not trigger, code execution proceeds with a negative index. This leads to accessing data out of bounds, resulting in segmentation faults and potential data corruption.
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.
-
< 1.15.41.15.4pip install --upgrade "tensorflow-cpu==1.15.4" -
>= 2.0.0, < 2.0.32.0.3pip install --upgrade "tensorflow-cpu==2.0.3" -
>= 2.1.0, < 2.1.22.1.2pip install --upgrade "tensorflow-cpu==2.1.2" -
>= 2.2.0, < 2.2.12.2.1pip install --upgrade "tensorflow-cpu==2.2.1" -
>= 2.3.0, < 2.3.12.3.1pip install --upgrade "tensorflow-cpu==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
As a workaround, users can modify the affected code to include explicit checks for negative indices and handle them appropriately. Here is an example of how to handle negative indices in Python:
index = -1
if index < 0:
index = len(data) + index
# Use the positive index
value = data[index]
Conclusion
The vulnerability (CVE-2020-15207) in TensorFlow Lite versions before 1.15.4, 2.0.3, 2.1.2, 2.2.1, and 2.3.1 allows for out-of-bounds access due to mishandling of negative indices. It is crucial to update TensorFlow Lite to the patched versions or apply the provided workaround to mitigate the risk of segmentation faults and data corruption. For further assistance on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-cpu →
FAQ
TensorFlow Lite is an open-source deep learning framework designed for resource-constrained devices. It allows running machine learning models on mobile and embedded devices with limited hardware resources.
This vulnerability can lead to segmentation faults and data corruption in TensorFlow Lite applications. An attacker could potentially exploit this issue to cause a denial-of-service or execute arbitrary code.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. It analyzes your Pipfile.lock and provides real-time alerts for open-source vulnerabilities.
Yes, a workaround is to manually handle negative indices in the affected code by performing explicit checks and converting them to positive indices.
To fix this vulnerability, update TensorFlow Lite to version 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1. These versions include the necessary patch to address the issue.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.