Wysoka

Heap OOB and CHECK fail in `ResourceGather`

  • Ujawniono: 12.08.2021
  • Aktualizacja: 11.10.2026 13:19

Impact

An attacker can trigger a crash via a CHECK-fail in debug builds of TensorFlow using tf.raw_ops.ResourceGather or a read from outside the bounds of heap allocated data in the same API in a release build:

python
import tensorflow as tf

tensor = tf.constant(value=[[1,2],[3,4],[5,6]],shape=(3,2),dtype=tf.uint32)
v = tf.Variable(tensor)
tf.raw_ops.ResourceGather(
  resource=v.handle,
  indices=[0],
  dtype=tf.uint32,
  batch_dims=10,
  validate_indices=False)

The implementation does not check that the batch_dims value that the user supplies is less than the rank of the input tensor.

Since the implementation uses several for loops over the dimensions of tensor, this results in reading data from outside the bounds of heap allocated buffer backing the tensor:

cc
    // batch_dims_ = > params.dims() (10 > 2)
    for (int i = 0; i < batch_dims_; ++i) {
      result_shape.AddDim(params.dim_size(i));
    }
    for (int i = batch_dims_; i < indices.dims(); ++i) {
      result_shape.AddDim(indices.dim_size(i));
    }
    for (int i = batch_dims_ + 1; i < params.dims(); ++i) {
      result_shape.AddDim(params.dim_size(i));
    }

In debug mode, .dim_size(i) validates that the argument is less than .dims() using a DCHECK. But the DCHECK is a no-op in release builds.

Patches

We have patched the issue in GitHub commit bc9c546ce7015c57c2f15c168b3d9201de679a1d.

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 7.3/10
Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H
Słabość (CWE)
CWE-125
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-276 - PyPA Advisory Database; CC BY 4.0

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

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

OSV / GitHub Advisory Database - GHSA-2r8p-fg3c-wcj4 - 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. Heap OOB and CHECK fail in `ResourceGather` ten wpis
    Wysoka · 7.3 CVE-2021-37654 < 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.