Advisory

PYSEC-2026-3164

Also known as: BIT-tensorflow-2022-21737, CVE-2022-21737, GHSA-f2vv-v9cg-qhh7, PYSEC-2022-116, PYSEC-2022-61

Summary

Assertion failure based denial of service in Tensorflow

Details

Impact
The implementation of `*Bincount` operations allows malicious users to cause denial of service by passing in arguments which would trigger a CHECK-fail:

import tensorflow as tf

tf.raw_ops.DenseBincount(
  input=[[0], [1], [2]],
  size=[1],
  weights=[3,2,1],
  binary_output=False)

There are several conditions that the input arguments must satisfy. Some are not caught during shape inference and others are not caught during kernel implementation. This results in CHECK failures later when the output tensors get allocated.

Patches
We have patched the issue in GitHub commit 7019ce4f68925fd01cdafde26f8d8c938f47e6f9.

The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution
This vulnerability has been reported by Faysal Hossain Shezan from University of Virginia.

Severity

Medium Basis: CVSS v3 score 6.5, vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2026-07-09 16:49 UTC
Modified
2026-07-13 16:43 UTC

Affected packages and fixes

tensorflow

PyPI · All systems

Affected

  • introduced 0, fixed 2.5.3, introduced 2.6.0, fixed 2.6.3, introduced 2.7.0, fixed 2.7.1 (ecosystem)

Fixed versions

2.5.3, 2.6.3, 2.7.1

Fix

  • Fixed version 2.5.3
    pip install --upgrade tensorflow==2.5.3
  • Fixed version 2.6.3
    pip install --upgrade tensorflow==2.6.3
  • Fixed version 2.7.1
    pip install --upgrade tensorflow==2.7.1

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences