Advisory

PYSEC-2021-552

Also known as: BIT-tensorflow-2021-37639, CVE-2021-37639, GHSA-gh6x-4whr-2qv4, PYSEC-2021-261, PYSEC-2021-750

Summary

The record has no summary.

Details

TensorFlow is an end-to-end open source platform for machine learning. When restoring tensors via raw APIs, if the tensor name is not provided, TensorFlow can be tricked into dereferencing a null pointer. Alternatively, attackers can read memory outside the bounds of heap allocated data by providing some tensor names but not enough for a successful restoration. The implementation retrieves the tensor list corresponding to the tensor_name user controlled input and immediately retrieves the tensor at the restoration index (controlled via preferred_shard argument). This occurs without validating that the provided list has enough values. If the list is empty this results in dereferencing a null pointer (undefined behavior). If, however, the list has some elements, if the restoration index is outside the bounds this results in heap OOB read. We have patched the issue in GitHub commit 9e82dce6e6bd1f36a57e08fa85af213e2b2f2622. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Severity

Not rated by the source.

Dates

Published
2021-08-12 19:15 UTC
Modified
2023-12-06 01:01 UTC

Affected packages and fixes

tensorflow-cpu

PyPI · All systems

Affected

  • introduced 2.3.0, fixed 2.3.4, introduced 2.4.0, fixed 2.4.3 (ecosystem)

Fixed versions

2.3.4, 2.4.3

Fix

  • Fixed version 2.3.4
    pip install --upgrade tensorflow-cpu==2.3.4
  • Fixed version 2.4.3
    pip install --upgrade tensorflow-cpu==2.4.3

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