Advisory

GHSA-87v6-crgm-2gfj

Also known as: BIT-tensorflow-2022-21735, CVE-2022-21735, PYSEC-2022-114, PYSEC-2022-59, PYSEC-2026-3134

Summary

Division by zero in Tensorflow

Details

Impact
The implementation of `FractionalMaxPool` can be made to crash a TensorFlow process via a division by 0:

import tensorflow as tf
import numpy as np

tf.raw_ops.FractionalMaxPool(
  value=tf.constant(value=[[[[1, 4, 2, 3]]]], dtype=tf.int64),
  pooling_ratio=[1.0, 1.44, 1.73, 1.0],
  pseudo_random=False,
  overlapping=False,
  deterministic=False,
  seed=0,
  seed2=0,
  name=None)

Patches
We have patched the issue in GitHub commit ba4e8ac4dc2991e350d5cc407f8598c8d4ee70fb.

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

High Basis: The source's own band: HIGH

Dates

Published
2022-02-10 00:21 UTC
Modified
2026-09-10 03:49 UTC

Affected packages and fixes

tensorflow

PyPI · All systems

Affected

  • introduced 0, fixed 2.5.3 (ecosystem)

Fixed versions

2.5.3

Fix

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

tensorflow

PyPI · All systems

Affected

  • introduced 2.6.0, fixed 2.6.3 (ecosystem)

Fixed versions

2.6.3

Fix

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

tensorflow

PyPI · All systems

Affected

  • introduced 2.7.0, fixed 2.7.1 (ecosystem)

Fixed versions

2.7.1

Fix

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

tensorflow-cpu

PyPI · All systems

Affected

  • introduced 0, fixed 2.5.3 (ecosystem)

Fixed versions

2.5.3

Fix

  • Fixed version 2.5.3
    pip install --upgrade tensorflow-cpu==2.5.3

tensorflow-cpu

PyPI · All systems

Affected

  • introduced 2.6.0, fixed 2.6.3 (ecosystem)

Fixed versions

2.6.3

Fix

  • Fixed version 2.6.3
    pip install --upgrade tensorflow-cpu==2.6.3

tensorflow-cpu

PyPI · All systems

Affected

  • introduced 2.7.0, fixed 2.7.1 (ecosystem)

Fixed versions

2.7.1

Fix

  • Fixed version 2.7.1
    pip install --upgrade tensorflow-cpu==2.7.1

tensorflow-gpu

PyPI · All systems

Affected

  • introduced 0, fixed 2.5.3 (ecosystem)

Fixed versions

2.5.3

Fix

  • Fixed version 2.5.3
    pip install --upgrade tensorflow-gpu==2.5.3

tensorflow-gpu

PyPI · All systems

Affected

  • introduced 2.6.0, fixed 2.6.3 (ecosystem)

Fixed versions

2.6.3

Fix

  • Fixed version 2.6.3
    pip install --upgrade tensorflow-gpu==2.6.3

tensorflow-gpu

PyPI · All systems

Affected

  • introduced 2.7.0, fixed 2.7.1 (ecosystem)

Fixed versions

2.7.1

Fix

  • Fixed version 2.7.1
    pip install --upgrade tensorflow-gpu==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: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences