CVE-2020-15212: TensorFlow Lite Negative Element Insertion Vulnerability
Summary
CVE-2020-15212: In TensorFlow Lite before versions 2.2.1 and 2.3.1, models using segment sum can trigger writes outside of bounds of heap allocated buffers by inserting negative elements in the segment ids tensor. Affects tensorflow-gpu 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-cpu · PyPI
- tensorflow · PyPI
The same CVE-2020-15212 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. TensorFlow Lite includes various operations, including segment sum, which can be used to perform element-wise summation of segments in a tensor. However, prior to versions 2.2.1 and 2.3.1, TensorFlow Lite was vulnerable to negative element insertion in the segment ids tensor, leading to writes outside of the bounds of heap allocated buffers.
Vulnerability Detail
The vulnerability arises when negative elements are inserted in the segment ids tensor. This allows users with access to segment_ids_data to alter output_index and write outside of the output_data buffer. While this can result in a segmentation fault, it can also be exploited to corrupt memory and potentially chain with other vulnerabilities. The issue has been patched in TensorFlow versions 2.2.1 and 2.3.1.
How To Fix
Latest published version: 2.12.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-gpu==2.12.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-gpu==2.2.1" -
>= 2.3.0, < 2.3.12.3.1pip install --upgrade "tensorflow-gpu==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 all positive. This can handle 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 can be performed. However, if the segment ids are generated as outputs of a tensor during inference steps, there are no possible workarounds.
Conclusion
The TensorFlow Lite negative element insertion vulnerability allows users to write outside of allocated buffers by inserting negative elements in the segment ids tensor. This can lead to a segmentation fault and potential memory corruption. Upgrading to TensorFlow versions 2.2.1 or 2.3.1 is recommended to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tensorflow-gpu →
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 performs element-wise summation of segments in a tensor.
The vulnerability occurs when negative elements are inserted in the segment ids tensor, allowing users to write outside of the allocated buffer.
The vulnerability can result in a segmentation fault and can be used to corrupt memory. It can also be chained with other vulnerabilities to create more advanced exploits.
The vulnerability can be fixed by upgrading to TensorFlow versions 2.2.1 or 2.3.1, which include the necessary patch.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-gpu.