CVE-2022-35965: TensorFlow Segfault Vulnerability in LowerBound and UpperBound Functions

tensorflow Updated 18 Jul 2026

Summary

13/07/2026
Yes i
Moderate
5.9

CVE-2022-35965: TensorFlow vulnerable to segfault in LowerBound and UpperBound. Affects tensorflow across 3 version ranges.

< 2.7.2 >= 2.8.0, < 2.8.1 >= 2.9.0, < 2.9.1

Fixed in 2.7.2, 2.8.1 or 2.9.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-35965 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an open-source machine learning library developed by Google, widely used for building and training machine learning models. It provides a flexible ecosystem of tools, libraries, and community resources that allow researchers and developers to create and deploy machine learning applications. This vulnerability affects TensorFlow's LowerBound and UpperBound functions, which are designed to find the position of a value in a sorted input. When provided with empty sorted inputs, these functions can lead to a segmentation fault, causing potential denial of service.

Vulnerability Detail

The vulnerability arises when the LowerBound or UpperBound functions are called with an empty sorted_inputs parameter. This results in a null pointer dereference, leading to a segmentation fault. An attacker could exploit this vulnerability to trigger a denial of service attack, causing the application to crash. The issue is particularly concerning as it can be triggered easily with minimal input, making it a potential target for malicious users.

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.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip install --upgrade "tensorflow==2.9.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, ensure that the sorted_inputs parameter is not empty before calling the LowerBound or UpperBound functions. For example:

import tensorflow as tf

out_type = tf.int32 sorted_inputs = tf.constant([], shape=[10,0], dtype=tf.float32) values = tf.constant([], shape=[10,10,0,10,0], dtype=tf.float32) if tf.size(sorted_inputs) > 0: tf.raw_ops.LowerBound(sorted_inputs=sorted_inputs, values=values, out_type=out_type) else: print('sorted_inputs cannot be empty')

Conclusion

CVE-2022-35965 is a significant vulnerability in TensorFlow that can lead to application crashes if not addressed. It is crucial to update to the latest patched version or implement workarounds to mitigate the risk of denial of service attacks.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

CVE-2022-35965 is a vulnerability in TensorFlow that can cause a segmentation fault when the LowerBound or UpperBound functions are called with empty sorted inputs.

Exploiting this vulnerability can lead to a denial of service, causing your application to crash unexpectedly.

TensorFlow versions prior to 2.10.0, as well as 2.9.0, 2.8.0, and 2.7.0, are affected by this vulnerability.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground without any signup.

Implement a workaround by ensuring that the sorted_inputs parameter is not empty before calling the vulnerable functions.

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 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.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==2.8.1"
  • >= 2.9.0, < 2.9.1 2.9.1
    pip install --upgrade "tensorflow==2.9.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