CVE-2020-15212: TensorFlow Lite Negative Element Insertion Vulnerability

tensorflow-gpu Updated 02 Oct 2025

Summary

25/09/2020
Yes i
Unrated
Not published

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

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.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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.1 2.2.1
    pip install --upgrade "tensorflow-gpu==2.2.1"
  • >= 2.3.0, < 2.3.1 2.3.1
    pip 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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

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.1 2.2.1
    pip install --upgrade "tensorflow-gpu==2.2.1"
  • >= 2.3.0, < 2.3.1 2.3.1
    pip 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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback