Advisory

GHSA-pfjj-m3jj-9jc9

Also known as: BIT-tensorflow-2022-21736, CVE-2022-21736, PYSEC-2022-115, PYSEC-2022-60, PYSEC-2026-3223

Summary

Undefined behavior in SparseTensorSliceDataset

Details

Impact
The implementation of `SparseTensorSliceDataset` has an undefined behavior: under certain condition it can be made to dereference a nullptr value:

import tensorflow as tf
import numpy as np

tf.raw_ops.SparseTensorSliceDataset(
  indices=[[]],
  values=[],
  dense_shape=[1,1])

The 3 input arguments represent a sparse tensor. However, there are some preconditions that these arguments must satisfy but these are not validated in the implementation.

Patches
We have patched the issue in GitHub commit 965b97e4a9650495cda5a8c210ef6684b4b9eceb.

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-09 23:43 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