CVE-2019-16778: Heap buffer overflow in TensorFlow's UnsortedSegmentSum

tensorflow Updated 02 Oct 2025

Summary

16/12/2019
Yes i
Low
2.6

CVE-2019-16778: Heap buffer overflow in UnsortedSegmentSum in TensorFlow. Affects tensorflow versions < 1.15.0. Fixed in 1.15.0. How to fix ↓

Also tracked for

The same CVE-2019-16778 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and resources for building and deploying machine learning models. TensorFlow is widely used in various domains, including research, industry, and academia. However, a vulnerability has been discovered in the UnsortedSegmentSum function of TensorFlow, which can lead to a heap buffer overflow.

Vulnerability Detail

The vulnerability arises when the Index template argument of UnsortedSegmentSum is set to int32. Due to truncation from int64 to int32, the data_size and num_segments fields can become negative, resulting in accessing out-of-bounds heap memory. Although it is unlikely to be exploitable, it is recommended to update to TensorFlow 1.15 or 2.0 or later versions, as these versions have already fixed the issue.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.15.0

This is the first release that contains the fix.

pip install --upgrade "tensorflow==1.15.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

In conclusion, the vulnerability in TensorFlow's UnsortedSegmentSum function can lead to a heap buffer overflow. It is recommended to update to TensorFlow 1.15 or 2.0 or later versions to mitigate this issue. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open-source machine learning framework developed by Google. It provides tools and resources for building and deploying machine learning models.

UnsortedSegmentSum is a TensorFlow function that performs a segmented sum operation on a given input tensor. It groups the elements based on a specified segment index and computes the sum within each segment.

The vulnerability occurs when the Index template argument of UnsortedSegmentSum is set to int32. This leads to truncation of data_size and num_segments fields, resulting in negative values and accessing out-of-bounds heap memory.

The vulnerability is unlikely to be exploitable. However, it is still recommended to update to the fixed versions of TensorFlow to ensure security.

To update TensorFlow, refer to the official TensorFlow documentation for installation and upgrading instructions.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

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 version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.15.0

This is the first release that contains the fix.

pip install --upgrade "tensorflow==1.15.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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