CVE-2020-15214: Out of Bounds Write in TensorFlow-Lite
Summary
CVE-2020-15214: Out of bounds write in tensorflow-lite. Affects tensorflow across 2 version ranges.
>= 2.2.0, < 2.2.1
>= 2.3.0, < 2.3.1
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-15214 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 developed by Google. TensorFlow-Lite is a lightweight version of TensorFlow designed for mobile and embedded devices. It allows developers to deploy machine learning models on resource-constrained platforms. However, a vulnerability has been discovered in TensorFlow-Lite that can lead to an out of bounds write.
Vulnerability Detail
The vulnerability in TensorFlow-Lite occurs when using segment sum in models. If the segment ids are not sorted, it can trigger a write out of bounds or segmentation fault. The code assumes that the segment ids are in increasing order, but if they are not, it allocates insufficient memory for the output tensor and performs a write outside the bounds of the output array. This can result in a segmentation fault or provide a write gadget for future memory corruption-based exploits.
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.0, < 2.2.12.2.1pip install --upgrade "tensorflow==2.2.1" -
>= 2.3.0, < 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
A potential workaround is to add a custom Verifier to the model loading code to ensure that the segment ids are sorted. However, this workaround only handles the case when the segment ids are stored statically in the model. If the segment ids are generated at runtime between inference steps, a similar validation could be done. If the segment ids are generated as outputs of a tensor during inference steps, there are no possible workarounds, and upgrading to the patched code is advised.
Conclusion
The vulnerability in TensorFlow-Lite can lead to an out of bounds write or segmentation fault. It is recommended to upgrade to the patched versions of TensorFlow to fix the issue. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow →
FAQ
TensorFlow-Lite is a lightweight version of TensorFlow designed for mobile and embedded devices. It allows developers to deploy machine learning models on resource-constrained platforms.
The vulnerability can lead to a write out of bounds or segmentation fault in TensorFlow-Lite models using segment sum. It can also provide a write gadget for future memory corruption-based exploits.
The vulnerability has been patched in TensorFlow versions 2.2.1 and 2.3.1. It is recommended to upgrade to one of these patched versions.
A potential workaround is to add a custom Verifier to the model loading code to ensure that the segment ids are sorted. However, this workaround only handles certain cases. If the segment ids are generated at runtime between inference steps, a similar validation could be done. If the segment ids are generated as outputs of a tensor during inference steps, there are no possible workarounds.
This vulnerability was reported by members of the Aivul Team from Qihoo 360.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.