CVE-2020-15214: TensorFlow Lite Segment Sum Write Out of Bounds Vulnerability
Summary
CVE-2020-15214: In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger a write out bounds / segmentation fault if the segment ids are not sorted. Affects tensorflow-cpu across 3 version ranges.
>= 2.2.0, < 2.2.1
>= 2.3.0, < 2.3.1
< 204945b19e44b57906c9344c0d00120eeeae178a
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 · PyPI
- tensorflow-gpu · PyPI
- tensorflow · 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 Lite is an open-source deep learning framework designed for mobile and embedded devices. It allows developers to deploy machine learning models on resource-constrained platforms. The framework provides various operations, including segment sum, which calculates the sum of segments in a tensor based on segment IDs. However, prior to versions 2.2.1 and 2.3.1, TensorFlow Lite models using segment sum can trigger a write out of bounds or segmentation fault if the segment IDs are not sorted. This occurs because the code assumes that the segment IDs are in increasing order, leading to insufficient memory allocation for the output tensor and potential memory corruption.
Vulnerability Detail
The vulnerability in TensorFlow Lite arises from the incorrect assumption that segment IDs used in segment sum operations are always sorted. When the segment IDs are not sorted, the code allocates insufficient memory for the output tensor, resulting in a write outside the bounds of the output array. This can lead to a segmentation fault or provide a write gadget for future memory corruption-based exploits. The issue has been patched in commit 204945b19e44b57906c9344c0d00120eeeae178a and is released 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-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.
-
>= 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
A potential workaround for this vulnerability is to add a custom Verifier to the model loading code to ensure that the segment IDs are sorted. However, this workaround only applies when the segment IDs are stored statically in the model. If the segment IDs are generated at runtime between inference steps, there is no possible workaround, and users are strongly recommended to upgrade to the patched code.
Conclusion
The TensorFlow Lite Segment Sum Write Out of Bounds Vulnerability (CVE-2020-15214) affects versions prior to 2.2.1 and 2.3.1. It can result in a write out of bounds or segmentation fault when segment IDs used in segment sum operations are not sorted. This vulnerability has been patched in TensorFlow versions 2.2.1 and 2.3.1. Users are advised to upgrade to the patched versions to mitigate the risk of memory corruption and potential exploits. For further support 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 mobile and embedded devices. It allows developers to deploy machine learning models on resource-constrained platforms.
The segment sum operation in TensorFlow Lite calculates the sum of segments in a tensor based on segment IDs. It is commonly used in tasks such as natural language processing and graph algorithms.
If the segment IDs used in segment sum operations are not sorted, it can trigger a write out of bounds or segmentation fault. This occurs due to incorrect memory allocation for the output tensor, potentially leading to memory corruption.
To fix the vulnerability, users of TensorFlow Lite should upgrade to the patched versions 2.2.1 or 2.3.1. This can be done by updating the package using the package manager or by manually downloading and installing the updated version from the official TensorFlow repository.
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 applies when the segment IDs are stored statically in the model. If the segment IDs are generated at runtime between inference steps, there is no possible workaround, and users are strongly recommended to upgrade to the patched code.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.